@folklore/hooks 0.0.55 → 0.0.56
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 +4 -3
- package/dist/es.js +4 -3
- package/package.json +2 -2
package/dist/cjs.js
CHANGED
|
@@ -135,6 +135,7 @@ function useDailymotionPlayer() {
|
|
|
135
135
|
uiLogo = false,
|
|
136
136
|
uiStartScreenInfo = true,
|
|
137
137
|
timeUpdateInterval = 1000,
|
|
138
|
+
embedPlayerId = null,
|
|
138
139
|
onTimeUpdate: customOnTimeUpdate = null,
|
|
139
140
|
getVideoId = url => {
|
|
140
141
|
if (url === null || url.match(/^https?:/) === null) {
|
|
@@ -187,7 +188,7 @@ function useDailymotionPlayer() {
|
|
|
187
188
|
if (!apiLoaded && videoId !== null) {
|
|
188
189
|
debug('Load API');
|
|
189
190
|
services.loadDailymotion({
|
|
190
|
-
url: 'https://geo.dailymotion.com/libs/player.js',
|
|
191
|
+
url: embedPlayerId !== null ? `https://geo.dailymotion.com/libs/player/${embedPlayerId}.js` : 'https://geo.dailymotion.com/libs/player.js',
|
|
191
192
|
callback: null
|
|
192
193
|
}).then(api => {
|
|
193
194
|
if (!canceled) {
|
|
@@ -200,7 +201,7 @@ function useDailymotionPlayer() {
|
|
|
200
201
|
return () => {
|
|
201
202
|
canceled = true;
|
|
202
203
|
};
|
|
203
|
-
}, [videoId, apiLoaded, setApiLoaded]);
|
|
204
|
+
}, [videoId, apiLoaded, setApiLoaded, embedPlayerId]);
|
|
204
205
|
|
|
205
206
|
// Create or update player
|
|
206
207
|
react.useEffect(() => {
|
|
@@ -248,7 +249,7 @@ function useDailymotionPlayer() {
|
|
|
248
249
|
debug('Create player [ID: %s]', videoId);
|
|
249
250
|
}
|
|
250
251
|
playerElementRef.current = element;
|
|
251
|
-
}, [apiLoaded, elementHasChanged, videoId, width, height, autoplay,
|
|
252
|
+
}, [apiLoaded, elementHasChanged, videoId, width, height, autoplay, start, controls, queueAutoplayNext, queueEnable, sharingEnable, uiLogo, uiStartScreenInfo]);
|
|
252
253
|
react.useEffect(() => {
|
|
253
254
|
const {
|
|
254
255
|
current: player = null
|
package/dist/es.js
CHANGED
|
@@ -124,6 +124,7 @@ function useDailymotionPlayer() {
|
|
|
124
124
|
uiLogo = false,
|
|
125
125
|
uiStartScreenInfo = true,
|
|
126
126
|
timeUpdateInterval = 1000,
|
|
127
|
+
embedPlayerId = null,
|
|
127
128
|
onTimeUpdate: customOnTimeUpdate = null,
|
|
128
129
|
getVideoId = url => {
|
|
129
130
|
if (url === null || url.match(/^https?:/) === null) {
|
|
@@ -176,7 +177,7 @@ function useDailymotionPlayer() {
|
|
|
176
177
|
if (!apiLoaded && videoId !== null) {
|
|
177
178
|
debug('Load API');
|
|
178
179
|
loadDailymotion({
|
|
179
|
-
url: 'https://geo.dailymotion.com/libs/player.js',
|
|
180
|
+
url: embedPlayerId !== null ? `https://geo.dailymotion.com/libs/player/${embedPlayerId}.js` : 'https://geo.dailymotion.com/libs/player.js',
|
|
180
181
|
callback: null
|
|
181
182
|
}).then(api => {
|
|
182
183
|
if (!canceled) {
|
|
@@ -189,7 +190,7 @@ function useDailymotionPlayer() {
|
|
|
189
190
|
return () => {
|
|
190
191
|
canceled = true;
|
|
191
192
|
};
|
|
192
|
-
}, [videoId, apiLoaded, setApiLoaded]);
|
|
193
|
+
}, [videoId, apiLoaded, setApiLoaded, embedPlayerId]);
|
|
193
194
|
|
|
194
195
|
// Create or update player
|
|
195
196
|
useEffect(() => {
|
|
@@ -237,7 +238,7 @@ function useDailymotionPlayer() {
|
|
|
237
238
|
debug('Create player [ID: %s]', videoId);
|
|
238
239
|
}
|
|
239
240
|
playerElementRef.current = element;
|
|
240
|
-
}, [apiLoaded, elementHasChanged, videoId, width, height, autoplay,
|
|
241
|
+
}, [apiLoaded, elementHasChanged, videoId, width, height, autoplay, start, controls, queueAutoplayNext, queueEnable, sharingEnable, uiLogo, uiStartScreenInfo]);
|
|
241
242
|
useEffect(() => {
|
|
242
243
|
const {
|
|
243
244
|
current: player = null
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@folklore/hooks",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.56",
|
|
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": "075c1674bbedc9d3a0aea9facf98fdb2391105ce",
|
|
53
53
|
"dependencies": {
|
|
54
54
|
"@folklore/events": "^0.0.5",
|
|
55
55
|
"@folklore/services": "^0.1.40",
|