@nikelroot/video-player 0.1.7 → 0.1.8
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/index.cjs +14 -1
- package/dist/index.js +14 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -548,6 +548,19 @@ var VideoPlayerControls = (props) => {
|
|
|
548
548
|
} = props;
|
|
549
549
|
const [, isMobile] = useWindowWidth();
|
|
550
550
|
if (variant === "none") return null;
|
|
551
|
+
if (variant === "tiny") {
|
|
552
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(VideoPlayerControlStyles, { $tiny: true, $isMobile: isMobile, onClick: stopControlClick, $showControl: showControl, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "video-player-control-row", children: [
|
|
553
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "full" }),
|
|
554
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(SeekSlider, { playAction, duration, currentTime, seekSetTime })
|
|
555
|
+
] }) });
|
|
556
|
+
}
|
|
557
|
+
if (variant === "fullscreen-only") {
|
|
558
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(VideoPlayerControlStyles, { $isMobile: isMobile, onClick: stopControlClick, $showControl: showControl, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "video-player-control-row", children: [
|
|
559
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "full" }),
|
|
560
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(ControlButton, { icon: muted ? "mute" : "sound", label: muted ? "Unmute" : "Mute", onClick: () => onMutedChange(!muted) }),
|
|
561
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(ControlButton, { disabled: !fullscreenAllowed, icon: "fullscreen", label: "Fullscreen", onClick: fullScreenAction })
|
|
562
|
+
] }) });
|
|
563
|
+
}
|
|
551
564
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(VideoPlayerControlStyles, { $isMobile: isMobile, onClick: stopControlClick, $showControl: showControl, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "video-player-control-row", children: [
|
|
552
565
|
playing ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ControlButton, { icon: "pause", label: "Pause", onClick: pauseAction }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ControlButton, { icon: "play", label: "Play", onClick: playAction }),
|
|
553
566
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(ControlButton, { icon: "back", label: "Back 15 seconds", onClick: () => seekPrevAction() }),
|
|
@@ -1430,7 +1443,7 @@ var VideoPlayerBase = (props, ref) => {
|
|
|
1430
1443
|
{
|
|
1431
1444
|
ref: containerRef,
|
|
1432
1445
|
onMouseMove: mouseMoveHandler,
|
|
1433
|
-
className: "VideoPlayer",
|
|
1446
|
+
className: isFullscreen ? "VideoPlayer VideoPlayer--fullscreen" : "VideoPlayer",
|
|
1434
1447
|
type,
|
|
1435
1448
|
$isMobile: isMobile,
|
|
1436
1449
|
$mobileType: mobileType,
|
package/dist/index.js
CHANGED
|
@@ -519,6 +519,19 @@ var VideoPlayerControls = (props) => {
|
|
|
519
519
|
} = props;
|
|
520
520
|
const [, isMobile] = useWindowWidth();
|
|
521
521
|
if (variant === "none") return null;
|
|
522
|
+
if (variant === "tiny") {
|
|
523
|
+
return /* @__PURE__ */ jsx(VideoPlayerControlStyles, { $tiny: true, $isMobile: isMobile, onClick: stopControlClick, $showControl: showControl, children: /* @__PURE__ */ jsxs("div", { className: "video-player-control-row", children: [
|
|
524
|
+
/* @__PURE__ */ jsx("div", { className: "full" }),
|
|
525
|
+
/* @__PURE__ */ jsx(SeekSlider, { playAction, duration, currentTime, seekSetTime })
|
|
526
|
+
] }) });
|
|
527
|
+
}
|
|
528
|
+
if (variant === "fullscreen-only") {
|
|
529
|
+
return /* @__PURE__ */ jsx(VideoPlayerControlStyles, { $isMobile: isMobile, onClick: stopControlClick, $showControl: showControl, children: /* @__PURE__ */ jsxs("div", { className: "video-player-control-row", children: [
|
|
530
|
+
/* @__PURE__ */ jsx("div", { className: "full" }),
|
|
531
|
+
/* @__PURE__ */ jsx(ControlButton, { icon: muted ? "mute" : "sound", label: muted ? "Unmute" : "Mute", onClick: () => onMutedChange(!muted) }),
|
|
532
|
+
/* @__PURE__ */ jsx(ControlButton, { disabled: !fullscreenAllowed, icon: "fullscreen", label: "Fullscreen", onClick: fullScreenAction })
|
|
533
|
+
] }) });
|
|
534
|
+
}
|
|
522
535
|
return /* @__PURE__ */ jsx(VideoPlayerControlStyles, { $isMobile: isMobile, onClick: stopControlClick, $showControl: showControl, children: /* @__PURE__ */ jsxs("div", { className: "video-player-control-row", children: [
|
|
523
536
|
playing ? /* @__PURE__ */ jsx(ControlButton, { icon: "pause", label: "Pause", onClick: pauseAction }) : /* @__PURE__ */ jsx(ControlButton, { icon: "play", label: "Play", onClick: playAction }),
|
|
524
537
|
/* @__PURE__ */ jsx(ControlButton, { icon: "back", label: "Back 15 seconds", onClick: () => seekPrevAction() }),
|
|
@@ -1401,7 +1414,7 @@ var VideoPlayerBase = (props, ref) => {
|
|
|
1401
1414
|
{
|
|
1402
1415
|
ref: containerRef,
|
|
1403
1416
|
onMouseMove: mouseMoveHandler,
|
|
1404
|
-
className: "VideoPlayer",
|
|
1417
|
+
className: isFullscreen ? "VideoPlayer VideoPlayer--fullscreen" : "VideoPlayer",
|
|
1405
1418
|
type,
|
|
1406
1419
|
$isMobile: isMobile,
|
|
1407
1420
|
$mobileType: mobileType,
|