@uncinc/uncinc-react-kitchen-sink 2.16.12 → 2.16.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -24,6 +24,8 @@ var MediaPlayer = function MediaPlayer(_ref) {
24
24
  notSupportedMessage = _ref.notSupportedMessage,
25
25
  className = _ref.className,
26
26
  onPlay = _ref.onPlay,
27
+ _ref$autoPlay = _ref.autoPlay,
28
+ autoPlay = _ref$autoPlay === void 0 ? false : _ref$autoPlay,
27
29
  onPause = _ref.onPause,
28
30
  onEnded = _ref.onEnded,
29
31
  onSeeking = _ref.onSeeking,
@@ -77,6 +79,7 @@ var MediaPlayer = function MediaPlayer(_ref) {
77
79
  techOrder: ['html5', 'youtube', 'vimeo'],
78
80
  poster: posterUrl,
79
81
  controlBar: controlBar,
82
+ autoplay: autoPlay,
80
83
  sources: [{
81
84
  src: src,
82
85
  type: type
@@ -92,10 +95,14 @@ var MediaPlayer = function MediaPlayer(_ref) {
92
95
  // Passing down the VideoJS events.
93
96
  useEffect(function () {
94
97
  if (ready) {
95
- if (onPlay) {
98
+ if (autoPlay && onPlay) {
96
99
  player.one('play', function (event) {
97
100
  return onPlay(player, event);
98
101
  });
102
+ } else if (!autoPlay && onPlay) {
103
+ player.on('play', function (event) {
104
+ return onPlay(player, event);
105
+ });
99
106
  }
100
107
  if (onPause) {
101
108
  player.one('pause', function (event) {
@@ -13,6 +13,7 @@ export type MediaPlayerProps = {
13
13
  options?: VideoJsPlayerOptions;
14
14
  captions?: VideoJsPlayerOptions['tracks'];
15
15
  audioOnly?: boolean;
16
+ autoPlay?: boolean;
16
17
  notSupportedMessage?: string;
17
18
  className?: string;
18
19
  onPlay?: (player: NativeVideoJsPlayer, event: EventTarget) => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uncinc/uncinc-react-kitchen-sink",
3
- "version": "2.16.12",
3
+ "version": "2.16.13",
4
4
  "description": "Default React components that are easily extended.",
5
5
  "author": "uncinc",
6
6
  "license": "MIT",