@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/LICENSE
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
MIT License
|
|
2
2
|
|
|
3
|
-
Copyright (c) 2026
|
|
3
|
+
Copyright (c) 2026 Mohammed Irfanul Alam Tanveer
|
|
4
4
|
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
package/README.md
CHANGED
|
@@ -119,7 +119,7 @@ The single exported component. Props:
|
|
|
119
119
|
|
|
120
120
|
## Part of structyl
|
|
121
121
|
|
|
122
|
-
This package is part of [structyl](https://github.com/imirfanul/structyl) — the React UI library with structure. Full documentation lives at [structyl.
|
|
122
|
+
This package is part of [structyl](https://github.com/imirfanul/structyl) — the React UI library with structure. Full documentation lives at [www.structyl.com](https://www.structyl.com).
|
|
123
123
|
|
|
124
124
|
## License
|
|
125
125
|
|
package/dist/index.cjs
CHANGED
|
@@ -108,8 +108,8 @@ var VideoControls = ({
|
|
|
108
108
|
]
|
|
109
109
|
}
|
|
110
110
|
) }),
|
|
111
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1", children: [
|
|
112
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-0.5
|
|
111
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1", style: { flexWrap: "wrap", justifyContent: "space-between" }, children: [
|
|
112
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-0.5", style: { minWidth: 0, flexWrap: "wrap" }, children: [
|
|
113
113
|
hasPlaylist && /* @__PURE__ */ jsxRuntime.jsx(styled.Button, { variant: "ghost", size: "icon", onClick: onPrevious, title: "Previous", className: "text-white/80 hover:text-white hover:bg-white/10", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronLeft, {}) }),
|
|
114
114
|
/* @__PURE__ */ jsxRuntime.jsx(styled.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__ */ jsxRuntime.jsx(lucideReact.Pause, {}) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Play, {}) }),
|
|
115
115
|
hasPlaylist && /* @__PURE__ */ jsxRuntime.jsx(styled.Button, { variant: "ghost", size: "icon", onClick: onNext, title: "Next", className: "text-white/80 hover:text-white hover:bg-white/10", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRight, {}) }),
|
|
@@ -156,7 +156,7 @@ var VideoControls = ({
|
|
|
156
156
|
side: "top",
|
|
157
157
|
align: "end",
|
|
158
158
|
sideOffset: 8,
|
|
159
|
-
className: "p-0 w-[
|
|
159
|
+
className: "p-0 w-[min(320px,calc(100vw-1rem))] max-h-[min(70dvh,420px)] overflow-y-auto bg-popover",
|
|
160
160
|
children: settingsPanel
|
|
161
161
|
}
|
|
162
162
|
)
|
|
@@ -269,7 +269,7 @@ var VideoSettings = ({
|
|
|
269
269
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col w-full", children: [
|
|
270
270
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center px-3 py-2.5 border-b border-border shrink-0", children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[13px] font-semibold text-fg", children: "Settings" }) }),
|
|
271
271
|
/* @__PURE__ */ jsxRuntime.jsxs(styled.Tabs.Root, { defaultValue: "subtitles", className: "flex flex-col flex-1 overflow-hidden", children: [
|
|
272
|
-
/* @__PURE__ */ jsxRuntime.jsxs(styled.Tabs.List, { className: "px-3 py-2 flex-shrink-0", children: [
|
|
272
|
+
/* @__PURE__ */ jsxRuntime.jsxs(styled.Tabs.List, { scrollable: true, className: "px-3 py-2 flex-shrink-0", children: [
|
|
273
273
|
/* @__PURE__ */ jsxRuntime.jsx(styled.Tabs.Trigger, { value: "subtitles", children: "Subtitles" }),
|
|
274
274
|
/* @__PURE__ */ jsxRuntime.jsx(styled.Tabs.Trigger, { value: "filters", children: "Filters" }),
|
|
275
275
|
/* @__PURE__ */ jsxRuntime.jsx(styled.Tabs.Trigger, { value: "quality", children: "Quality" }),
|
|
@@ -1237,22 +1237,30 @@ var VideoPlayer = ({
|
|
|
1237
1237
|
}, [togglePlay, skipForward, skipBackward, volume, handleVolumeChange, toggleMute, toggleFullscreen, togglePiP, duration]);
|
|
1238
1238
|
const youtubeId = extractYouTubeId(currentSrc);
|
|
1239
1239
|
if (youtubeId) {
|
|
1240
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1241
|
-
"
|
|
1240
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1241
|
+
"div",
|
|
1242
1242
|
{
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1243
|
+
className: `relative w-full overflow-hidden rounded-lg shadow-lg ${className}`,
|
|
1244
|
+
style: { aspectRatio: "16 / 9", backgroundColor: "#000" },
|
|
1245
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1246
|
+
"iframe",
|
|
1247
|
+
{
|
|
1248
|
+
src: `https://www.youtube.com/embed/${youtubeId}?autoplay=${autoPlay ? 1 : 0}&mute=${muted ? 1 : 0}&loop=${loop ? 1 : 0}&rel=0`,
|
|
1249
|
+
allow: "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share",
|
|
1250
|
+
allowFullScreen: true,
|
|
1251
|
+
className: "absolute inset-0 w-full h-full border-0",
|
|
1252
|
+
title: "YouTube video player"
|
|
1253
|
+
}
|
|
1254
|
+
)
|
|
1248
1255
|
}
|
|
1249
|
-
)
|
|
1256
|
+
);
|
|
1250
1257
|
}
|
|
1251
1258
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1252
1259
|
"div",
|
|
1253
1260
|
{
|
|
1254
1261
|
ref: containerRef,
|
|
1255
1262
|
className: `relative w-full aspect-video bg-bg overflow-hidden rounded-lg shadow-lg font-sans text-sm text-fg select-none ${className}`,
|
|
1263
|
+
style: { aspectRatio: "16 / 9" },
|
|
1256
1264
|
children: [
|
|
1257
1265
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1258
1266
|
"video",
|