@micromag/element-video 0.3.459 → 0.3.460

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.
package/es/index.js CHANGED
@@ -42,6 +42,7 @@ var propTypes = {
42
42
  onVolumeChange: PropTypes$1.func,
43
43
  onSuspend: PropTypes$1.func,
44
44
  onSuspended: PropTypes$1.func,
45
+ onPlayError: PropTypes$1.func,
45
46
  focusable: PropTypes$1.bool,
46
47
  withPoster: PropTypes$1.bool,
47
48
  withLoading: PropTypes$1.bool
@@ -74,6 +75,7 @@ var defaultProps = {
74
75
  onVolumeChange: null,
75
76
  onSuspend: null,
76
77
  onSuspended: null,
78
+ onPlayError: null,
77
79
  focusable: true,
78
80
  withPoster: false,
79
81
  withLoading: false
@@ -105,6 +107,7 @@ var Video = function Video(_ref) {
105
107
  customOnVolumeChange = _ref.onVolumeChange,
106
108
  customOnSuspend = _ref.onSuspend,
107
109
  onSuspended = _ref.onSuspended,
110
+ onPlayError = _ref.onPlayError,
108
111
  focusable = _ref.focusable,
109
112
  withPoster = _ref.withPoster,
110
113
  withLoading = _ref.withLoading,
@@ -252,9 +255,14 @@ var Video = function Video(_ref) {
252
255
  if (paused && !isPaused) {
253
256
  element.pause();
254
257
  } else if (!paused && isPaused) {
255
- element.play();
258
+ element.play()["catch"](function (e) {
259
+ if (onPlayError !== null) {
260
+ onPlayError(e);
261
+ }
262
+ });
256
263
  }
257
- }, [paused]);
264
+ }, [paused, media, onPlayError]); // test media here for fun
265
+
258
266
  useProgressSteps({
259
267
  currentTime: currentTime,
260
268
  duration: duration,
package/lib/index.js CHANGED
@@ -44,6 +44,7 @@ var propTypes = {
44
44
  onVolumeChange: PropTypes.func,
45
45
  onSuspend: PropTypes.func,
46
46
  onSuspended: PropTypes.func,
47
+ onPlayError: PropTypes.func,
47
48
  focusable: PropTypes.bool,
48
49
  withPoster: PropTypes.bool,
49
50
  withLoading: PropTypes.bool
@@ -76,6 +77,7 @@ var defaultProps = {
76
77
  onVolumeChange: null,
77
78
  onSuspend: null,
78
79
  onSuspended: null,
80
+ onPlayError: null,
79
81
  focusable: true,
80
82
  withPoster: false,
81
83
  withLoading: false
@@ -107,6 +109,7 @@ var Video = function Video(_ref) {
107
109
  customOnVolumeChange = _ref.onVolumeChange,
108
110
  customOnSuspend = _ref.onSuspend,
109
111
  onSuspended = _ref.onSuspended,
112
+ onPlayError = _ref.onPlayError,
110
113
  focusable = _ref.focusable,
111
114
  withPoster = _ref.withPoster,
112
115
  withLoading = _ref.withLoading,
@@ -254,9 +257,14 @@ var Video = function Video(_ref) {
254
257
  if (paused && !isPaused) {
255
258
  element.pause();
256
259
  } else if (!paused && isPaused) {
257
- element.play();
260
+ element.play()["catch"](function (e) {
261
+ if (onPlayError !== null) {
262
+ onPlayError(e);
263
+ }
264
+ });
258
265
  }
259
- }, [paused]);
266
+ }, [paused, media, onPlayError]); // test media here for fun
267
+
260
268
  hooks.useProgressSteps({
261
269
  currentTime: currentTime,
262
270
  duration: duration,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@micromag/element-video",
3
- "version": "0.3.459",
3
+ "version": "0.3.460",
4
4
  "private": false,
5
5
  "description": "",
6
6
  "keywords": [
@@ -61,8 +61,8 @@
61
61
  "@fortawesome/fontawesome-svg-core": "^1.2.32",
62
62
  "@fortawesome/free-solid-svg-icons": "^5.15.1",
63
63
  "@fortawesome/react-fontawesome": "^0.1.13",
64
- "@micromag/core": "^0.3.459",
65
- "@micromag/element-closed-captions": "^0.3.459",
64
+ "@micromag/core": "^0.3.460",
65
+ "@micromag/element-closed-captions": "^0.3.460",
66
66
  "classnames": "^2.2.6",
67
67
  "lodash": "^4.17.21",
68
68
  "prop-types": "^15.7.2",
@@ -73,5 +73,5 @@
73
73
  "access": "public",
74
74
  "registry": "https://registry.npmjs.org/"
75
75
  },
76
- "gitHead": "4432e89197f9cebdc6b0c4c39ba65100fb5e0939"
76
+ "gitHead": "7e5a6ed3d80be59cdd74716781b467be88a4ccc6"
77
77
  }