@micromag/element-video 0.3.332 → 0.3.336
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 +8 -5
- package/lib/index.js +8 -5
- package/package.json +2 -2
package/es/index.js
CHANGED
|
@@ -41,7 +41,8 @@ var propTypes = {
|
|
|
41
41
|
onSuspend: PropTypes$1.func,
|
|
42
42
|
onSuspended: PropTypes$1.func,
|
|
43
43
|
focusable: PropTypes$1.bool,
|
|
44
|
-
withPoster: PropTypes$1.bool
|
|
44
|
+
withPoster: PropTypes$1.bool,
|
|
45
|
+
withLoading: PropTypes$1.bool
|
|
45
46
|
};
|
|
46
47
|
var defaultProps = {
|
|
47
48
|
media: null,
|
|
@@ -70,7 +71,8 @@ var defaultProps = {
|
|
|
70
71
|
onSuspend: null,
|
|
71
72
|
onSuspended: null,
|
|
72
73
|
focusable: true,
|
|
73
|
-
withPoster: false
|
|
74
|
+
withPoster: false,
|
|
75
|
+
withLoading: false
|
|
74
76
|
};
|
|
75
77
|
var Video = function Video(_ref) {
|
|
76
78
|
var _ref7;
|
|
@@ -100,7 +102,8 @@ var Video = function Video(_ref) {
|
|
|
100
102
|
customOnSuspend = _ref.onSuspend,
|
|
101
103
|
onSuspended = _ref.onSuspended,
|
|
102
104
|
focusable = _ref.focusable,
|
|
103
|
-
withPoster = _ref.withPoster
|
|
105
|
+
withPoster = _ref.withPoster,
|
|
106
|
+
withLoading = _ref.withLoading;
|
|
104
107
|
var _ref2 = media || {},
|
|
105
108
|
_ref2$url = _ref2.url,
|
|
106
109
|
mediaUrl = _ref2$url === void 0 ? null : _ref2$url,
|
|
@@ -137,7 +140,7 @@ var Video = function Video(_ref) {
|
|
|
137
140
|
useEffect(function () {
|
|
138
141
|
var id = null;
|
|
139
142
|
setShowLoading(false);
|
|
140
|
-
if (mediaUrl) {
|
|
143
|
+
if (mediaUrl && withLoading) {
|
|
141
144
|
id = setTimeout(function () {
|
|
142
145
|
setShowLoading(true);
|
|
143
146
|
}, 2000);
|
|
@@ -145,7 +148,7 @@ var Video = function Video(_ref) {
|
|
|
145
148
|
return function () {
|
|
146
149
|
clearTimeout(id);
|
|
147
150
|
};
|
|
148
|
-
}, [mediaUrl]);
|
|
151
|
+
}, [mediaUrl, withLoading]);
|
|
149
152
|
var sourceFiles = useMemo(function () {
|
|
150
153
|
if (filesArray.length === 0) {
|
|
151
154
|
return null;
|
package/lib/index.js
CHANGED
|
@@ -53,7 +53,8 @@ var propTypes = {
|
|
|
53
53
|
onSuspend: PropTypes__default["default"].func,
|
|
54
54
|
onSuspended: PropTypes__default["default"].func,
|
|
55
55
|
focusable: PropTypes__default["default"].bool,
|
|
56
|
-
withPoster: PropTypes__default["default"].bool
|
|
56
|
+
withPoster: PropTypes__default["default"].bool,
|
|
57
|
+
withLoading: PropTypes__default["default"].bool
|
|
57
58
|
};
|
|
58
59
|
var defaultProps = {
|
|
59
60
|
media: null,
|
|
@@ -82,7 +83,8 @@ var defaultProps = {
|
|
|
82
83
|
onSuspend: null,
|
|
83
84
|
onSuspended: null,
|
|
84
85
|
focusable: true,
|
|
85
|
-
withPoster: false
|
|
86
|
+
withPoster: false,
|
|
87
|
+
withLoading: false
|
|
86
88
|
};
|
|
87
89
|
var Video = function Video(_ref) {
|
|
88
90
|
var _ref7;
|
|
@@ -112,7 +114,8 @@ var Video = function Video(_ref) {
|
|
|
112
114
|
customOnSuspend = _ref.onSuspend,
|
|
113
115
|
onSuspended = _ref.onSuspended,
|
|
114
116
|
focusable = _ref.focusable,
|
|
115
|
-
withPoster = _ref.withPoster
|
|
117
|
+
withPoster = _ref.withPoster,
|
|
118
|
+
withLoading = _ref.withLoading;
|
|
116
119
|
var _ref2 = media || {},
|
|
117
120
|
_ref2$url = _ref2.url,
|
|
118
121
|
mediaUrl = _ref2$url === void 0 ? null : _ref2$url,
|
|
@@ -149,7 +152,7 @@ var Video = function Video(_ref) {
|
|
|
149
152
|
React.useEffect(function () {
|
|
150
153
|
var id = null;
|
|
151
154
|
setShowLoading(false);
|
|
152
|
-
if (mediaUrl) {
|
|
155
|
+
if (mediaUrl && withLoading) {
|
|
153
156
|
id = setTimeout(function () {
|
|
154
157
|
setShowLoading(true);
|
|
155
158
|
}, 2000);
|
|
@@ -157,7 +160,7 @@ var Video = function Video(_ref) {
|
|
|
157
160
|
return function () {
|
|
158
161
|
clearTimeout(id);
|
|
159
162
|
};
|
|
160
|
-
}, [mediaUrl]);
|
|
163
|
+
}, [mediaUrl, withLoading]);
|
|
161
164
|
var sourceFiles = React.useMemo(function () {
|
|
162
165
|
if (filesArray.length === 0) {
|
|
163
166
|
return null;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@micromag/element-video",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.336",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"javascript"
|
|
@@ -64,5 +64,5 @@
|
|
|
64
64
|
"publishConfig": {
|
|
65
65
|
"access": "public"
|
|
66
66
|
},
|
|
67
|
-
"gitHead": "
|
|
67
|
+
"gitHead": "b5514916d2f4e88b20bc5f04af4d4b696c85a114"
|
|
68
68
|
}
|