@eluvio/elv-player-js 2.0.4 → 2.0.6

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.
@@ -324,6 +324,8 @@ export const CopyButton = ({label, value, className=""}) => {
324
324
  };
325
325
 
326
326
  const ContentDetail = ({label, value, copyable}) => {
327
+ if(!value) { return null; }
328
+
327
329
  return (
328
330
  <div className={CommonStyles["verification-menu__detail"]}>
329
331
  <label className={CommonStyles["verification-menu__detail-label"]}>{label}:</label>
@@ -344,9 +346,13 @@ export const ContentVerificationMenu = ({player, Hide, className=""}) => {
344
346
  const menuRef = createRef();
345
347
  const [audit, setAudit] = useState();
346
348
  const [showDetails, setShowDetails] = useState(false);
349
+ const [_, setLoaded] = useState(false);
347
350
 
348
351
  useEffect(() => {
349
- const UpdateSettings = () => setAudit(player.controls.ContentVerificationDetails());
352
+ player.__LoadVerificationDetails()
353
+ .then(() => setLoaded(true));
354
+
355
+ const UpdateSettings = () => setAudit(player.controls.GetContentVerificationDetails());
350
356
 
351
357
  UpdateSettings();
352
358
 
@@ -374,7 +380,7 @@ export const ContentVerificationMenu = ({player, Hide, className=""}) => {
374
380
  content = (
375
381
  <>
376
382
  <div className={CommonStyles["verification-menu__group"]}>
377
- <div dangerouslySetInnerHTML={{__html: Icons.ContentShieldIcon}} className={CommonStyles["verification-menu__group-icon"]} />
383
+ <div dangerouslySetInnerHTML={{__html: Icons.ContentBadgeIcon}} style={{width: 35, height: 35}} className={CommonStyles["verification-menu__group-icon"]} />
378
384
  <div className={CommonStyles["verification-menu__group-text"]}>
379
385
  <div className={CommonStyles["verification-menu__group-title"]}>
380
386
  This content has been verified as authentic
@@ -385,7 +391,7 @@ export const ContentVerificationMenu = ({player, Hide, className=""}) => {
385
391
  </div>
386
392
  </div>
387
393
  <div className={CommonStyles["verification-menu__group"]}>
388
- <div dangerouslySetInnerHTML={{__html: Icons.ContentCredentialsIcon}} className={CommonStyles["verification-menu__group-icon"]} />
394
+ <div dangerouslySetInnerHTML={{__html: Icons.ContentCredentialsIcon}} style={{height: 30, maxWidth: 30}} className={CommonStyles["verification-menu__group-icon"]} />
389
395
  <div className={CommonStyles["verification-menu__group-text"]}>
390
396
  <button onClick={() => setShowDetails(true)} className={CommonStyles["verification-menu__group-title"]}>
391
397
  View Content Credentials
@@ -399,7 +405,7 @@ export const ContentVerificationMenu = ({player, Hide, className=""}) => {
399
405
  content = (
400
406
  <>
401
407
  <div className={CommonStyles["verification-menu__group"]}>
402
- <div dangerouslySetInnerHTML={{__html: Icons.ContentShieldIcon}} className={CommonStyles["verification-menu__group-icon"]} />
408
+ <div dangerouslySetInnerHTML={{__html: Icons.ContentBadgeIcon}} style={{width: 50, height: 50}} className={CommonStyles["verification-menu__group-icon"]} />
403
409
  <div className={CommonStyles["verification-menu__group-text"]}>
404
410
  <div className={CommonStyles["verification-menu__group-title"]}>
405
411
  This content has been verified as authentic
@@ -423,27 +429,46 @@ export const ContentVerificationMenu = ({player, Hide, className=""}) => {
423
429
  </div>
424
430
  </div>
425
431
  </div>
426
- <div className={CommonStyles["verification-menu__details"]}>
432
+ <div className={CommonStyles["verification-menu__details"]} key={`details-${audit.details._state}`}>
427
433
  <ContentDetail label="Content Fabric Object ID" value={audit.details.objectId} copyable />
428
434
  <ContentDetail label="Organization Address" value={audit.details.tenantAddress} copyable />
429
- {
430
- !audit.details.tenantName ? null :
431
- <ContentDetail label="Organization Name" value={audit.details.tenantName} />
432
- }
435
+ <ContentDetail label="Organization Name" value={audit.details.tenantName && audit.details.tenantName.toString()} />
433
436
  <ContentDetail label="Owner Address" value={audit.details.ownerAddress} copyable />
434
- <ContentDetail label="Content Object Contract Address" value={audit.details.address} copyable />
437
+ <ContentDetail
438
+ label="Content Object Contract Address"
439
+ value={
440
+ audit.details.explorerUrl ?
441
+ <a href={audit.details.explorerUrl} target="_blank" rel="noreferrer">
442
+ {audit.details.address}
443
+ </a> :
444
+ audit.details.address
445
+ }
446
+ copyable
447
+ />
448
+ <ContentDetail label="Versions" value={audit.details.versionCount} />
435
449
  <ContentDetail label="Content Version Hash" value={audit.details.versionHash} copyable />
436
450
  {
437
451
  !audit.details.lastCommittedAt ? null :
438
- <ContentDetail label="Last Commit" value={new Date(audit.details.lastCommittedAt).toLocaleTimeString(navigator.language || "en-us", {year: "numeric", "month": "long", day: "numeric"})} />
452
+ <ContentDetail label="Latest Commit" value={new Date(audit.details.lastCommittedAt).toLocaleTimeString(navigator.language || "en-us", {year: "numeric", "month": "long", day: "numeric"})} />
439
453
  }
454
+ <ContentDetail label="Latest Version Hash" value={audit.details.latestVersionHash} copyable />
455
+ <ContentDetail
456
+ label="Latest Transaction"
457
+ value={
458
+ audit.details._state !== "full" ?
459
+ <Spinner className={CommonStyles["verification-menu__loader"]} /> :
460
+ audit.details.latestTransactionHashUrl ?
461
+ <a href={audit.details.latestTransactionHashUrl} target="_blank" rel="noreferrer">
462
+ { audit.details.latestTransactionHash && audit.details.latestTransactionHash.toString() }
463
+ </a> : undefined
464
+ }
465
+ />
440
466
  <ContentDetail label="Signature Algorithm" value={audit.details.signatureMethod} />
441
467
  </div>
442
468
  </>
443
469
  );
444
470
  }
445
471
 
446
-
447
472
  return (
448
473
  <div ref={menuRef}>
449
474
  <div key="menu" role="menu" className={`${CommonStyles["menu"]} ${CommonStyles["verification-menu"]} ${showDetails ? CommonStyles["verification-menu--details"] : ""} ${className}`}>
@@ -199,8 +199,8 @@ const PlayerUI = ({target, parameters, InitCallback, ErrorCallback, Unmount, Res
199
199
  tabIndex={0}
200
200
  style={{
201
201
  backgroundColor: parameters.playerOptions.backgroundColor || "transparent",
202
- "--portal-width": `${dimensions.width}px`,
203
- "--portal-height": `${dimensions.height}px`
202
+ "--portal-width": `${shouldRotate ? dimensions.height : dimensions.width}px`,
203
+ "--portal-height": `${shouldRotate ? dimensions.width : dimensions.height}px`
204
204
  }}
205
205
  className={[PlayerStyles["player-container"], shouldRotate ? PlayerStyles["player-container--rotated"] : "", `__eluvio-player--size-${size}`, `__eluvio-player--orientation-${orientation}`].join(" ")}
206
206
  >
@@ -229,7 +229,7 @@ const ContentVerificationControls = ({player, setMenuActive}) => {
229
229
  return (
230
230
  <MenuButton
231
231
  label="Content Verification Menu"
232
- icon={Icons.ContentShieldIcon}
232
+ icon={Icons.ContentBadgeIcon}
233
233
  player={player}
234
234
  setMenuActive={setMenuActive}
235
235
  MenuComponent={ContentVerificationMenu}
@@ -11,9 +11,9 @@ import EluvioPlayerParameters from "../player/PlayerParameters.js";
11
11
  import EluvioLogo from "../static/images/Logo.png";
12
12
  import {CollectionMenu, ContentVerificationMenu, SeekBar, SettingsMenu, VolumeControls} from "./Components.jsx";
13
13
 
14
- export const IconButton = ({icon, ...props}) => {
14
+ export const IconButton = ({icon, className="", ...props}) => {
15
15
  return (
16
- <button {...props} className={`${ControlStyles["icon-button"]} ${props.className || ""}`} dangerouslySetInnerHTML={{__html: icon}} />
16
+ <button {...props} className={`${ControlStyles["icon-button"]} ${className}`} dangerouslySetInnerHTML={{__html: icon}} />
17
17
  );
18
18
  };
19
19
 
@@ -176,7 +176,7 @@ const ContentVerificationControls = ({player, setMenuActive}) => {
176
176
  </div>
177
177
  <MenuButton
178
178
  label="Content Verification Menu"
179
- icon={Icons.ContentShieldIcon}
179
+ icon={Icons.ContentBadgeIcon}
180
180
  player={player}
181
181
  setMenuActive={setMenuActive}
182
182
  MenuComponent={ContentVerificationMenu}
@@ -279,6 +279,7 @@ const WebControls = ({player, playbackStarted, canPlay, recentlyInteracted, setR
279
279
  aria-label="Rotate Video"
280
280
  icon={Icons.RotateIcon}
281
281
  onClick={() => player.controls.SetAllowRotation(!player.controls.AllowRotation())}
282
+ className={ControlStyles["right-control-button"]}
282
283
  />
283
284
  }
284
285
  {
@@ -295,6 +296,7 @@ const WebControls = ({player, playbackStarted, canPlay, recentlyInteracted, setR
295
296
  aria-label={videoState.fullscreen ? "Exit Fullscreen" : "Fullscreen"}
296
297
  icon={videoState.fullscreen ? Icons.ExitFullscreenIcon : Icons.FullscreenIcon}
297
298
  onClick={() => player.controls.ToggleFullscreen()}
299
+ className={ControlStyles["right-control-button"]}
298
300
  />
299
301
  </div>
300
302
  </div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eluvio/elv-player-js",
3
- "version": "2.0.4",
3
+ "version": "2.0.6",
4
4
  "description": "![Eluvio Logo](lib/static/images/Logo.png \"Eluvio Logo\")",
5
5
  "main": "lib/index.js",
6
6
  "license": "MIT",
@@ -36,7 +36,7 @@
36
36
  "package-lock.json"
37
37
  ],
38
38
  "dependencies": {
39
- "@eluvio/elv-client-js": "^4.0.87",
39
+ "@eluvio/elv-client-js": "^4.0.88",
40
40
  "dashjs": "~4.7.0",
41
41
  "focus-visible": "^5.2.0",
42
42
  "hls.js": "~1.4.12",