@folklore/hooks 0.0.70 → 0.0.71
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 +11 -7
- package/dist/es.js +11 -7
- package/package.json +2 -2
package/dist/cjs.js
CHANGED
|
@@ -67,7 +67,8 @@ function useDailymotionPlayer() {
|
|
|
67
67
|
width = 0,
|
|
68
68
|
height = 0,
|
|
69
69
|
duration = 0,
|
|
70
|
-
muted:
|
|
70
|
+
muted: providedMuted = false,
|
|
71
|
+
initialMuted = false,
|
|
71
72
|
start = 0,
|
|
72
73
|
embedPlayerId = null,
|
|
73
74
|
onTimeUpdate: customOnTimeUpdate = null,
|
|
@@ -100,8 +101,8 @@ function useDailymotionPlayer() {
|
|
|
100
101
|
playerElementRef.current = elementRef.current;
|
|
101
102
|
}
|
|
102
103
|
const elementHasChanged = elementRef.current !== playerElementRef.current;
|
|
103
|
-
const [muted, setMuted] = react.useState(initialMuted);
|
|
104
|
-
const [volume, setVolumeState] = react.useState(initialMuted ? 0 : 1);
|
|
104
|
+
const [muted, setMuted] = react.useState(initialMuted || providedMuted);
|
|
105
|
+
const [volume, setVolumeState] = react.useState(initialMuted || providedMuted ? 0 : 1);
|
|
105
106
|
const [currentTime, setCurrentTime] = react.useState(0);
|
|
106
107
|
const [playState, setPlayState] = react.useState({
|
|
107
108
|
playing: false,
|
|
@@ -927,6 +928,7 @@ function useNativeVideoPlayer(url) {
|
|
|
927
928
|
width = 0,
|
|
928
929
|
height = 0,
|
|
929
930
|
duration = 0,
|
|
931
|
+
muted: providedMuted = false,
|
|
930
932
|
initialMuted = false,
|
|
931
933
|
timeUpdateInterval = 1000,
|
|
932
934
|
onTimeUpdate: customOnTimeUpdate = null
|
|
@@ -934,7 +936,7 @@ function useNativeVideoPlayer(url) {
|
|
|
934
936
|
const debug = react.useMemo(() => createDebug('folklore:video:native'), []);
|
|
935
937
|
const elementRef = react.useRef(null);
|
|
936
938
|
const [loaded, setLoaded] = react.useState(false);
|
|
937
|
-
const [muted, setMuted] = react.useState(initialMuted);
|
|
939
|
+
const [muted, setMuted] = react.useState(initialMuted || providedMuted);
|
|
938
940
|
const [playState, setPlayState] = react.useState({
|
|
939
941
|
playing: false,
|
|
940
942
|
paused: false,
|
|
@@ -1122,6 +1124,7 @@ function useVimeoPlayer(id) {
|
|
|
1122
1124
|
autopause = true,
|
|
1123
1125
|
byline = false,
|
|
1124
1126
|
controls = false,
|
|
1127
|
+
muted: providedMuted = false,
|
|
1125
1128
|
initialMuted = false,
|
|
1126
1129
|
timeUpdateInterval = 1000,
|
|
1127
1130
|
onTimeUpdate: customOnTimeUpdate = null,
|
|
@@ -1143,7 +1146,7 @@ function useVimeoPlayer(id) {
|
|
|
1143
1146
|
const videoId = react.useMemo(() => getVideoId(id), [id]);
|
|
1144
1147
|
const [ready, setReady] = react.useState(false);
|
|
1145
1148
|
const [loaded, setLoaded] = react.useState(false);
|
|
1146
|
-
const [volume, setVolumeState] = react.useState(initialMuted ? 0 : 1);
|
|
1149
|
+
const [volume, setVolumeState] = react.useState(initialMuted || providedMuted ? 0 : 1);
|
|
1147
1150
|
const [playState, setPlayState] = react.useState({
|
|
1148
1151
|
playing: false,
|
|
1149
1152
|
paused: false,
|
|
@@ -1423,7 +1426,8 @@ function useYouTubePlayer(id) {
|
|
|
1423
1426
|
autoplay = false,
|
|
1424
1427
|
controls = true,
|
|
1425
1428
|
timeUpdateInterval = 1000,
|
|
1426
|
-
muted:
|
|
1429
|
+
muted: providedMuted = false,
|
|
1430
|
+
initialMuted = false,
|
|
1427
1431
|
onVolumeChange: customOnVolumeChange = null,
|
|
1428
1432
|
onTimeUpdate: customOnTimeUpdate = null,
|
|
1429
1433
|
getVideoId = url => {
|
|
@@ -1447,7 +1451,7 @@ function useYouTubePlayer(id) {
|
|
|
1447
1451
|
const elementHasChanged = elementRef.current !== playerElementRef.current;
|
|
1448
1452
|
const videoId = react.useMemo(() => getVideoId(id), [id]);
|
|
1449
1453
|
const [ready, setReady] = react.useState(false);
|
|
1450
|
-
const [muted, setMuted] = react.useState(initialMuted);
|
|
1454
|
+
const [muted, setMuted] = react.useState(initialMuted || providedMuted);
|
|
1451
1455
|
const [playState, setPlayState] = react.useState({
|
|
1452
1456
|
playing: false,
|
|
1453
1457
|
paused: false,
|
package/dist/es.js
CHANGED
|
@@ -65,7 +65,8 @@ function useDailymotionPlayer() {
|
|
|
65
65
|
width = 0,
|
|
66
66
|
height = 0,
|
|
67
67
|
duration = 0,
|
|
68
|
-
muted:
|
|
68
|
+
muted: providedMuted = false,
|
|
69
|
+
initialMuted = false,
|
|
69
70
|
start = 0,
|
|
70
71
|
embedPlayerId = null,
|
|
71
72
|
onTimeUpdate: customOnTimeUpdate = null,
|
|
@@ -98,8 +99,8 @@ function useDailymotionPlayer() {
|
|
|
98
99
|
playerElementRef.current = elementRef.current;
|
|
99
100
|
}
|
|
100
101
|
const elementHasChanged = elementRef.current !== playerElementRef.current;
|
|
101
|
-
const [muted, setMuted] = useState(initialMuted);
|
|
102
|
-
const [volume, setVolumeState] = useState(initialMuted ? 0 : 1);
|
|
102
|
+
const [muted, setMuted] = useState(initialMuted || providedMuted);
|
|
103
|
+
const [volume, setVolumeState] = useState(initialMuted || providedMuted ? 0 : 1);
|
|
103
104
|
const [currentTime, setCurrentTime] = useState(0);
|
|
104
105
|
const [playState, setPlayState] = useState({
|
|
105
106
|
playing: false,
|
|
@@ -925,6 +926,7 @@ function useNativeVideoPlayer(url) {
|
|
|
925
926
|
width = 0,
|
|
926
927
|
height = 0,
|
|
927
928
|
duration = 0,
|
|
929
|
+
muted: providedMuted = false,
|
|
928
930
|
initialMuted = false,
|
|
929
931
|
timeUpdateInterval = 1000,
|
|
930
932
|
onTimeUpdate: customOnTimeUpdate = null
|
|
@@ -932,7 +934,7 @@ function useNativeVideoPlayer(url) {
|
|
|
932
934
|
const debug = useMemo(() => createDebug('folklore:video:native'), []);
|
|
933
935
|
const elementRef = useRef(null);
|
|
934
936
|
const [loaded, setLoaded] = useState(false);
|
|
935
|
-
const [muted, setMuted] = useState(initialMuted);
|
|
937
|
+
const [muted, setMuted] = useState(initialMuted || providedMuted);
|
|
936
938
|
const [playState, setPlayState] = useState({
|
|
937
939
|
playing: false,
|
|
938
940
|
paused: false,
|
|
@@ -1120,6 +1122,7 @@ function useVimeoPlayer(id) {
|
|
|
1120
1122
|
autopause = true,
|
|
1121
1123
|
byline = false,
|
|
1122
1124
|
controls = false,
|
|
1125
|
+
muted: providedMuted = false,
|
|
1123
1126
|
initialMuted = false,
|
|
1124
1127
|
timeUpdateInterval = 1000,
|
|
1125
1128
|
onTimeUpdate: customOnTimeUpdate = null,
|
|
@@ -1141,7 +1144,7 @@ function useVimeoPlayer(id) {
|
|
|
1141
1144
|
const videoId = useMemo(() => getVideoId(id), [id]);
|
|
1142
1145
|
const [ready, setReady] = useState(false);
|
|
1143
1146
|
const [loaded, setLoaded] = useState(false);
|
|
1144
|
-
const [volume, setVolumeState] = useState(initialMuted ? 0 : 1);
|
|
1147
|
+
const [volume, setVolumeState] = useState(initialMuted || providedMuted ? 0 : 1);
|
|
1145
1148
|
const [playState, setPlayState] = useState({
|
|
1146
1149
|
playing: false,
|
|
1147
1150
|
paused: false,
|
|
@@ -1421,7 +1424,8 @@ function useYouTubePlayer(id) {
|
|
|
1421
1424
|
autoplay = false,
|
|
1422
1425
|
controls = true,
|
|
1423
1426
|
timeUpdateInterval = 1000,
|
|
1424
|
-
muted:
|
|
1427
|
+
muted: providedMuted = false,
|
|
1428
|
+
initialMuted = false,
|
|
1425
1429
|
onVolumeChange: customOnVolumeChange = null,
|
|
1426
1430
|
onTimeUpdate: customOnTimeUpdate = null,
|
|
1427
1431
|
getVideoId = url => {
|
|
@@ -1445,7 +1449,7 @@ function useYouTubePlayer(id) {
|
|
|
1445
1449
|
const elementHasChanged = elementRef.current !== playerElementRef.current;
|
|
1446
1450
|
const videoId = useMemo(() => getVideoId(id), [id]);
|
|
1447
1451
|
const [ready, setReady] = useState(false);
|
|
1448
|
-
const [muted, setMuted] = useState(initialMuted);
|
|
1452
|
+
const [muted, setMuted] = useState(initialMuted || providedMuted);
|
|
1449
1453
|
const [playState, setPlayState] = useState({
|
|
1450
1454
|
playing: false,
|
|
1451
1455
|
paused: false,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@folklore/hooks",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.71",
|
|
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": "69c01b6d0bc94cf442c6ca8356c561272c54511f",
|
|
53
53
|
"dependencies": {
|
|
54
54
|
"@folklore/events": "^0.0.6",
|
|
55
55
|
"@folklore/services": "^0.1.43",
|