@boyernick/standard-ui-react 0.4.2-canary.70 → 0.4.2-canary.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/package.json +1 -1
- package/src/video-player.tsx +20 -6
package/package.json
CHANGED
package/src/video-player.tsx
CHANGED
|
@@ -54,6 +54,16 @@ export type VideoPlayerProps = ComponentProps<"div"> & {
|
|
|
54
54
|
* to fix it, or `null` never to ask.
|
|
55
55
|
*/
|
|
56
56
|
crossOrigin?: "anonymous" | "use-credentials" | null
|
|
57
|
+
/**
|
|
58
|
+
* Show the mute control. Off for footage with no sound, such as screen
|
|
59
|
+
* recordings; the timeline takes its place. Default true.
|
|
60
|
+
*/
|
|
61
|
+
muteButton?: boolean
|
|
62
|
+
/**
|
|
63
|
+
* Show the picture-in-picture control where the browser supports it. The
|
|
64
|
+
* timeline takes its place when off. Default true.
|
|
65
|
+
*/
|
|
66
|
+
pictureInPictureButton?: boolean
|
|
57
67
|
}
|
|
58
68
|
|
|
59
69
|
export const VideoPlayer = ({
|
|
@@ -63,6 +73,8 @@ export const VideoPlayer = ({
|
|
|
63
73
|
className,
|
|
64
74
|
"aria-label": ariaLabel,
|
|
65
75
|
crossOrigin,
|
|
76
|
+
muteButton = true,
|
|
77
|
+
pictureInPictureButton = true,
|
|
66
78
|
...props
|
|
67
79
|
}: VideoPlayerProps) => {
|
|
68
80
|
const playerRef = useRef<HTMLDivElement>(null)
|
|
@@ -387,7 +399,7 @@ export const VideoPlayer = ({
|
|
|
387
399
|
<IconPlay size={14} mode="raw" className="size-3.5" aria-hidden />
|
|
388
400
|
)}
|
|
389
401
|
</GlassButton>
|
|
390
|
-
<GlassButton
|
|
402
|
+
{muteButton ? <GlassButton
|
|
391
403
|
type="button"
|
|
392
404
|
rounded
|
|
393
405
|
iconOnly
|
|
@@ -411,13 +423,15 @@ export const VideoPlayer = ({
|
|
|
411
423
|
aria-hidden
|
|
412
424
|
/>
|
|
413
425
|
)}
|
|
414
|
-
</GlassButton>
|
|
426
|
+
</GlassButton> : null}
|
|
415
427
|
<Glass
|
|
416
428
|
data-glass-radius="css"
|
|
417
429
|
className={cn(
|
|
418
430
|
controlVisibility,
|
|
419
|
-
"
|
|
420
|
-
|
|
431
|
+
"flex h-9 min-w-0 items-center gap-2 rounded-full px-3",
|
|
432
|
+
// The timeline spans whatever the side controls leave free.
|
|
433
|
+
muteButton ? "left-24 group-data-[fullscreen]:left-27" : "left-13 group-data-[fullscreen]:left-16",
|
|
434
|
+
pictureInPictureButton && pipSupported ? "right-24 group-data-[fullscreen]:right-27" : "right-13 group-data-[fullscreen]:right-16",
|
|
421
435
|
(failed || loading) && "invisible",
|
|
422
436
|
)}
|
|
423
437
|
>
|
|
@@ -495,7 +509,7 @@ export const VideoPlayer = ({
|
|
|
495
509
|
</Glass>
|
|
496
510
|
|
|
497
511
|
|
|
498
|
-
<GlassButton
|
|
512
|
+
{pictureInPictureButton ? <GlassButton
|
|
499
513
|
type="button"
|
|
500
514
|
rounded
|
|
501
515
|
iconOnly
|
|
@@ -515,7 +529,7 @@ export const VideoPlayer = ({
|
|
|
515
529
|
className="size-3.5"
|
|
516
530
|
aria-hidden
|
|
517
531
|
/>
|
|
518
|
-
</GlassButton>
|
|
532
|
+
</GlassButton> : null}
|
|
519
533
|
<GlassButton
|
|
520
534
|
type="button"
|
|
521
535
|
rounded
|