@micromag/element-video 0.3.824 → 0.4.4
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/assets/css/styles.css +1 -1
- package/es/index.d.ts +3 -0
- package/es/index.js +65 -106
- package/es/styles.css +1 -0
- package/package.json +13 -12
package/assets/css/styles.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
.container{position:relative}.container .media{display:block;width:100%}.container .spinner{height:100%;height:32px;left:0;left:50%;margin-left:-16px;margin-top:-16px;position:absolute;top:0;top:50%;width:100%;width:32px}.container.withSize .media{height:100%;left:0;position:absolute;top:0;width:100%}
|
package/es/index.d.ts
ADDED
package/es/index.js
CHANGED
|
@@ -2,9 +2,7 @@ import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
|
2
2
|
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
3
3
|
import classNames from 'classnames';
|
|
4
4
|
import isFunction from 'lodash/isFunction';
|
|
5
|
-
import PropTypes from 'prop-types';
|
|
6
5
|
import React, { useMemo, useState, useEffect, useRef, useCallback } from 'react';
|
|
7
|
-
import { PropTypes as PropTypes$1 } from '@micromag/core';
|
|
8
6
|
import { Spinner } from '@micromag/core/components';
|
|
9
7
|
import { useMediaThumbnail, useMediaCurrentTime, useMediaDuration, useMediaReady, useProgressSteps } from '@micromag/core/hooks';
|
|
10
8
|
import { useSetting } from '@micromag/core/contexts';
|
|
@@ -84,108 +82,71 @@ function useSources(media) {
|
|
|
84
82
|
};
|
|
85
83
|
}
|
|
86
84
|
|
|
87
|
-
var styles = {"container":"
|
|
85
|
+
var styles = {"container":"container","media":"media","spinner":"spinner","withSize":"withSize"};
|
|
88
86
|
|
|
89
|
-
|
|
90
|
-
media
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
onPlayError: null,
|
|
153
|
-
focusable: true,
|
|
154
|
-
withPoster: false,
|
|
155
|
-
withLoading: false
|
|
156
|
-
};
|
|
157
|
-
var Video = function Video(_ref) {
|
|
158
|
-
var media = _ref.media,
|
|
159
|
-
thumbnail = _ref.thumbnail,
|
|
160
|
-
width = _ref.width,
|
|
161
|
-
height = _ref.height,
|
|
162
|
-
mediaRef = _ref.mediaRef,
|
|
163
|
-
muted = _ref.muted,
|
|
164
|
-
autoPlay = _ref.autoPlay,
|
|
165
|
-
paused = _ref.paused,
|
|
166
|
-
loop = _ref.loop,
|
|
167
|
-
playsInline = _ref.playsInline,
|
|
168
|
-
preload = _ref.preload,
|
|
169
|
-
shouldLoad = _ref.shouldLoad,
|
|
170
|
-
withoutCors = _ref.withoutCors,
|
|
171
|
-
className = _ref.className,
|
|
172
|
-
innerClassName = _ref.innerClassName,
|
|
173
|
-
onReady = _ref.onReady,
|
|
174
|
-
customOnPlay = _ref.onPlay,
|
|
175
|
-
onPause = _ref.onPause,
|
|
176
|
-
onEnded = _ref.onEnded,
|
|
177
|
-
onSeeked = _ref.onSeeked,
|
|
178
|
-
onTimeUpdate = _ref.onTimeUpdate,
|
|
179
|
-
onProgressStep = _ref.onProgressStep,
|
|
180
|
-
customOnDurationChange = _ref.onDurationChange,
|
|
181
|
-
customOnVolumeChange = _ref.onVolumeChange,
|
|
182
|
-
customOnSuspend = _ref.onSuspend,
|
|
183
|
-
onSuspended = _ref.onSuspended,
|
|
184
|
-
onPlayError = _ref.onPlayError,
|
|
185
|
-
focusable = _ref.focusable,
|
|
186
|
-
withPoster = _ref.withPoster,
|
|
187
|
-
withLoading = _ref.withLoading,
|
|
188
|
-
disablePictureInPicture = _ref.disablePictureInPicture;
|
|
87
|
+
function Video(_ref) {
|
|
88
|
+
var _ref$media = _ref.media,
|
|
89
|
+
media = _ref$media === void 0 ? null : _ref$media,
|
|
90
|
+
_ref$thumbnail = _ref.thumbnail,
|
|
91
|
+
thumbnail = _ref$thumbnail === void 0 ? null : _ref$thumbnail,
|
|
92
|
+
_ref$width = _ref.width,
|
|
93
|
+
width = _ref$width === void 0 ? null : _ref$width,
|
|
94
|
+
_ref$height = _ref.height,
|
|
95
|
+
height = _ref$height === void 0 ? null : _ref$height,
|
|
96
|
+
_ref$mediaRef = _ref.mediaRef,
|
|
97
|
+
mediaRef = _ref$mediaRef === void 0 ? null : _ref$mediaRef,
|
|
98
|
+
_ref$muted = _ref.muted,
|
|
99
|
+
muted = _ref$muted === void 0 ? false : _ref$muted,
|
|
100
|
+
_ref$autoPlay = _ref.autoPlay,
|
|
101
|
+
autoPlay = _ref$autoPlay === void 0 ? false : _ref$autoPlay,
|
|
102
|
+
_ref$paused = _ref.paused,
|
|
103
|
+
paused = _ref$paused === void 0 ? false : _ref$paused,
|
|
104
|
+
_ref$loop = _ref.loop,
|
|
105
|
+
loop = _ref$loop === void 0 ? false : _ref$loop,
|
|
106
|
+
_ref$playsInline = _ref.playsInline,
|
|
107
|
+
playsInline = _ref$playsInline === void 0 ? true : _ref$playsInline,
|
|
108
|
+
_ref$preload = _ref.preload,
|
|
109
|
+
preload = _ref$preload === void 0 ? 'auto' : _ref$preload,
|
|
110
|
+
_ref$shouldLoad = _ref.shouldLoad,
|
|
111
|
+
shouldLoad = _ref$shouldLoad === void 0 ? true : _ref$shouldLoad,
|
|
112
|
+
_ref$withoutCors = _ref.withoutCors,
|
|
113
|
+
withoutCors = _ref$withoutCors === void 0 ? false : _ref$withoutCors,
|
|
114
|
+
_ref$className = _ref.className,
|
|
115
|
+
className = _ref$className === void 0 ? null : _ref$className,
|
|
116
|
+
_ref$innerClassName = _ref.innerClassName,
|
|
117
|
+
innerClassName = _ref$innerClassName === void 0 ? null : _ref$innerClassName,
|
|
118
|
+
_ref$onReady = _ref.onReady,
|
|
119
|
+
onReady = _ref$onReady === void 0 ? null : _ref$onReady,
|
|
120
|
+
_ref$onPlay = _ref.onPlay,
|
|
121
|
+
customOnPlay = _ref$onPlay === void 0 ? null : _ref$onPlay,
|
|
122
|
+
_ref$onPause = _ref.onPause,
|
|
123
|
+
onPause = _ref$onPause === void 0 ? null : _ref$onPause,
|
|
124
|
+
_ref$onEnded = _ref.onEnded,
|
|
125
|
+
onEnded = _ref$onEnded === void 0 ? null : _ref$onEnded,
|
|
126
|
+
_ref$onSeeked = _ref.onSeeked,
|
|
127
|
+
onSeeked = _ref$onSeeked === void 0 ? null : _ref$onSeeked,
|
|
128
|
+
_ref$onTimeUpdate = _ref.onTimeUpdate,
|
|
129
|
+
onTimeUpdate = _ref$onTimeUpdate === void 0 ? null : _ref$onTimeUpdate,
|
|
130
|
+
_ref$onProgressStep = _ref.onProgressStep,
|
|
131
|
+
onProgressStep = _ref$onProgressStep === void 0 ? null : _ref$onProgressStep,
|
|
132
|
+
_ref$onDurationChange = _ref.onDurationChange,
|
|
133
|
+
customOnDurationChange = _ref$onDurationChange === void 0 ? null : _ref$onDurationChange,
|
|
134
|
+
_ref$onVolumeChange = _ref.onVolumeChange,
|
|
135
|
+
customOnVolumeChange = _ref$onVolumeChange === void 0 ? null : _ref$onVolumeChange,
|
|
136
|
+
_ref$onSuspend = _ref.onSuspend,
|
|
137
|
+
customOnSuspend = _ref$onSuspend === void 0 ? null : _ref$onSuspend,
|
|
138
|
+
_ref$onSuspended = _ref.onSuspended,
|
|
139
|
+
onSuspended = _ref$onSuspended === void 0 ? null : _ref$onSuspended,
|
|
140
|
+
_ref$onPlayError = _ref.onPlayError,
|
|
141
|
+
onPlayError = _ref$onPlayError === void 0 ? null : _ref$onPlayError,
|
|
142
|
+
_ref$focusable = _ref.focusable,
|
|
143
|
+
focusable = _ref$focusable === void 0 ? true : _ref$focusable,
|
|
144
|
+
_ref$withPoster = _ref.withPoster,
|
|
145
|
+
withPoster = _ref$withPoster === void 0 ? false : _ref$withPoster,
|
|
146
|
+
_ref$withLoading = _ref.withLoading,
|
|
147
|
+
withLoading = _ref$withLoading === void 0 ? false : _ref$withLoading,
|
|
148
|
+
_ref$disablePictureIn = _ref.disablePictureInPicture,
|
|
149
|
+
disablePictureInPicture = _ref$disablePictureIn === void 0 ? true : _ref$disablePictureIn;
|
|
189
150
|
var _ref2 = media || {},
|
|
190
151
|
_ref2$url = _ref2.url,
|
|
191
152
|
mediaUrl = _ref2$url === void 0 ? null : _ref2$url,
|
|
@@ -357,9 +318,7 @@ var Video = function Video(_ref) {
|
|
|
357
318
|
})) : null, !isImageWithoutSourceFile && !ready && showLoading ? /*#__PURE__*/React.createElement(Spinner, {
|
|
358
319
|
className: styles.spinner
|
|
359
320
|
}) : null);
|
|
360
|
-
}
|
|
361
|
-
Video.propTypes = propTypes;
|
|
362
|
-
Video.defaultProps = defaultProps;
|
|
321
|
+
}
|
|
363
322
|
var Video_default = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
364
323
|
return /*#__PURE__*/React.createElement(Video, Object.assign({
|
|
365
324
|
mediaRef: ref
|
package/es/styles.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.container{position:relative}.container .media{display:block;width:100%}.container .spinner{height:100%;height:32px;left:0;left:50%;margin-left:-16px;margin-top:-16px;position:absolute;top:0;top:50%;width:100%;width:32px}.container.withSize .media{height:100%;left:0;position:absolute;top:0;width:100%}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@micromag/element-video",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.4",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "",
|
|
6
6
|
"keywords": [
|
|
@@ -34,6 +34,7 @@
|
|
|
34
34
|
"module": "es/index.js",
|
|
35
35
|
"exports": {
|
|
36
36
|
".": {
|
|
37
|
+
"types": "./es/index.d.ts",
|
|
37
38
|
"import": "./es/index.js"
|
|
38
39
|
},
|
|
39
40
|
"./assets/css/styles": "./assets/css/styles.css",
|
|
@@ -47,30 +48,30 @@
|
|
|
47
48
|
"scripts": {
|
|
48
49
|
"clean": "rm -rf es && rm -rf lib && rm -rf assets",
|
|
49
50
|
"prepublishOnly": "npm run build",
|
|
50
|
-
"build": "../../scripts/prepare-package.sh"
|
|
51
|
+
"build": "../../scripts/prepare-package.sh --types"
|
|
51
52
|
},
|
|
52
53
|
"devDependencies": {
|
|
53
|
-
"react": "^
|
|
54
|
-
"react-dom": "^
|
|
54
|
+
"react": "^19.2.0",
|
|
55
|
+
"react-dom": "^18.3.0 || ^19.0.0"
|
|
55
56
|
},
|
|
56
57
|
"peerDependencies": {
|
|
57
|
-
"react": "^
|
|
58
|
-
"react-dom": "^
|
|
58
|
+
"react": "^19.2.0",
|
|
59
|
+
"react-dom": "^18.3.0 || ^19.0.0"
|
|
59
60
|
},
|
|
60
61
|
"dependencies": {
|
|
61
62
|
"@babel/runtime": "^7.13.10",
|
|
62
|
-
"@micromag/core": "^0.
|
|
63
|
-
"@micromag/element-closed-captions": "^0.
|
|
63
|
+
"@micromag/core": "^0.4.4",
|
|
64
|
+
"@micromag/element-closed-captions": "^0.4.4",
|
|
64
65
|
"classnames": "^2.2.6",
|
|
65
66
|
"hls.js": "^1.5.15",
|
|
66
|
-
"lodash": "^4.17.
|
|
67
|
-
"
|
|
68
|
-
"react-intl": "^6.6.4",
|
|
67
|
+
"lodash": "^4.17.23",
|
|
68
|
+
"react-intl": "^8.1.3",
|
|
69
69
|
"uuid": "^9.0.0"
|
|
70
70
|
},
|
|
71
71
|
"publishConfig": {
|
|
72
72
|
"access": "public",
|
|
73
73
|
"registry": "https://registry.npmjs.org/"
|
|
74
74
|
},
|
|
75
|
-
"gitHead": "
|
|
75
|
+
"gitHead": "04b8519c3a3ddace5a21497e22faa11865d57f6d",
|
|
76
|
+
"types": "es/index.d.ts"
|
|
76
77
|
}
|