@folklore/hooks 0.0.48 → 0.0.49
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/dist/cjs.js +20 -30
- package/dist/es.js +20 -30
- package/package.json +2 -2
package/dist/cjs.js
CHANGED
|
@@ -260,14 +260,6 @@ function useDailymotionPlayer() {
|
|
|
260
260
|
setLoaded(true);
|
|
261
261
|
debug('onPlaybackReady [ID: %s]', videoId);
|
|
262
262
|
}
|
|
263
|
-
function onLoadedMetadata() {
|
|
264
|
-
currentMetadata = {
|
|
265
|
-
...currentMetadata,
|
|
266
|
-
duration: player.duration
|
|
267
|
-
};
|
|
268
|
-
setMetadata(currentMetadata);
|
|
269
|
-
debug('onLoadedMetadata [ID: %s]', videoId);
|
|
270
|
-
}
|
|
271
263
|
function onDurationChange() {
|
|
272
264
|
currentMetadata = {
|
|
273
265
|
...currentMetadata,
|
|
@@ -343,29 +335,27 @@ function useDailymotionPlayer() {
|
|
|
343
335
|
setPlayState(currentPlayState);
|
|
344
336
|
debug('onAdEnd [ID: %s]', videoId);
|
|
345
337
|
}
|
|
346
|
-
player.
|
|
347
|
-
player.
|
|
348
|
-
player.
|
|
349
|
-
player.
|
|
350
|
-
player.
|
|
351
|
-
player.
|
|
352
|
-
player.
|
|
353
|
-
player.
|
|
354
|
-
player.
|
|
355
|
-
player.
|
|
356
|
-
player.addEventListener('ad_end', onAdEnd);
|
|
338
|
+
player.on('PLAYER_CRITICALPATHREADY', onPlaybackReady);
|
|
339
|
+
player.on('VIDEO_DURATIONCHANGE', onDurationChange);
|
|
340
|
+
player.on('PLAYER_VOLUMECHANGE', onVolumeChange);
|
|
341
|
+
player.on('VIDEO_PLAY', onPlay);
|
|
342
|
+
player.on('VIDEO_PAUSE', onPause);
|
|
343
|
+
player.on('VIDEO_END', onEnd);
|
|
344
|
+
player.on('VIDEO_PLAYING', onPlaying);
|
|
345
|
+
player.on('VIDEO_BUFFERING', onWaiting);
|
|
346
|
+
player.on('AD_START', onAdStart);
|
|
347
|
+
player.on('AD_END', onAdEnd);
|
|
357
348
|
return () => {
|
|
358
|
-
player.
|
|
359
|
-
player.
|
|
360
|
-
player.
|
|
361
|
-
player.
|
|
362
|
-
player.
|
|
363
|
-
player.
|
|
364
|
-
player.
|
|
365
|
-
player.
|
|
366
|
-
player.
|
|
367
|
-
player.
|
|
368
|
-
player.removeEventListener('ad_end', onAdEnd);
|
|
349
|
+
player.off('PLAYER_CRITICALPATHREADY', onPlaybackReady);
|
|
350
|
+
player.off('VIDEO_DURATIONCHANGE', onDurationChange);
|
|
351
|
+
player.off('PLAYER_VOLUMECHANGE', onVolumeChange);
|
|
352
|
+
player.off('VIDEO_PLAY', onPlay);
|
|
353
|
+
player.off('VIDEO_PAUSE', onPause);
|
|
354
|
+
player.off('VIDEO_END', onEnd);
|
|
355
|
+
player.off('VIDEO_PLAYING', onPlaying);
|
|
356
|
+
player.off('VIDEO_BUFFERING', onWaiting);
|
|
357
|
+
player.off('AD_START', onAdStart);
|
|
358
|
+
player.off('AD_END', onAdEnd);
|
|
369
359
|
};
|
|
370
360
|
}, [playerRef.current, playerReady, videoId, setLoaded, setPlayState, setMetadata, setVolumeState, setMuted]);
|
|
371
361
|
const play = react.useCallback(() => {
|
package/dist/es.js
CHANGED
|
@@ -249,14 +249,6 @@ function useDailymotionPlayer() {
|
|
|
249
249
|
setLoaded(true);
|
|
250
250
|
debug('onPlaybackReady [ID: %s]', videoId);
|
|
251
251
|
}
|
|
252
|
-
function onLoadedMetadata() {
|
|
253
|
-
currentMetadata = {
|
|
254
|
-
...currentMetadata,
|
|
255
|
-
duration: player.duration
|
|
256
|
-
};
|
|
257
|
-
setMetadata(currentMetadata);
|
|
258
|
-
debug('onLoadedMetadata [ID: %s]', videoId);
|
|
259
|
-
}
|
|
260
252
|
function onDurationChange() {
|
|
261
253
|
currentMetadata = {
|
|
262
254
|
...currentMetadata,
|
|
@@ -332,29 +324,27 @@ function useDailymotionPlayer() {
|
|
|
332
324
|
setPlayState(currentPlayState);
|
|
333
325
|
debug('onAdEnd [ID: %s]', videoId);
|
|
334
326
|
}
|
|
335
|
-
player.
|
|
336
|
-
player.
|
|
337
|
-
player.
|
|
338
|
-
player.
|
|
339
|
-
player.
|
|
340
|
-
player.
|
|
341
|
-
player.
|
|
342
|
-
player.
|
|
343
|
-
player.
|
|
344
|
-
player.
|
|
345
|
-
player.addEventListener('ad_end', onAdEnd);
|
|
327
|
+
player.on('PLAYER_CRITICALPATHREADY', onPlaybackReady);
|
|
328
|
+
player.on('VIDEO_DURATIONCHANGE', onDurationChange);
|
|
329
|
+
player.on('PLAYER_VOLUMECHANGE', onVolumeChange);
|
|
330
|
+
player.on('VIDEO_PLAY', onPlay);
|
|
331
|
+
player.on('VIDEO_PAUSE', onPause);
|
|
332
|
+
player.on('VIDEO_END', onEnd);
|
|
333
|
+
player.on('VIDEO_PLAYING', onPlaying);
|
|
334
|
+
player.on('VIDEO_BUFFERING', onWaiting);
|
|
335
|
+
player.on('AD_START', onAdStart);
|
|
336
|
+
player.on('AD_END', onAdEnd);
|
|
346
337
|
return () => {
|
|
347
|
-
player.
|
|
348
|
-
player.
|
|
349
|
-
player.
|
|
350
|
-
player.
|
|
351
|
-
player.
|
|
352
|
-
player.
|
|
353
|
-
player.
|
|
354
|
-
player.
|
|
355
|
-
player.
|
|
356
|
-
player.
|
|
357
|
-
player.removeEventListener('ad_end', onAdEnd);
|
|
338
|
+
player.off('PLAYER_CRITICALPATHREADY', onPlaybackReady);
|
|
339
|
+
player.off('VIDEO_DURATIONCHANGE', onDurationChange);
|
|
340
|
+
player.off('PLAYER_VOLUMECHANGE', onVolumeChange);
|
|
341
|
+
player.off('VIDEO_PLAY', onPlay);
|
|
342
|
+
player.off('VIDEO_PAUSE', onPause);
|
|
343
|
+
player.off('VIDEO_END', onEnd);
|
|
344
|
+
player.off('VIDEO_PLAYING', onPlaying);
|
|
345
|
+
player.off('VIDEO_BUFFERING', onWaiting);
|
|
346
|
+
player.off('AD_START', onAdStart);
|
|
347
|
+
player.off('AD_END', onAdEnd);
|
|
358
348
|
};
|
|
359
349
|
}, [playerRef.current, playerReady, videoId, setLoaded, setPlayState, setMetadata, setVolumeState, setMuted]);
|
|
360
350
|
const play = useCallback(() => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@folklore/hooks",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.49",
|
|
4
4
|
"description": "React hooks",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"javascript",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"publishConfig": {
|
|
50
50
|
"access": "public"
|
|
51
51
|
},
|
|
52
|
-
"gitHead": "
|
|
52
|
+
"gitHead": "38fde5f3467984d23d88161c2bb0c5f8c7ae2109",
|
|
53
53
|
"dependencies": {
|
|
54
54
|
"@folklore/events": "^0.0.5",
|
|
55
55
|
"@folklore/services": "^0.1.40",
|