@nikelroot/video-player 0.2.1 → 0.2.3
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/README.md +1 -1
- package/dist/index.cjs +1 -14
- package/dist/index.js +1 -14
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -37,7 +37,7 @@ export function Example() {
|
|
|
37
37
|
}
|
|
38
38
|
```
|
|
39
39
|
|
|
40
|
-
When `active` is `true`, pressing `F` toggles fullscreen.
|
|
40
|
+
When `active` is `true`, pressing `F` toggles fullscreen.
|
|
41
41
|
|
|
42
42
|
For public CDN-hosted videos, prefer non-credentialed requests unless the CDN is explicitly configured for cookies:
|
|
43
43
|
|
package/dist/index.cjs
CHANGED
|
@@ -869,7 +869,6 @@ var VideoPlayerBase = (props, ref) => {
|
|
|
869
869
|
const duration = durationProp != null ? durationProp : durationState;
|
|
870
870
|
const currentTime = currentTimeState;
|
|
871
871
|
const fullscreenAllowed = active != null ? active : true;
|
|
872
|
-
const shouldLoadMedia = active !== false;
|
|
873
872
|
const onTimeChangeRef = (0, import_react3.useRef)(onTimeChange);
|
|
874
873
|
const onDurationChangeRef = (0, import_react3.useRef)(onDurationChange);
|
|
875
874
|
onTimeChangeRef.current = onTimeChange;
|
|
@@ -1399,17 +1398,6 @@ var VideoPlayerBase = (props, ref) => {
|
|
|
1399
1398
|
liveStabilityMode.current = false;
|
|
1400
1399
|
liveStallEvents.current = [];
|
|
1401
1400
|
resetMediaForSourceChange();
|
|
1402
|
-
if (!shouldLoadMedia) {
|
|
1403
|
-
setTimeD.current.cancel();
|
|
1404
|
-
setCurrentTimeUi.current.cancel();
|
|
1405
|
-
setDurationState(0);
|
|
1406
|
-
setCurrentTimeState(0);
|
|
1407
|
-
setPlayingState(false);
|
|
1408
|
-
return () => {
|
|
1409
|
-
sourceLoadId.current += 1;
|
|
1410
|
-
resetMediaForSourceChange();
|
|
1411
|
-
};
|
|
1412
|
-
}
|
|
1413
1401
|
if (sourceType === "native" || type === "video") loadVideoNative(loadId);
|
|
1414
1402
|
else if (sourceType === "hls") void loadVideo(initialTime, loadId);
|
|
1415
1403
|
else if (isLikelyHlsSource(videoSrc)) void loadVideoHls(loadId);
|
|
@@ -1424,7 +1412,6 @@ var VideoPlayerBase = (props, ref) => {
|
|
|
1424
1412
|
loadVideoHls,
|
|
1425
1413
|
loadVideoNative,
|
|
1426
1414
|
initialTime,
|
|
1427
|
-
shouldLoadMedia,
|
|
1428
1415
|
resetMediaForSourceChange,
|
|
1429
1416
|
reloadKey,
|
|
1430
1417
|
reloadToken,
|
|
@@ -1521,7 +1508,7 @@ var VideoPlayerBase = (props, ref) => {
|
|
|
1521
1508
|
crossOrigin,
|
|
1522
1509
|
playsInline: true,
|
|
1523
1510
|
muted,
|
|
1524
|
-
preload
|
|
1511
|
+
preload,
|
|
1525
1512
|
loop,
|
|
1526
1513
|
onPlay: () => setNextPlaying(true),
|
|
1527
1514
|
onPause: () => setNextPlaying(false),
|
package/dist/index.js
CHANGED
|
@@ -840,7 +840,6 @@ var VideoPlayerBase = (props, ref) => {
|
|
|
840
840
|
const duration = durationProp != null ? durationProp : durationState;
|
|
841
841
|
const currentTime = currentTimeState;
|
|
842
842
|
const fullscreenAllowed = active != null ? active : true;
|
|
843
|
-
const shouldLoadMedia = active !== false;
|
|
844
843
|
const onTimeChangeRef = useRef2(onTimeChange);
|
|
845
844
|
const onDurationChangeRef = useRef2(onDurationChange);
|
|
846
845
|
onTimeChangeRef.current = onTimeChange;
|
|
@@ -1370,17 +1369,6 @@ var VideoPlayerBase = (props, ref) => {
|
|
|
1370
1369
|
liveStabilityMode.current = false;
|
|
1371
1370
|
liveStallEvents.current = [];
|
|
1372
1371
|
resetMediaForSourceChange();
|
|
1373
|
-
if (!shouldLoadMedia) {
|
|
1374
|
-
setTimeD.current.cancel();
|
|
1375
|
-
setCurrentTimeUi.current.cancel();
|
|
1376
|
-
setDurationState(0);
|
|
1377
|
-
setCurrentTimeState(0);
|
|
1378
|
-
setPlayingState(false);
|
|
1379
|
-
return () => {
|
|
1380
|
-
sourceLoadId.current += 1;
|
|
1381
|
-
resetMediaForSourceChange();
|
|
1382
|
-
};
|
|
1383
|
-
}
|
|
1384
1372
|
if (sourceType === "native" || type === "video") loadVideoNative(loadId);
|
|
1385
1373
|
else if (sourceType === "hls") void loadVideo(initialTime, loadId);
|
|
1386
1374
|
else if (isLikelyHlsSource(videoSrc)) void loadVideoHls(loadId);
|
|
@@ -1395,7 +1383,6 @@ var VideoPlayerBase = (props, ref) => {
|
|
|
1395
1383
|
loadVideoHls,
|
|
1396
1384
|
loadVideoNative,
|
|
1397
1385
|
initialTime,
|
|
1398
|
-
shouldLoadMedia,
|
|
1399
1386
|
resetMediaForSourceChange,
|
|
1400
1387
|
reloadKey,
|
|
1401
1388
|
reloadToken,
|
|
@@ -1492,7 +1479,7 @@ var VideoPlayerBase = (props, ref) => {
|
|
|
1492
1479
|
crossOrigin,
|
|
1493
1480
|
playsInline: true,
|
|
1494
1481
|
muted,
|
|
1495
|
-
preload
|
|
1482
|
+
preload,
|
|
1496
1483
|
loop,
|
|
1497
1484
|
onPlay: () => setNextPlaying(true),
|
|
1498
1485
|
onPause: () => setNextPlaying(false),
|