@lightbird/ui 0.7.0 → 0.8.0
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 +11 -15
- package/dist/index.js +12 -16
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -1933,7 +1933,6 @@ var MAX_RETRIES = 3;
|
|
|
1933
1933
|
var LightBirdPlayer = () => {
|
|
1934
1934
|
const videoRef = React11.useRef(null);
|
|
1935
1935
|
const containerRef = React11.useRef(null);
|
|
1936
|
-
const canvasRef = React11.useRef(null);
|
|
1937
1936
|
const subtitleInputRef = React11.useRef(null);
|
|
1938
1937
|
const playerRef = React11.useRef(null);
|
|
1939
1938
|
const subtitleFilesMapRef = React11.useRef(/* @__PURE__ */ new Map());
|
|
@@ -2425,19 +2424,17 @@ var LightBirdPlayer = () => {
|
|
|
2425
2424
|
}, [toast2]);
|
|
2426
2425
|
const captureScreenshot = React11.useCallback(() => {
|
|
2427
2426
|
const video = videoRef.current;
|
|
2428
|
-
|
|
2429
|
-
|
|
2430
|
-
|
|
2431
|
-
|
|
2432
|
-
|
|
2433
|
-
|
|
2434
|
-
|
|
2435
|
-
|
|
2436
|
-
|
|
2437
|
-
|
|
2438
|
-
|
|
2439
|
-
a.download = `lightbird-screenshot-${(/* @__PURE__ */ new Date()).toISOString()}.png`;
|
|
2440
|
-
a.click();
|
|
2427
|
+
if (!video) return;
|
|
2428
|
+
const dataUrl = core.exportVideoFrame(video, { filter: video.style.filter });
|
|
2429
|
+
if (!dataUrl) {
|
|
2430
|
+
toast2({
|
|
2431
|
+
title: "Screenshot failed",
|
|
2432
|
+
description: "The frame could not be captured (the video may be cross-origin protected).",
|
|
2433
|
+
variant: "destructive"
|
|
2434
|
+
});
|
|
2435
|
+
return;
|
|
2436
|
+
}
|
|
2437
|
+
core.downloadDataUrl(dataUrl, core.frameExportFilename("png"));
|
|
2441
2438
|
toast2({ title: "Screenshot Saved" });
|
|
2442
2439
|
}, [toast2]);
|
|
2443
2440
|
const handleABLoopCycle = React11.useCallback(() => {
|
|
@@ -2516,7 +2513,6 @@ var LightBirdPlayer = () => {
|
|
|
2516
2513
|
crossOrigin: "anonymous"
|
|
2517
2514
|
}
|
|
2518
2515
|
),
|
|
2519
|
-
/* @__PURE__ */ jsxRuntime.jsx("canvas", { ref: canvasRef, className: "hidden" }),
|
|
2520
2516
|
/* @__PURE__ */ jsxRuntime.jsx(SubtitleOverlay, { videoRef, activeSubtitle: subtitles.activeSubtitle }),
|
|
2521
2517
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2522
2518
|
VideoOverlay,
|
package/dist/index.js
CHANGED
|
@@ -18,7 +18,7 @@ import { SortableContext, verticalListSortingStrategy, arrayMove, useSortable }
|
|
|
18
18
|
import { CSS } from '@dnd-kit/utilities';
|
|
19
19
|
import * as ScrollAreaPrimitive from '@radix-ui/react-scroll-area';
|
|
20
20
|
import * as SelectPrimitive from '@radix-ui/react-select';
|
|
21
|
-
import { exportPlaylist, formatShortcutKey, FLAG_MAGNET_LINK, loadShortcuts, ProgressEstimator, createVideoPlayer, CancellationError, hasAcceptedDisclaimer, acceptDisclaimer, initFeatureFlags, parseMediaError, captureVideoThumbnail, validateFile, parseM3U8, matchesShortcut, saveShortcuts, DEFAULT_SHORTCUTS } from '@lightbird/core';
|
|
21
|
+
import { exportPlaylist, formatShortcutKey, FLAG_MAGNET_LINK, loadShortcuts, ProgressEstimator, createVideoPlayer, CancellationError, hasAcceptedDisclaimer, acceptDisclaimer, exportVideoFrame, downloadDataUrl, frameExportFilename, initFeatureFlags, parseMediaError, captureVideoThumbnail, validateFile, parseM3U8, matchesShortcut, saveShortcuts, DEFAULT_SHORTCUTS } from '@lightbird/core';
|
|
22
22
|
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
23
23
|
import { useBooleanFlagValue, OpenFeatureProvider } from '@openfeature/react-sdk';
|
|
24
24
|
import * as AlertDialogPrimitive from '@radix-ui/react-alert-dialog';
|
|
@@ -1902,7 +1902,6 @@ var MAX_RETRIES = 3;
|
|
|
1902
1902
|
var LightBirdPlayer = () => {
|
|
1903
1903
|
const videoRef = useRef(null);
|
|
1904
1904
|
const containerRef = useRef(null);
|
|
1905
|
-
const canvasRef = useRef(null);
|
|
1906
1905
|
const subtitleInputRef = useRef(null);
|
|
1907
1906
|
const playerRef = useRef(null);
|
|
1908
1907
|
const subtitleFilesMapRef = useRef(/* @__PURE__ */ new Map());
|
|
@@ -2394,19 +2393,17 @@ var LightBirdPlayer = () => {
|
|
|
2394
2393
|
}, [toast2]);
|
|
2395
2394
|
const captureScreenshot = useCallback(() => {
|
|
2396
2395
|
const video = videoRef.current;
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
|
|
2407
|
-
|
|
2408
|
-
a.download = `lightbird-screenshot-${(/* @__PURE__ */ new Date()).toISOString()}.png`;
|
|
2409
|
-
a.click();
|
|
2396
|
+
if (!video) return;
|
|
2397
|
+
const dataUrl = exportVideoFrame(video, { filter: video.style.filter });
|
|
2398
|
+
if (!dataUrl) {
|
|
2399
|
+
toast2({
|
|
2400
|
+
title: "Screenshot failed",
|
|
2401
|
+
description: "The frame could not be captured (the video may be cross-origin protected).",
|
|
2402
|
+
variant: "destructive"
|
|
2403
|
+
});
|
|
2404
|
+
return;
|
|
2405
|
+
}
|
|
2406
|
+
downloadDataUrl(dataUrl, frameExportFilename("png"));
|
|
2410
2407
|
toast2({ title: "Screenshot Saved" });
|
|
2411
2408
|
}, [toast2]);
|
|
2412
2409
|
const handleABLoopCycle = useCallback(() => {
|
|
@@ -2485,7 +2482,6 @@ var LightBirdPlayer = () => {
|
|
|
2485
2482
|
crossOrigin: "anonymous"
|
|
2486
2483
|
}
|
|
2487
2484
|
),
|
|
2488
|
-
/* @__PURE__ */ jsx("canvas", { ref: canvasRef, className: "hidden" }),
|
|
2489
2485
|
/* @__PURE__ */ jsx(SubtitleOverlay, { videoRef, activeSubtitle: subtitles.activeSubtitle }),
|
|
2490
2486
|
/* @__PURE__ */ jsx(
|
|
2491
2487
|
VideoOverlay,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lightbird/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"description": "Drop-in React video player component powered by LightBird. Full controls, playlist, subtitles, chapters — one import.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Punyam Singh",
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
"clsx": "^2.1.1",
|
|
66
66
|
"lucide-react": "^0.475.0",
|
|
67
67
|
"tailwind-merge": "^3.0.1",
|
|
68
|
-
"@lightbird/core": "0.
|
|
68
|
+
"@lightbird/core": "0.8.0"
|
|
69
69
|
},
|
|
70
70
|
"peerDependencies": {
|
|
71
71
|
"react": "^18.0.0 || ^19.0.0",
|