@folklore/hooks 0.0.51 → 0.0.53
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 +6 -4
- package/dist/es.js +6 -4
- package/package.json +2 -2
package/dist/cjs.js
CHANGED
|
@@ -267,14 +267,14 @@ function useDailymotionPlayer() {
|
|
|
267
267
|
function onDurationChange() {
|
|
268
268
|
currentMetadata = {
|
|
269
269
|
...currentMetadata,
|
|
270
|
-
duration: player.
|
|
270
|
+
duration: player.videoDuration
|
|
271
271
|
};
|
|
272
272
|
setMetadata(currentMetadata);
|
|
273
273
|
debug('onDurationChange [ID: %s]', videoId);
|
|
274
274
|
}
|
|
275
275
|
function onVolumeChange() {
|
|
276
|
-
setMuted(player.
|
|
277
|
-
setVolumeState(player.
|
|
276
|
+
setMuted(player.playerIsMuted);
|
|
277
|
+
setVolumeState(player.playerVolume);
|
|
278
278
|
debug('onVolumeChange [ID: %s]', videoId);
|
|
279
279
|
}
|
|
280
280
|
function onPlay() {
|
|
@@ -401,11 +401,13 @@ function useDailymotionPlayer() {
|
|
|
401
401
|
const {
|
|
402
402
|
playing
|
|
403
403
|
} = playState;
|
|
404
|
+
const getCurrentTime = react.useCallback(player => player.videoTime, []);
|
|
404
405
|
const currentTime = usePlayerCurrentTime(playerRef.current, {
|
|
405
406
|
id: videoId,
|
|
406
407
|
disabled: !playing || timeUpdateInterval === null,
|
|
407
408
|
updateInterval: timeUpdateInterval,
|
|
408
|
-
onUpdate: customOnTimeUpdate
|
|
409
|
+
onUpdate: customOnTimeUpdate,
|
|
410
|
+
getCurrentTime
|
|
409
411
|
});
|
|
410
412
|
return {
|
|
411
413
|
ref: elementRef,
|
package/dist/es.js
CHANGED
|
@@ -256,14 +256,14 @@ function useDailymotionPlayer() {
|
|
|
256
256
|
function onDurationChange() {
|
|
257
257
|
currentMetadata = {
|
|
258
258
|
...currentMetadata,
|
|
259
|
-
duration: player.
|
|
259
|
+
duration: player.videoDuration
|
|
260
260
|
};
|
|
261
261
|
setMetadata(currentMetadata);
|
|
262
262
|
debug('onDurationChange [ID: %s]', videoId);
|
|
263
263
|
}
|
|
264
264
|
function onVolumeChange() {
|
|
265
|
-
setMuted(player.
|
|
266
|
-
setVolumeState(player.
|
|
265
|
+
setMuted(player.playerIsMuted);
|
|
266
|
+
setVolumeState(player.playerVolume);
|
|
267
267
|
debug('onVolumeChange [ID: %s]', videoId);
|
|
268
268
|
}
|
|
269
269
|
function onPlay() {
|
|
@@ -390,11 +390,13 @@ function useDailymotionPlayer() {
|
|
|
390
390
|
const {
|
|
391
391
|
playing
|
|
392
392
|
} = playState;
|
|
393
|
+
const getCurrentTime = useCallback(player => player.videoTime, []);
|
|
393
394
|
const currentTime = usePlayerCurrentTime(playerRef.current, {
|
|
394
395
|
id: videoId,
|
|
395
396
|
disabled: !playing || timeUpdateInterval === null,
|
|
396
397
|
updateInterval: timeUpdateInterval,
|
|
397
|
-
onUpdate: customOnTimeUpdate
|
|
398
|
+
onUpdate: customOnTimeUpdate,
|
|
399
|
+
getCurrentTime
|
|
398
400
|
});
|
|
399
401
|
return {
|
|
400
402
|
ref: elementRef,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@folklore/hooks",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.53",
|
|
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": "366fadd7e10892a27ee589e2eeab73c5c851100a",
|
|
53
53
|
"dependencies": {
|
|
54
54
|
"@folklore/events": "^0.0.5",
|
|
55
55
|
"@folklore/services": "^0.1.40",
|