@eluvio/elv-player-js 2.0.7 → 2.0.9

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.
@@ -65,10 +65,10 @@
65
65
  align-items: center;
66
66
  color: var(--color-button);
67
67
  display: flex;
68
- height: 100%;
69
- padding: 5px;
68
+ height: 30px;
69
+ padding: 4px;
70
70
  transition: color 0.15s ease;
71
- width: auto;
71
+ width: 30px;
72
72
 
73
73
  svg {
74
74
  height: 100%;
@@ -167,6 +167,7 @@
167
167
 
168
168
  .center-play-button {
169
169
  height: 100px;
170
+ margin-bottom: 30px;
170
171
  transition: opacity 0.5s ease;
171
172
  width: 100px;
172
173
  z-index: var(--layer-center-button);
@@ -226,11 +227,6 @@
226
227
  .play-pause-button {
227
228
  padding: 0;
228
229
  }
229
-
230
- .right-control-button {
231
- height: 35px;
232
- margin-bottom: 1px;
233
- }
234
230
  }
235
231
 
236
232
  .time {
@@ -338,18 +334,12 @@
338
334
 
339
335
  .icon-button {
340
336
  border: 1px solid transparent;
341
- border-radius: 100%;
337
+ padding: 0;
342
338
  transition: background-color 0.25s ease, color 0.25s ease;
343
339
 
344
340
  &-active,
345
341
  &:focus-visible {
346
- background-color: rgba(255, 255, 255, 85%);
347
- color: #000;
348
- filter: drop-shadow(0 0 5px #FFF);
349
- }
350
-
351
- &:focus-visible {
352
- border: 1px solid var(--color-highlight);
342
+ filter: drop-shadow(0 0 3px rgba(255, 255, 255, 50%));
353
343
  }
354
344
  }
355
345
  }
@@ -393,14 +383,22 @@
393
383
  --content-image-size: 65px;
394
384
  }
395
385
 
386
+ .icon-button {
387
+ height: 25px;
388
+ min-width: 25px;
389
+ width: 25px;
390
+ }
391
+
396
392
  .controls {
397
393
  gap: 8px;
398
- height: 45px;
394
+ height: max-content;
395
+ padding: 0 5px 5px;
399
396
  }
400
397
 
401
398
  .center-play-button {
402
- height: 65px;
403
- width: 65px;
399
+ height: 50px;
400
+ margin-bottom: 15px;
401
+ width: 50px;
404
402
  }
405
403
 
406
404
  /* Position menus relative to whole player */
@@ -433,6 +431,7 @@
433
431
 
434
432
  .time {
435
433
  font-size: 10px;
434
+ min-width: max-content;
436
435
  }
437
436
 
438
437
  .collection-button-text {
@@ -89,4 +89,10 @@
89
89
  .error-message {
90
90
  font-size: 16px;
91
91
  }
92
+
93
+ .spinner {
94
+ border-width: 3px;
95
+ height: 30px;
96
+ width: 30px;
97
+ }
92
98
  }
@@ -380,7 +380,7 @@ export const ContentVerificationMenu = ({player, Hide, className=""}) => {
380
380
  content = (
381
381
  <>
382
382
  <div className={CommonStyles["verification-menu__group"]}>
383
- <div dangerouslySetInnerHTML={{__html: Icons.ContentBadgeIcon}} style={{width: 35, height: 35}} className={CommonStyles["verification-menu__group-icon"]} />
383
+ <div dangerouslySetInnerHTML={{__html: Icons.ContentBadgeIcon}} className={CommonStyles["verification-menu__group-icon"]} />
384
384
  <div className={CommonStyles["verification-menu__group-text"]}>
385
385
  <div className={CommonStyles["verification-menu__group-title"]}>
386
386
  This content has been verified as authentic
@@ -391,7 +391,7 @@ export const ContentVerificationMenu = ({player, Hide, className=""}) => {
391
391
  </div>
392
392
  </div>
393
393
  <div className={CommonStyles["verification-menu__group"]}>
394
- <div dangerouslySetInnerHTML={{__html: Icons.ContentCredentialsIcon}} style={{height: 30, maxWidth: 30}} className={CommonStyles["verification-menu__group-icon"]} />
394
+ <div dangerouslySetInnerHTML={{__html: Icons.ContentCredentialsIcon}} className={[CommonStyles["verification-menu__group-icon"], CommonStyles["verification-menu__group-icon--cc"]].join(" ")} />
395
395
  <div className={CommonStyles["verification-menu__group-text"]}>
396
396
  <button onClick={() => setShowDetails(true)} className={CommonStyles["verification-menu__group-title"]}>
397
397
  View Content Credentials
@@ -405,7 +405,7 @@ export const ContentVerificationMenu = ({player, Hide, className=""}) => {
405
405
  content = (
406
406
  <>
407
407
  <div className={CommonStyles["verification-menu__group"]}>
408
- <div dangerouslySetInnerHTML={{__html: Icons.ContentBadgeIcon}} style={{width: 50, height: 50}} className={CommonStyles["verification-menu__group-icon"]} />
408
+ <div dangerouslySetInnerHTML={{__html: Icons.ContentBadgeIcon}} className={CommonStyles["verification-menu__group-icon"]} />
409
409
  <div className={CommonStyles["verification-menu__group-text"]}>
410
410
  <div className={CommonStyles["verification-menu__group-title"]}>
411
411
  This content has been verified as authentic
@@ -416,7 +416,7 @@ export const ContentVerificationMenu = ({player, Hide, className=""}) => {
416
416
  </div>
417
417
  </div>
418
418
  <div className={CommonStyles["verification-menu__group"]}>
419
- <div dangerouslySetInnerHTML={{__html: Icons.ContentCredentialsIcon}} className={CommonStyles["verification-menu__group-icon"]} />
419
+ <div dangerouslySetInnerHTML={{__html: Icons.ContentCredentialsIcon}} className={[CommonStyles["verification-menu__group-icon"], CommonStyles["verification-menu__group-icon--cc"]].join(" ")} />
420
420
  <div className={CommonStyles["verification-menu__group-text"]}>
421
421
  <button onClick={() => setShowDetails(true)} className={CommonStyles["verification-menu__group-title"]}>
422
422
  Content Credentials
@@ -126,19 +126,20 @@ export const ObserveVideoTime = ({video, rate=10, setCurrentTime}) => {
126
126
 
127
127
  export const ObserveResize = ({target, setSize, setOrientation, setDimensions}) => {
128
128
  let dimensionsUpdateTimeout;
129
- const observer = new ResizeObserver(entries => {
129
+
130
+ const ResizeUpdate = () => {
130
131
  clearTimeout(dimensionsUpdateTimeout);
131
132
 
132
- const dimensions = entries[0].contentRect;
133
+ const dimensions = target.getBoundingClientRect();
133
134
 
134
135
  let size = "sm";
135
136
  let orientation = "landscape";
136
137
  // Use actual player size instead of media queries
137
- if(dimensions.width > 1400) {
138
+ if(dimensions.width > 1400 && dimensions.height > 600) {
138
139
  size = "xl";
139
- } else if(dimensions.width > 1000) {
140
+ } else if(dimensions.width > 1000 && dimensions.height > 400) {
140
141
  size = "lg";
141
- } else if(dimensions.width > 650) {
142
+ } else if(dimensions.width > 650 && dimensions.height > 300) {
142
143
  size = "md";
143
144
  }
144
145
 
@@ -152,8 +153,11 @@ export const ObserveResize = ({target, setSize, setOrientation, setDimensions})
152
153
  dimensionsUpdateTimeout = setTimeout(() => {
153
154
  setDimensions({width: dimensions.width, height: dimensions.height});
154
155
  }, 500);
155
- });
156
+ };
157
+
158
+ ResizeUpdate();
156
159
 
160
+ const observer = new ResizeObserver(ResizeUpdate);
157
161
  observer.observe(target);
158
162
 
159
163
  return () => observer.disconnect();
@@ -162,7 +162,9 @@ const ContentVerificationControls = ({player}) => {
162
162
 
163
163
  UpdateVerification();
164
164
 
165
- player.controls.RegisterSettingsListener(UpdateVerification);
165
+ const disposeSettingsListener = player.controls.RegisterSettingsListener(UpdateVerification);
166
+
167
+ return () => disposeSettingsListener && disposeSettingsListener();
166
168
  }, []);
167
169
 
168
170
  if(!contentVerified) {
@@ -188,13 +190,20 @@ const ContentVerificationControls = ({player}) => {
188
190
  const WebControls = ({player, playbackStarted, canPlay, recentlyInteracted, setRecentUserAction, className=""}) => {
189
191
  const [videoState, setVideoState] = useState(undefined);
190
192
  const [playerClickHandler, setPlayerClickHandler] = useState(undefined);
193
+ const [menuVisible, setMenuVisible] = useState(player.controls.IsMenuVisible());
191
194
 
192
195
  useEffect(() => {
193
196
  setPlayerClickHandler(PlayerClick({player, setRecentUserAction}));
194
197
 
198
+ const UpdateMenuVisibility = () => setMenuVisible(player.controls.IsMenuVisible());
199
+ const disposeSettingsListener = player.controls.RegisterSettingsListener(UpdateMenuVisibility);
200
+
195
201
  const disposeVideoObserver = ObserveVideo({target: player.target, video: player.video, setVideoState});
196
202
 
197
- return () => disposeVideoObserver && disposeVideoObserver();
203
+ return () => {
204
+ disposeSettingsListener && disposeSettingsListener();
205
+ disposeVideoObserver && disposeVideoObserver();
206
+ }
198
207
  }, []);
199
208
 
200
209
  if(!videoState) { return null; }
@@ -202,7 +211,7 @@ const WebControls = ({player, playbackStarted, canPlay, recentlyInteracted, setR
202
211
  const collectionInfo = player.controls.GetCollectionInfo();
203
212
 
204
213
  // Title autohide is not dependent on controls settings
205
- const showUI = recentlyInteracted || !playbackStarted || player.controls.IsMenuVisible();
214
+ const showUI = recentlyInteracted || !playbackStarted || menuVisible;
206
215
  const hideControls = !showUI && player.playerOptions.controls === EluvioPlayerParameters.controls.AUTO_HIDE;
207
216
 
208
217
  player.__SetControlsVisibility(!hideControls);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eluvio/elv-player-js",
3
- "version": "2.0.7",
3
+ "version": "2.0.9",
4
4
  "description": "![Eluvio Logo](lib/static/images/Logo.png \"Eluvio Logo\")",
5
5
  "main": "lib/index.js",
6
6
  "license": "MIT",
@@ -36,10 +36,10 @@
36
36
  "package-lock.json"
37
37
  ],
38
38
  "dependencies": {
39
- "@eluvio/elv-client-js": "^4.0.88",
39
+ "@eluvio/elv-client-js": "^4.0.89",
40
40
  "dashjs": "~4.7.0",
41
41
  "focus-visible": "^5.2.0",
42
- "hls.js": "~1.4.12",
42
+ "hls.js": "~1.5.12",
43
43
  "mux-embed": "^4.30.0",
44
44
  "react": "^18.2.0",
45
45
  "react-dom": "^18.2.0",
@@ -56,6 +56,7 @@
56
56
  "eslint-plugin-react-hooks": "^4.6.0",
57
57
  "eslint-plugin-react-refresh": "^0.4.5",
58
58
  "jsdoc": "^4.0.0",
59
+ "sass": "^1.77.6",
59
60
  "stylelint": "^16.2.0",
60
61
  "stylelint-config-standard": "^36.0.0",
61
62
  "stylelint-order": "^6.0.4",