@eluvio/elv-player-js 2.0.6 → 2.0.7
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/.vite/manifest.json +17 -17
- package/dist/{Analytics-CTh8ex_T.mjs → Analytics-B84nIsJX.mjs} +1 -1
- package/dist/{Analytics-BBSXEwS9.js → Analytics-DSscOw1L.js} +1 -1
- package/dist/{dash.all.min-VhfS9TH7.mjs → dash.all.min-B90T_UZz.mjs} +1 -1
- package/dist/{dash.all.min-BvOABBaR.js → dash.all.min-SWFWgsyT.js} +1 -1
- package/dist/elv-player-js.cjs.js +1 -1
- package/dist/elv-player-js.css +1 -1
- package/dist/elv-player-js.es.js +1 -1
- package/dist/{index-nb3SLpgf.js → index-BrPAkRZj.js} +1 -1
- package/dist/{index-BNdC97NO.mjs → index-CS8bweI1.mjs} +2024 -2018
- package/dist/{index-Dm3yOJL4.mjs → index-CvpJ3Be3.mjs} +1 -1
- package/dist/{index-DjtnBiEN.js → index-D7OJm9wP.js} +46 -46
- package/lib/player/Controls.js +16 -1
- package/lib/static/stylesheets/controls-tv.module.scss +2 -0
- package/lib/static/stylesheets/controls-web.module.scss +4 -1
- package/lib/ui/PlayerUI.jsx +10 -0
- package/lib/ui/TVControls.jsx +8 -12
- package/lib/ui/WebControls.jsx +7 -16
- package/package.json +1 -1
package/lib/player/Controls.js
CHANGED
|
@@ -27,6 +27,12 @@ class PlayerControls {
|
|
|
27
27
|
this.player = player;
|
|
28
28
|
this.visible = true;
|
|
29
29
|
this.allowRotation = true;
|
|
30
|
+
this._activeMenus = 0;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
__ToggleMenu(active) {
|
|
34
|
+
this._activeMenus = active ? this._activeMenus + 1 : Math.max(0, this._activeMenus - 1);
|
|
35
|
+
this.player.__SettingsUpdate();
|
|
30
36
|
}
|
|
31
37
|
|
|
32
38
|
/**
|
|
@@ -39,6 +45,16 @@ class PlayerControls {
|
|
|
39
45
|
return this.visible;
|
|
40
46
|
}
|
|
41
47
|
|
|
48
|
+
/**
|
|
49
|
+
* Check if the player currently has a menu visible
|
|
50
|
+
*
|
|
51
|
+
* @methodGroup Controls
|
|
52
|
+
* @returns {boolean} - Whether or not a menu is currently visible
|
|
53
|
+
*/
|
|
54
|
+
IsMenuVisible() {
|
|
55
|
+
return this._activeMenus > 0;
|
|
56
|
+
}
|
|
57
|
+
|
|
42
58
|
/**
|
|
43
59
|
* Check if the player has finished loading
|
|
44
60
|
*
|
|
@@ -843,7 +859,6 @@ class PlayerControls {
|
|
|
843
859
|
return this.player.contentAudit || false;
|
|
844
860
|
}
|
|
845
861
|
|
|
846
|
-
|
|
847
862
|
GetOptions() {
|
|
848
863
|
let options = {
|
|
849
864
|
quality: this.GetQualityLevels(),
|
|
@@ -49,6 +49,8 @@
|
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
.autohide {
|
|
52
|
+
cursor: none;
|
|
53
|
+
|
|
52
54
|
&:not(:has(:focus-visible)) {
|
|
53
55
|
.info-container,
|
|
54
56
|
.bottom-controls-container--autohide {
|
|
@@ -370,7 +372,7 @@
|
|
|
370
372
|
|
|
371
373
|
.info-container {
|
|
372
374
|
gap: 20px;
|
|
373
|
-
padding-top:
|
|
375
|
+
padding-top: 15px;
|
|
374
376
|
}
|
|
375
377
|
|
|
376
378
|
.info-title {
|
|
@@ -414,6 +416,7 @@
|
|
|
414
416
|
|
|
415
417
|
.info-container {
|
|
416
418
|
padding-right: 80px;
|
|
419
|
+
padding-top: 10px;
|
|
417
420
|
}
|
|
418
421
|
|
|
419
422
|
.info-headers {
|
package/lib/ui/PlayerUI.jsx
CHANGED
|
@@ -45,6 +45,7 @@ const Poster = ({player}) => {
|
|
|
45
45
|
);
|
|
46
46
|
};
|
|
47
47
|
|
|
48
|
+
let clearInteractionTimeout;
|
|
48
49
|
const PlayerUI = ({target, parameters, InitCallback, ErrorCallback, Unmount, Reset}) => {
|
|
49
50
|
const [player, setPlayer] = useState(undefined);
|
|
50
51
|
const [client, setClient] = useState(undefined);
|
|
@@ -176,6 +177,15 @@ const PlayerUI = ({target, parameters, InitCallback, ErrorCallback, Unmount, Res
|
|
|
176
177
|
};
|
|
177
178
|
}, [playerSet]);
|
|
178
179
|
|
|
180
|
+
useEffect(() => {
|
|
181
|
+
if(!recentUserAction) { return; }
|
|
182
|
+
clearTimeout(clearInteractionTimeout);
|
|
183
|
+
|
|
184
|
+
setTimeout(() => {
|
|
185
|
+
setRecentUserAction(undefined);
|
|
186
|
+
}, 1000);
|
|
187
|
+
}, [recentUserAction]);
|
|
188
|
+
|
|
179
189
|
if(parameters.clientOptions.promptTicket && !client) {
|
|
180
190
|
return (
|
|
181
191
|
<TicketForm
|
package/lib/ui/TVControls.jsx
CHANGED
|
@@ -92,7 +92,7 @@ const CenterButtons = ({player, videoState}) => {
|
|
|
92
92
|
);
|
|
93
93
|
};
|
|
94
94
|
|
|
95
|
-
const MenuButton = ({label, icon, children, player,
|
|
95
|
+
const MenuButton = ({label, icon, children, player, MenuComponent}) => {
|
|
96
96
|
const [show, setShow] = useState(false);
|
|
97
97
|
|
|
98
98
|
return (
|
|
@@ -104,14 +104,14 @@ const MenuButton = ({label, icon, children, player, setMenuActive, MenuComponent
|
|
|
104
104
|
aria-haspopup
|
|
105
105
|
icon={icon}
|
|
106
106
|
onClick={() => {
|
|
107
|
-
|
|
107
|
+
player.controls.__ToggleMenu(!show);
|
|
108
108
|
setShow(!show);
|
|
109
109
|
}}
|
|
110
110
|
className={`${ControlStyles["icon-button--circle-focus"]} ${show ? ControlStyles["icon-button-active"] : ""}`}
|
|
111
111
|
/> :
|
|
112
112
|
<button
|
|
113
113
|
onClick={() => {
|
|
114
|
-
|
|
114
|
+
player.controls.__ToggleMenu(!show);
|
|
115
115
|
setShow(!show);
|
|
116
116
|
}}
|
|
117
117
|
className={`${ControlStyles["text-button"]} ${show ? ControlStyles["text-button--active"] : ""}`}
|
|
@@ -124,8 +124,8 @@ const MenuButton = ({label, icon, children, player, setMenuActive, MenuComponent
|
|
|
124
124
|
<MenuComponent
|
|
125
125
|
player={player}
|
|
126
126
|
Hide={() => {
|
|
127
|
+
player.controls.__ToggleMenu(false);
|
|
127
128
|
setShow(false);
|
|
128
|
-
setMenuActive(false);
|
|
129
129
|
}}
|
|
130
130
|
className={ControlStyles["menu"]}
|
|
131
131
|
/>
|
|
@@ -211,7 +211,7 @@ const InfoBox = ({player, Hide}) => {
|
|
|
211
211
|
);
|
|
212
212
|
};
|
|
213
213
|
|
|
214
|
-
const ContentVerificationControls = ({player
|
|
214
|
+
const ContentVerificationControls = ({player}) => {
|
|
215
215
|
const [contentVerified, setContentVerified] = useState(false);
|
|
216
216
|
|
|
217
217
|
useEffect(() => {
|
|
@@ -231,7 +231,6 @@ const ContentVerificationControls = ({player, setMenuActive}) => {
|
|
|
231
231
|
label="Content Verification Menu"
|
|
232
232
|
icon={Icons.ContentBadgeIcon}
|
|
233
233
|
player={player}
|
|
234
|
-
setMenuActive={setMenuActive}
|
|
235
234
|
MenuComponent={ContentVerificationMenu}
|
|
236
235
|
className={ControlStyles["content-verification-menu-button"]}
|
|
237
236
|
>
|
|
@@ -243,7 +242,6 @@ const ContentVerificationControls = ({player, setMenuActive}) => {
|
|
|
243
242
|
const TVControls = ({player, playbackStarted, canPlay, recentlyInteracted, setRecentUserAction, className=""}) => {
|
|
244
243
|
const [videoState, setVideoState] = useState(undefined);
|
|
245
244
|
const [playerClickHandler, setPlayerClickHandler] = useState(undefined);
|
|
246
|
-
const [menuActive, setMenuActive] = useState(false);
|
|
247
245
|
const [showInfo, setShowInfo] = useState(false);
|
|
248
246
|
|
|
249
247
|
useEffect(() => {
|
|
@@ -263,7 +261,7 @@ const TVControls = ({player, playbackStarted, canPlay, recentlyInteracted, setRe
|
|
|
263
261
|
const collectionInfo = player.controls.GetCollectionInfo();
|
|
264
262
|
|
|
265
263
|
// Title autohide is not dependent on controls settings
|
|
266
|
-
const showUI = recentlyInteracted || !playbackStarted ||
|
|
264
|
+
const showUI = recentlyInteracted || !playbackStarted || player.controls.IsMenuVisible();
|
|
267
265
|
const hideControls = !showUI && player.playerOptions.controls === EluvioPlayerParameters.controls.AUTO_HIDE;
|
|
268
266
|
|
|
269
267
|
player.__SetControlsVisibility(!hideControls);
|
|
@@ -277,7 +275,7 @@ const TVControls = ({player, playbackStarted, canPlay, recentlyInteracted, setRe
|
|
|
277
275
|
ControlStyles["container"],
|
|
278
276
|
showUI ? "" : ControlStyles["autohide"],
|
|
279
277
|
player.playerOptions.controls !== EluvioPlayerParameters.controls.DEFAULT ? "" : ControlStyles["container--default-controls"],
|
|
280
|
-
|
|
278
|
+
player.controls.IsMenuVisible() ? "menu-active" : ""
|
|
281
279
|
].join(" ")}
|
|
282
280
|
>
|
|
283
281
|
<IconButton
|
|
@@ -318,7 +316,6 @@ const TVControls = ({player, playbackStarted, canPlay, recentlyInteracted, setRe
|
|
|
318
316
|
label="Collection Menu"
|
|
319
317
|
icon={Icons.CollectionIcon}
|
|
320
318
|
player={player}
|
|
321
|
-
setMenuActive={setMenuActive}
|
|
322
319
|
MenuComponent={CollectionMenu}
|
|
323
320
|
/>
|
|
324
321
|
}
|
|
@@ -335,7 +332,7 @@ const TVControls = ({player, playbackStarted, canPlay, recentlyInteracted, setRe
|
|
|
335
332
|
</div>
|
|
336
333
|
<CenterButtons player={player} videoState={videoState}/>
|
|
337
334
|
<div className={ControlStyles["bottom-right-controls"]}>
|
|
338
|
-
<ContentVerificationControls player={player}
|
|
335
|
+
<ContentVerificationControls player={player} />
|
|
339
336
|
{
|
|
340
337
|
!player.controls.GetOptions().hasAnyOptions ? null :
|
|
341
338
|
<MenuButton
|
|
@@ -343,7 +340,6 @@ const TVControls = ({player, playbackStarted, canPlay, recentlyInteracted, setRe
|
|
|
343
340
|
label="Settings"
|
|
344
341
|
player={player}
|
|
345
342
|
MenuComponent={SettingsMenu}
|
|
346
|
-
setMenuActive={setMenuActive}
|
|
347
343
|
>
|
|
348
344
|
Settings
|
|
349
345
|
</MenuButton>
|
package/lib/ui/WebControls.jsx
CHANGED
|
@@ -76,7 +76,7 @@ const CollectionControls = ({player}) => {
|
|
|
76
76
|
);
|
|
77
77
|
};
|
|
78
78
|
|
|
79
|
-
const MenuButton = ({label, icon, player,
|
|
79
|
+
const MenuButton = ({label, icon, player, MenuComponent, className=""}) => {
|
|
80
80
|
const [show, setShow] = useState(false);
|
|
81
81
|
|
|
82
82
|
return (
|
|
@@ -86,7 +86,7 @@ const MenuButton = ({label, icon, player, setMenuActive, MenuComponent, classNam
|
|
|
86
86
|
aria-haspopup
|
|
87
87
|
icon={icon}
|
|
88
88
|
onClick={() => {
|
|
89
|
-
|
|
89
|
+
player.controls.__ToggleMenu(!show);
|
|
90
90
|
setShow(!show);
|
|
91
91
|
}}
|
|
92
92
|
className={show ? ControlStyles["icon-button-active"] : ""}
|
|
@@ -97,7 +97,7 @@ const MenuButton = ({label, icon, player, setMenuActive, MenuComponent, classNam
|
|
|
97
97
|
player={player}
|
|
98
98
|
Hide={() => {
|
|
99
99
|
setShow(false);
|
|
100
|
-
|
|
100
|
+
player.controls.__ToggleMenu(false);
|
|
101
101
|
}}
|
|
102
102
|
/>
|
|
103
103
|
}
|
|
@@ -154,7 +154,7 @@ const ContentInfo = ({player}) => {
|
|
|
154
154
|
);
|
|
155
155
|
};
|
|
156
156
|
|
|
157
|
-
const ContentVerificationControls = ({player
|
|
157
|
+
const ContentVerificationControls = ({player}) => {
|
|
158
158
|
const [contentVerified, setContentVerified] = useState(false);
|
|
159
159
|
|
|
160
160
|
useEffect(() => {
|
|
@@ -178,7 +178,6 @@ const ContentVerificationControls = ({player, setMenuActive}) => {
|
|
|
178
178
|
label="Content Verification Menu"
|
|
179
179
|
icon={Icons.ContentBadgeIcon}
|
|
180
180
|
player={player}
|
|
181
|
-
setMenuActive={setMenuActive}
|
|
182
181
|
MenuComponent={ContentVerificationMenu}
|
|
183
182
|
className={ControlStyles["content-verification-menu-button"]}
|
|
184
183
|
/>
|
|
@@ -189,7 +188,6 @@ const ContentVerificationControls = ({player, setMenuActive}) => {
|
|
|
189
188
|
const WebControls = ({player, playbackStarted, canPlay, recentlyInteracted, setRecentUserAction, className=""}) => {
|
|
190
189
|
const [videoState, setVideoState] = useState(undefined);
|
|
191
190
|
const [playerClickHandler, setPlayerClickHandler] = useState(undefined);
|
|
192
|
-
const [activeMenus, setActiveMenus] = useState(0);
|
|
193
191
|
|
|
194
192
|
useEffect(() => {
|
|
195
193
|
setPlayerClickHandler(PlayerClick({player, setRecentUserAction}));
|
|
@@ -202,11 +200,9 @@ const WebControls = ({player, playbackStarted, canPlay, recentlyInteracted, setR
|
|
|
202
200
|
if(!videoState) { return null; }
|
|
203
201
|
|
|
204
202
|
const collectionInfo = player.controls.GetCollectionInfo();
|
|
205
|
-
const menuActive = activeMenus > 0;
|
|
206
|
-
const setMenuActive = active => setActiveMenus(active ? activeMenus + 1 : Math.max(0, activeMenus - 1));
|
|
207
203
|
|
|
208
204
|
// Title autohide is not dependent on controls settings
|
|
209
|
-
const showUI = recentlyInteracted || !playbackStarted ||
|
|
205
|
+
const showUI = recentlyInteracted || !playbackStarted || player.controls.IsMenuVisible();
|
|
210
206
|
const hideControls = !showUI && player.playerOptions.controls === EluvioPlayerParameters.controls.AUTO_HIDE;
|
|
211
207
|
|
|
212
208
|
player.__SetControlsVisibility(!hideControls);
|
|
@@ -219,7 +215,7 @@ const WebControls = ({player, playbackStarted, canPlay, recentlyInteracted, setR
|
|
|
219
215
|
ControlStyles["container"],
|
|
220
216
|
showUI ? "" : ControlStyles["autohide"],
|
|
221
217
|
player.playerOptions.controls !== EluvioPlayerParameters.controls.DEFAULT ? "" : ControlStyles["container--default-controls"],
|
|
222
|
-
|
|
218
|
+
player.controls.IsMenuVisible() ? "menu-active" : ""
|
|
223
219
|
].join(" ")}
|
|
224
220
|
>
|
|
225
221
|
<ContentInfo key={`content-info-${collectionInfo && collectionInfo.mediaIndex}`} player={player} />
|
|
@@ -258,10 +254,7 @@ const WebControls = ({player, playbackStarted, canPlay, recentlyInteracted, setR
|
|
|
258
254
|
|
|
259
255
|
<div className={ControlStyles["spacer"]}/>
|
|
260
256
|
|
|
261
|
-
<ContentVerificationControls
|
|
262
|
-
player={player}
|
|
263
|
-
setMenuActive={setMenuActive}
|
|
264
|
-
/>
|
|
257
|
+
<ContentVerificationControls player={player} />
|
|
265
258
|
|
|
266
259
|
{
|
|
267
260
|
!collectionInfo ? null :
|
|
@@ -269,7 +262,6 @@ const WebControls = ({player, playbackStarted, canPlay, recentlyInteracted, setR
|
|
|
269
262
|
label="Collection Menu"
|
|
270
263
|
icon={Icons.CollectionIcon}
|
|
271
264
|
player={player}
|
|
272
|
-
setMenuActive={setMenuActive}
|
|
273
265
|
MenuComponent={CollectionMenu}
|
|
274
266
|
/>
|
|
275
267
|
}
|
|
@@ -288,7 +280,6 @@ const WebControls = ({player, playbackStarted, canPlay, recentlyInteracted, setR
|
|
|
288
280
|
label="Settings Menu"
|
|
289
281
|
icon={Icons.SettingsIcon}
|
|
290
282
|
player={player}
|
|
291
|
-
setMenuActive={setMenuActive}
|
|
292
283
|
MenuComponent={SettingsMenu}
|
|
293
284
|
/>
|
|
294
285
|
}
|