@structyl/video-player 1.0.0 → 1.0.2
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/LICENSE +1 -1
- package/README.md +1 -1
- package/dist/index.cjs +20 -12
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +20 -12
- package/dist/index.mjs.map +1 -1
- package/package.json +13 -2
package/dist/index.mjs
CHANGED
|
@@ -102,8 +102,8 @@ var VideoControls = ({
|
|
|
102
102
|
]
|
|
103
103
|
}
|
|
104
104
|
) }),
|
|
105
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
|
|
106
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-0.5
|
|
105
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", style: { flexWrap: "wrap", justifyContent: "space-between" }, children: [
|
|
106
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-0.5", style: { minWidth: 0, flexWrap: "wrap" }, children: [
|
|
107
107
|
hasPlaylist && /* @__PURE__ */ jsx(Button, { variant: "ghost", size: "icon", onClick: onPrevious, title: "Previous", className: "text-white/80 hover:text-white hover:bg-white/10", children: /* @__PURE__ */ jsx(ChevronLeft, {}) }),
|
|
108
108
|
/* @__PURE__ */ jsx(Button, { variant: "ghost", size: "icon", onClick: onPlayPause, title: isPlaying ? "Pause (Space)" : "Play (Space)", className: "text-white/80 hover:text-white hover:bg-white/10", children: isPlaying ? /* @__PURE__ */ jsx(Pause, {}) : /* @__PURE__ */ jsx(Play, {}) }),
|
|
109
109
|
hasPlaylist && /* @__PURE__ */ jsx(Button, { variant: "ghost", size: "icon", onClick: onNext, title: "Next", className: "text-white/80 hover:text-white hover:bg-white/10", children: /* @__PURE__ */ jsx(ChevronRight, {}) }),
|
|
@@ -150,7 +150,7 @@ var VideoControls = ({
|
|
|
150
150
|
side: "top",
|
|
151
151
|
align: "end",
|
|
152
152
|
sideOffset: 8,
|
|
153
|
-
className: "p-0 w-[
|
|
153
|
+
className: "p-0 w-[min(320px,calc(100vw-1rem))] max-h-[min(70dvh,420px)] overflow-y-auto bg-popover",
|
|
154
154
|
children: settingsPanel
|
|
155
155
|
}
|
|
156
156
|
)
|
|
@@ -263,7 +263,7 @@ var VideoSettings = ({
|
|
|
263
263
|
return /* @__PURE__ */ jsxs("div", { className: "flex flex-col w-full", children: [
|
|
264
264
|
/* @__PURE__ */ jsx("div", { className: "flex items-center px-3 py-2.5 border-b border-border shrink-0", children: /* @__PURE__ */ jsx("span", { className: "text-[13px] font-semibold text-fg", children: "Settings" }) }),
|
|
265
265
|
/* @__PURE__ */ jsxs(Tabs.Root, { defaultValue: "subtitles", className: "flex flex-col flex-1 overflow-hidden", children: [
|
|
266
|
-
/* @__PURE__ */ jsxs(Tabs.List, { className: "px-3 py-2 flex-shrink-0", children: [
|
|
266
|
+
/* @__PURE__ */ jsxs(Tabs.List, { scrollable: true, className: "px-3 py-2 flex-shrink-0", children: [
|
|
267
267
|
/* @__PURE__ */ jsx(Tabs.Trigger, { value: "subtitles", children: "Subtitles" }),
|
|
268
268
|
/* @__PURE__ */ jsx(Tabs.Trigger, { value: "filters", children: "Filters" }),
|
|
269
269
|
/* @__PURE__ */ jsx(Tabs.Trigger, { value: "quality", children: "Quality" }),
|
|
@@ -1231,22 +1231,30 @@ var VideoPlayer = ({
|
|
|
1231
1231
|
}, [togglePlay, skipForward, skipBackward, volume, handleVolumeChange, toggleMute, toggleFullscreen, togglePiP, duration]);
|
|
1232
1232
|
const youtubeId = extractYouTubeId(currentSrc);
|
|
1233
1233
|
if (youtubeId) {
|
|
1234
|
-
return /* @__PURE__ */ jsx(
|
|
1235
|
-
"
|
|
1234
|
+
return /* @__PURE__ */ jsx(
|
|
1235
|
+
"div",
|
|
1236
1236
|
{
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1237
|
+
className: `relative w-full overflow-hidden rounded-lg shadow-lg ${className}`,
|
|
1238
|
+
style: { aspectRatio: "16 / 9", backgroundColor: "#000" },
|
|
1239
|
+
children: /* @__PURE__ */ jsx(
|
|
1240
|
+
"iframe",
|
|
1241
|
+
{
|
|
1242
|
+
src: `https://www.youtube.com/embed/${youtubeId}?autoplay=${autoPlay ? 1 : 0}&mute=${muted ? 1 : 0}&loop=${loop ? 1 : 0}&rel=0`,
|
|
1243
|
+
allow: "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share",
|
|
1244
|
+
allowFullScreen: true,
|
|
1245
|
+
className: "absolute inset-0 w-full h-full border-0",
|
|
1246
|
+
title: "YouTube video player"
|
|
1247
|
+
}
|
|
1248
|
+
)
|
|
1242
1249
|
}
|
|
1243
|
-
)
|
|
1250
|
+
);
|
|
1244
1251
|
}
|
|
1245
1252
|
return /* @__PURE__ */ jsxs(
|
|
1246
1253
|
"div",
|
|
1247
1254
|
{
|
|
1248
1255
|
ref: containerRef,
|
|
1249
1256
|
className: `relative w-full aspect-video bg-bg overflow-hidden rounded-lg shadow-lg font-sans text-sm text-fg select-none ${className}`,
|
|
1257
|
+
style: { aspectRatio: "16 / 9" },
|
|
1250
1258
|
children: [
|
|
1251
1259
|
/* @__PURE__ */ jsx(
|
|
1252
1260
|
"video",
|