box-content-preview 3.44.0 → 3.46.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/README.md +7 -7
- package/dist/lib/88.css +1 -1
- package/dist/lib/index.css +7 -4
- package/dist/lib/index.js +318 -17
- package/package.json +1 -1
package/dist/lib/index.js
CHANGED
|
@@ -9340,7 +9340,7 @@ function util_toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var
|
|
|
9340
9340
|
const CLIENT_NAME = "box-content-preview"; // eslint-disable-line no-undef
|
|
9341
9341
|
const CLIENT_NAME_KEY = 'box_client_name';
|
|
9342
9342
|
const CLIENT_VERSION_KEY = 'box_client_version';
|
|
9343
|
-
const CLIENT_VERSION = "3.
|
|
9343
|
+
const CLIENT_VERSION = "3.46.0"; // eslint-disable-line no-undef
|
|
9344
9344
|
const HEADER_CLIENT_NAME = 'X-Box-Client-Name';
|
|
9345
9345
|
const HEADER_CLIENT_VERSION = 'X-Box-Client-Version';
|
|
9346
9346
|
const PROMISE_MAP = {};
|
|
@@ -11058,7 +11058,7 @@ class Browser {
|
|
|
11058
11058
|
;// ./src/lib/Logger.js
|
|
11059
11059
|
/* eslint-disable no-undef */
|
|
11060
11060
|
const Logger_CLIENT_NAME = "box-content-preview";
|
|
11061
|
-
const Logger_CLIENT_VERSION = "3.
|
|
11061
|
+
const Logger_CLIENT_VERSION = "3.46.0";
|
|
11062
11062
|
/* eslint-enable no-undef */
|
|
11063
11063
|
|
|
11064
11064
|
class Logger {
|
|
@@ -26290,6 +26290,10 @@ class VideoBaseViewer extends media_MediaBaseViewer {
|
|
|
26290
26290
|
// Shift up by half the control bar + half the spinner to visually center above the controls
|
|
26291
26291
|
this.bufferingSpinnerEl.style.marginTop = `-${VIDEO_PLAYER_CONTROL_BAR_HEIGHT / 2 + SPINNER_HALF_SIZE}px`;
|
|
26292
26292
|
}
|
|
26293
|
+
if (this.featureEnabled('videoPlayerV2.enabled')) {
|
|
26294
|
+
this.wrapperEl.classList.add('bp-media--v2');
|
|
26295
|
+
this.mediaContainerEl.classList.add('bp-media-container--v2');
|
|
26296
|
+
}
|
|
26293
26297
|
this.lowerLights();
|
|
26294
26298
|
}
|
|
26295
26299
|
|
|
@@ -26573,9 +26577,13 @@ class VideoBaseViewer extends media_MediaBaseViewer {
|
|
|
26573
26577
|
*/
|
|
26574
26578
|
loadUIReact() {
|
|
26575
26579
|
super.loadUIReact();
|
|
26580
|
+
|
|
26581
|
+
// For the V2 player, mount the controls on the wrapper (above the media container)
|
|
26582
|
+
// so their width is constrained by the viewport rather than the video
|
|
26583
|
+
const controlsContainerEl = this.featureEnabled('videoPlayerV2.enabled') ? this.wrapperEl : this.mediaContainerEl;
|
|
26576
26584
|
this.controls = new ControlsRoot({
|
|
26577
26585
|
className: 'bp-VideoControlsRoot',
|
|
26578
|
-
containerEl:
|
|
26586
|
+
containerEl: controlsContainerEl,
|
|
26579
26587
|
fileId: this.options.file.id,
|
|
26580
26588
|
onHide: this.handleControlsHide,
|
|
26581
26589
|
onShow: this.handleControlsShow
|
|
@@ -26786,9 +26794,6 @@ class VideoBaseViewer extends media_MediaBaseViewer {
|
|
|
26786
26794
|
this.mediaEl.style.width = `${viewport.height * this.aspect}px`;
|
|
26787
26795
|
}
|
|
26788
26796
|
}
|
|
26789
|
-
if (this.mediaContainerEl && this.mediaEl.style.width) {
|
|
26790
|
-
this.mediaContainerEl.style.width = this.mediaEl.style.width;
|
|
26791
|
-
}
|
|
26792
26797
|
}
|
|
26793
26798
|
|
|
26794
26799
|
/**
|
|
@@ -26800,15 +26805,15 @@ class VideoBaseViewer extends media_MediaBaseViewer {
|
|
|
26800
26805
|
*/
|
|
26801
26806
|
handleNarrowVideoUI() {
|
|
26802
26807
|
if (this.useReactControls()) {
|
|
26803
|
-
const
|
|
26804
|
-
if (!Number.isNaN(
|
|
26808
|
+
const widthNumber = this.featureEnabled('videoPlayerV2.enabled') ? this.wrapperEl.clientWidth : parseInt(this.mediaEl.style.width, 10);
|
|
26809
|
+
if (!Number.isNaN(widthNumber)) {
|
|
26805
26810
|
// check if play and seek buttons exist in the dom
|
|
26806
|
-
if (this.playContainerEl &&
|
|
26811
|
+
if (this.playContainerEl && widthNumber >= SMALL_VIDEO_WIDTH_THRESHOLD) {
|
|
26807
26812
|
this.isNarrowVideo = false;
|
|
26808
26813
|
this.removePlayButtonWithSeekButtons();
|
|
26809
26814
|
this.preloader?.showPlayOverlay();
|
|
26810
26815
|
this.renderUI();
|
|
26811
|
-
} else if (!this.playContainerEl &&
|
|
26816
|
+
} else if (!this.playContainerEl && widthNumber < SMALL_VIDEO_WIDTH_THRESHOLD) {
|
|
26812
26817
|
this.buildPlayButtonWithSeekButtons();
|
|
26813
26818
|
this.preloader?.hidePlayOverlay();
|
|
26814
26819
|
this.isNarrowVideo = true;
|
|
@@ -27315,6 +27320,295 @@ function isFpsAvailable(player) {
|
|
|
27315
27320
|
const tracks = player.getVariantTracks();
|
|
27316
27321
|
return tracks.some(t => t.frameRate != null && t.frameRate > 0);
|
|
27317
27322
|
}
|
|
27323
|
+
;// ./src/lib/viewers/controls/media/FilmstripV2.scss
|
|
27324
|
+
// extracted by mini-css-extract-plugin
|
|
27325
|
+
|
|
27326
|
+
;// ./src/lib/viewers/controls/media/FilmstripV2.tsx
|
|
27327
|
+
|
|
27328
|
+
|
|
27329
|
+
|
|
27330
|
+
|
|
27331
|
+
const FilmstripV2_FILMSTRIP_FRAMES_PER_ROW = 100;
|
|
27332
|
+
const FILMSTRIP_SOURCE_FRAME_HEIGHT = 90;
|
|
27333
|
+
const FILMSTRIP_DISPLAY_HEIGHT = 135;
|
|
27334
|
+
const FILMSTRIP_DISPLAY_WIDTH = 240;
|
|
27335
|
+
function FilmstripV2(_ref) {
|
|
27336
|
+
let {
|
|
27337
|
+
aspectRatio = 0,
|
|
27338
|
+
imageUrl = '',
|
|
27339
|
+
interval = 1,
|
|
27340
|
+
isShown,
|
|
27341
|
+
position = 0,
|
|
27342
|
+
positionMax = 0,
|
|
27343
|
+
time = 0
|
|
27344
|
+
} = _ref;
|
|
27345
|
+
const [isLoading, setIsLoading] = __WEBPACK_EXTERNAL_MODULE_react_default__.useState(true);
|
|
27346
|
+
const [imageWidth, setImageWidth] = __WEBPACK_EXTERNAL_MODULE_react_default__.useState(0);
|
|
27347
|
+
const frameNumber = Math.floor(time / interval);
|
|
27348
|
+
const frameRow = Math.floor(frameNumber / FilmstripV2_FILMSTRIP_FRAMES_PER_ROW);
|
|
27349
|
+
const sourceFrameWidth = imageWidth ? Math.floor(imageWidth / FilmstripV2_FILMSTRIP_FRAMES_PER_ROW) : Math.floor(aspectRatio * FILMSTRIP_SOURCE_FRAME_HEIGHT) || Math.floor(FILMSTRIP_DISPLAY_WIDTH * (FILMSTRIP_SOURCE_FRAME_HEIGHT / FILMSTRIP_DISPLAY_HEIGHT));
|
|
27350
|
+
const scale = FILMSTRIP_DISPLAY_HEIGHT / FILMSTRIP_SOURCE_FRAME_HEIGHT;
|
|
27351
|
+
const displayWidth = Math.floor(sourceFrameWidth * scale) || FILMSTRIP_DISPLAY_WIDTH;
|
|
27352
|
+
const backgroundLeft = -(frameNumber % FilmstripV2_FILMSTRIP_FRAMES_PER_ROW) * displayWidth;
|
|
27353
|
+
const backgroundTop = -(frameRow * FILMSTRIP_DISPLAY_HEIGHT);
|
|
27354
|
+
const backgroundWidth = imageWidth ? imageWidth * scale : undefined;
|
|
27355
|
+
const cardWidth = displayWidth + 24;
|
|
27356
|
+
const filmstripLeft = Math.min(Math.max(0, position - cardWidth / 2), positionMax - cardWidth);
|
|
27357
|
+
__WEBPACK_EXTERNAL_MODULE_react_default__.useEffect(() => {
|
|
27358
|
+
if (!imageUrl) return;
|
|
27359
|
+
const filmstripImage = document.createElement('img');
|
|
27360
|
+
filmstripImage.onload = () => {
|
|
27361
|
+
setImageWidth(filmstripImage.naturalWidth);
|
|
27362
|
+
setIsLoading(false);
|
|
27363
|
+
};
|
|
27364
|
+
filmstripImage.src = imageUrl;
|
|
27365
|
+
}, [imageUrl]);
|
|
27366
|
+
return /*#__PURE__*/__WEBPACK_EXTERNAL_MODULE_react_default__.createElement("div", {
|
|
27367
|
+
className: classnames_default()('bp-FilmstripV2', {
|
|
27368
|
+
'bp-is-shown': isShown
|
|
27369
|
+
}),
|
|
27370
|
+
"data-testid": "bp-FilmstripV2",
|
|
27371
|
+
style: {
|
|
27372
|
+
left: `${filmstripLeft}px`
|
|
27373
|
+
}
|
|
27374
|
+
}, /*#__PURE__*/__WEBPACK_EXTERNAL_MODULE_react_default__.createElement("div", {
|
|
27375
|
+
className: "bp-FilmstripV2-frame",
|
|
27376
|
+
"data-testid": "bp-FilmstripV2-frame",
|
|
27377
|
+
style: {
|
|
27378
|
+
backgroundImage: imageUrl ? `url('${imageUrl}')` : '',
|
|
27379
|
+
backgroundPositionX: backgroundLeft,
|
|
27380
|
+
backgroundPositionY: backgroundTop,
|
|
27381
|
+
backgroundSize: backgroundWidth ? `${backgroundWidth}px auto` : undefined,
|
|
27382
|
+
height: FILMSTRIP_DISPLAY_HEIGHT,
|
|
27383
|
+
width: displayWidth
|
|
27384
|
+
}
|
|
27385
|
+
}, isLoading && /*#__PURE__*/__WEBPACK_EXTERNAL_MODULE_react_default__.createElement("div", {
|
|
27386
|
+
className: "bp-crawler",
|
|
27387
|
+
"data-testid": "bp-FilmstripV2-crawler"
|
|
27388
|
+
}, /*#__PURE__*/__WEBPACK_EXTERNAL_MODULE_react_default__.createElement("div", null), /*#__PURE__*/__WEBPACK_EXTERNAL_MODULE_react_default__.createElement("div", null), /*#__PURE__*/__WEBPACK_EXTERNAL_MODULE_react_default__.createElement("div", null))), /*#__PURE__*/__WEBPACK_EXTERNAL_MODULE_react_default__.createElement("div", {
|
|
27389
|
+
className: "bp-FilmstripV2-time",
|
|
27390
|
+
"data-testid": "bp-FilmstripV2-time"
|
|
27391
|
+
}, formatTime(time)));
|
|
27392
|
+
}
|
|
27393
|
+
;// ./src/lib/viewers/controls/media/TimeControlsV2.scss
|
|
27394
|
+
// extracted by mini-css-extract-plugin
|
|
27395
|
+
|
|
27396
|
+
;// ./src/lib/viewers/controls/media/TimeControlsV2.tsx
|
|
27397
|
+
|
|
27398
|
+
|
|
27399
|
+
|
|
27400
|
+
|
|
27401
|
+
|
|
27402
|
+
|
|
27403
|
+
|
|
27404
|
+
const TimeControlsV2_round = value => {
|
|
27405
|
+
return +value.toFixed(4);
|
|
27406
|
+
};
|
|
27407
|
+
const TimeControlsV2_percent = (value1, value2) => {
|
|
27408
|
+
return TimeControlsV2_round(value1 / value2 * 100);
|
|
27409
|
+
};
|
|
27410
|
+
function TimeControlsV2(_ref) {
|
|
27411
|
+
let {
|
|
27412
|
+
aspectRatio,
|
|
27413
|
+
currentTime = 0,
|
|
27414
|
+
durationTime = 0,
|
|
27415
|
+
filmstripInterval,
|
|
27416
|
+
filmstripUrl,
|
|
27417
|
+
fps,
|
|
27418
|
+
mediaEl,
|
|
27419
|
+
onTimeChange
|
|
27420
|
+
} = _ref;
|
|
27421
|
+
const [isSliderHovered, setIsSliderHovered] = __WEBPACK_EXTERNAL_MODULE_react_default__.useState(false);
|
|
27422
|
+
const [hoverPosition, setHoverPosition] = __WEBPACK_EXTERNAL_MODULE_react_default__.useState(0);
|
|
27423
|
+
const [hoverPositionMax, setHoverPositionMax] = __WEBPACK_EXTERNAL_MODULE_react_default__.useState(0);
|
|
27424
|
+
const [hoverTime, setHoverTime] = __WEBPACK_EXTERNAL_MODULE_react_default__.useState(0);
|
|
27425
|
+
const currentValue = isFinite_default()(currentTime) ? currentTime : 0;
|
|
27426
|
+
const durationValue = isFinite_default()(durationTime) ? durationTime : 0;
|
|
27427
|
+
const currentPercentage = TimeControlsV2_percent(currentValue, durationValue);
|
|
27428
|
+
const handleMouseMove = (newTime, newPosition, width) => {
|
|
27429
|
+
setHoverPosition(newPosition);
|
|
27430
|
+
setHoverPositionMax(width);
|
|
27431
|
+
setHoverTime(newTime);
|
|
27432
|
+
};
|
|
27433
|
+
return /*#__PURE__*/__WEBPACK_EXTERNAL_MODULE_react_default__.createElement("div", {
|
|
27434
|
+
className: "bp-TimeControlsV2",
|
|
27435
|
+
"data-testid": "bp-time-controls-v2"
|
|
27436
|
+
}, !!filmstripInterval && /*#__PURE__*/__WEBPACK_EXTERNAL_MODULE_react_default__.createElement(FilmstripV2, {
|
|
27437
|
+
aspectRatio: aspectRatio,
|
|
27438
|
+
imageUrl: filmstripUrl,
|
|
27439
|
+
interval: filmstripInterval,
|
|
27440
|
+
isShown: isSliderHovered,
|
|
27441
|
+
position: hoverPosition,
|
|
27442
|
+
positionMax: hoverPositionMax,
|
|
27443
|
+
time: hoverTime
|
|
27444
|
+
}), /*#__PURE__*/__WEBPACK_EXTERNAL_MODULE_react_default__.createElement(SliderControl, {
|
|
27445
|
+
className: "bp-TimeControlsV2-slider",
|
|
27446
|
+
"data-resin-target": "timeScrubber",
|
|
27447
|
+
max: durationValue,
|
|
27448
|
+
min: 0,
|
|
27449
|
+
onBlur: (noop_default()),
|
|
27450
|
+
onFocus: (noop_default()),
|
|
27451
|
+
onMouseOut: () => setIsSliderHovered(false),
|
|
27452
|
+
onMouseOver: () => setIsSliderHovered(true),
|
|
27453
|
+
onMove: handleMouseMove,
|
|
27454
|
+
onUpdate: onTimeChange,
|
|
27455
|
+
step: fps ? 1 / fps : 5,
|
|
27456
|
+
title: "Media Slider",
|
|
27457
|
+
track: `linear-gradient(to right, ${__WEBPACK_EXTERNAL_MODULE_box_ui_elements_es_styles_variables_c815ce80_white__} calc(${currentPercentage}% - 2.5px), transparent calc(${currentPercentage}% - 2.5px), transparent calc(${currentPercentage}% + 2.5px), ${__WEBPACK_EXTERNAL_MODULE_box_ui_elements_es_styles_variables_c815ce80_bdlGray65__} calc(${currentPercentage}% + 2.5px), ${__WEBPACK_EXTERNAL_MODULE_box_ui_elements_es_styles_variables_c815ce80_bdlGray65__} 100%)`,
|
|
27458
|
+
value: currentValue
|
|
27459
|
+
}));
|
|
27460
|
+
}
|
|
27461
|
+
;// ./src/lib/viewers/media/VideoControlsV2.scss
|
|
27462
|
+
// extracted by mini-css-extract-plugin
|
|
27463
|
+
|
|
27464
|
+
;// ./src/lib/viewers/media/VideoControlsV2.tsx
|
|
27465
|
+
|
|
27466
|
+
|
|
27467
|
+
|
|
27468
|
+
|
|
27469
|
+
|
|
27470
|
+
|
|
27471
|
+
|
|
27472
|
+
|
|
27473
|
+
|
|
27474
|
+
|
|
27475
|
+
|
|
27476
|
+
|
|
27477
|
+
|
|
27478
|
+
|
|
27479
|
+
|
|
27480
|
+
function VideoControlsV2(_ref) {
|
|
27481
|
+
let {
|
|
27482
|
+
annotationColor,
|
|
27483
|
+
annotationMode,
|
|
27484
|
+
aspectRatio,
|
|
27485
|
+
audioTrack,
|
|
27486
|
+
audioTracks,
|
|
27487
|
+
autoplay,
|
|
27488
|
+
currentTime = 0,
|
|
27489
|
+
durationTime = 0,
|
|
27490
|
+
filmstripInterval,
|
|
27491
|
+
filmstripUrl,
|
|
27492
|
+
fps,
|
|
27493
|
+
hasDrawing,
|
|
27494
|
+
hasRegion,
|
|
27495
|
+
isAutoGeneratedSubtitles,
|
|
27496
|
+
isHDSupported,
|
|
27497
|
+
isNarrowVideo,
|
|
27498
|
+
isPlaying,
|
|
27499
|
+
mediaEl,
|
|
27500
|
+
movePlayback,
|
|
27501
|
+
onAnnotationColorChange,
|
|
27502
|
+
onAnnotationModeClick,
|
|
27503
|
+
onAnnotationModeEscape,
|
|
27504
|
+
onAudioTrackChange,
|
|
27505
|
+
onAutoplayChange,
|
|
27506
|
+
onMuteChange,
|
|
27507
|
+
onPlayPause,
|
|
27508
|
+
onQualityChange,
|
|
27509
|
+
onRateChange,
|
|
27510
|
+
onSubtitleChange,
|
|
27511
|
+
onSubtitlesToggle,
|
|
27512
|
+
onTimeChange,
|
|
27513
|
+
onVolumeChange,
|
|
27514
|
+
quality,
|
|
27515
|
+
rate,
|
|
27516
|
+
subtitle,
|
|
27517
|
+
subtitles = [],
|
|
27518
|
+
videoAnnotationsEnabled = false,
|
|
27519
|
+
volume
|
|
27520
|
+
} = _ref;
|
|
27521
|
+
const PlayPauseIcon = isPlaying ? icons_IconPause24 : icons_IconPlay24;
|
|
27522
|
+
const playPauseTitle = isPlaying ? "Pause" : "Play";
|
|
27523
|
+
const skipForwardTitle = "Skip forward";
|
|
27524
|
+
const skipBackwardTitle = "Skip backward";
|
|
27525
|
+
const moveForward = () => {
|
|
27526
|
+
movePlayback(true, MEDIA_PLAYBACK_SKIP_DURATION);
|
|
27527
|
+
};
|
|
27528
|
+
const moveBackward = () => {
|
|
27529
|
+
movePlayback(false, MEDIA_PLAYBACK_SKIP_DURATION);
|
|
27530
|
+
};
|
|
27531
|
+
const timeLabel = isNarrowVideo ? formatTime(currentTime) : `${formatTime(currentTime)} / ${formatTime(durationTime)}`;
|
|
27532
|
+
return /*#__PURE__*/__WEBPACK_EXTERNAL_MODULE_react_default__.createElement("div", {
|
|
27533
|
+
className: "bp-VideoControlsV2",
|
|
27534
|
+
"data-testid": "media-controls-wrapper-v2"
|
|
27535
|
+
}, /*#__PURE__*/__WEBPACK_EXTERNAL_MODULE_react_default__.createElement(TimeControlsV2, {
|
|
27536
|
+
aspectRatio: aspectRatio,
|
|
27537
|
+
currentTime: currentTime,
|
|
27538
|
+
durationTime: durationTime,
|
|
27539
|
+
filmstripInterval: filmstripInterval,
|
|
27540
|
+
filmstripUrl: filmstripUrl,
|
|
27541
|
+
fps: fps,
|
|
27542
|
+
mediaEl: mediaEl,
|
|
27543
|
+
onTimeChange: onTimeChange
|
|
27544
|
+
}), /*#__PURE__*/__WEBPACK_EXTERNAL_MODULE_react_default__.createElement("div", {
|
|
27545
|
+
className: "bp-VideoControlsV2-bar"
|
|
27546
|
+
}, /*#__PURE__*/__WEBPACK_EXTERNAL_MODULE_react_default__.createElement("div", {
|
|
27547
|
+
className: "bp-VideoControlsV2-group bp-VideoControlsV2-group--left"
|
|
27548
|
+
}, /*#__PURE__*/__WEBPACK_EXTERNAL_MODULE_react_default__.createElement(MediaToggle, {
|
|
27549
|
+
className: "bp-VideoControlsV2-playPause",
|
|
27550
|
+
"data-resin-target": "playPause",
|
|
27551
|
+
onClick: () => onPlayPause(!isPlaying),
|
|
27552
|
+
title: playPauseTitle
|
|
27553
|
+
}, /*#__PURE__*/__WEBPACK_EXTERNAL_MODULE_react_default__.createElement(PlayPauseIcon, null)), !isNarrowVideo && /*#__PURE__*/__WEBPACK_EXTERNAL_MODULE_react_default__.createElement(__WEBPACK_EXTERNAL_MODULE_react_default__.Fragment, null, /*#__PURE__*/__WEBPACK_EXTERNAL_MODULE_react_default__.createElement("div", {
|
|
27554
|
+
className: "bp-VideoControlsV2-divider"
|
|
27555
|
+
}), /*#__PURE__*/__WEBPACK_EXTERNAL_MODULE_react_default__.createElement(MediaToggle, {
|
|
27556
|
+
className: "bp-VideoControlsV2-skipBtn",
|
|
27557
|
+
"data-resin-target": "skipBackward",
|
|
27558
|
+
onClick: moveBackward,
|
|
27559
|
+
title: skipBackwardTitle
|
|
27560
|
+
}, /*#__PURE__*/__WEBPACK_EXTERNAL_MODULE_react_default__.createElement(icons_IconArrowCurveBack24, null)), /*#__PURE__*/__WEBPACK_EXTERNAL_MODULE_react_default__.createElement(MediaToggle, {
|
|
27561
|
+
className: "bp-VideoControlsV2-skipBtn",
|
|
27562
|
+
"data-resin-target": "skipForward",
|
|
27563
|
+
onClick: moveForward,
|
|
27564
|
+
title: skipForwardTitle
|
|
27565
|
+
}, /*#__PURE__*/__WEBPACK_EXTERNAL_MODULE_react_default__.createElement(icons_IconArrowCurveForward24, null)), /*#__PURE__*/__WEBPACK_EXTERNAL_MODULE_react_default__.createElement("div", {
|
|
27566
|
+
className: "bp-VideoControlsV2-divider"
|
|
27567
|
+
})), /*#__PURE__*/__WEBPACK_EXTERNAL_MODULE_react_default__.createElement("span", {
|
|
27568
|
+
className: "bp-VideoControlsV2-timestamp",
|
|
27569
|
+
"data-testid": "bp-VideoControlsV2-timestamp"
|
|
27570
|
+
}, timeLabel)), /*#__PURE__*/__WEBPACK_EXTERNAL_MODULE_react_default__.createElement("div", {
|
|
27571
|
+
className: "bp-VideoControlsV2-group bp-VideoControlsV2-group--right"
|
|
27572
|
+
}, /*#__PURE__*/__WEBPACK_EXTERNAL_MODULE_react_default__.createElement(VolumeControls, {
|
|
27573
|
+
onMuteChange: onMuteChange,
|
|
27574
|
+
onVolumeChange: onVolumeChange,
|
|
27575
|
+
volume: volume
|
|
27576
|
+
}), /*#__PURE__*/__WEBPACK_EXTERNAL_MODULE_react_default__.createElement(SubtitlesToggle, {
|
|
27577
|
+
isAutoGeneratedSubtitles: isAutoGeneratedSubtitles,
|
|
27578
|
+
isShowingSubtitles: subtitle !== SUBTITLES_OFF,
|
|
27579
|
+
onSubtitlesToggle: onSubtitlesToggle,
|
|
27580
|
+
subtitles: subtitles
|
|
27581
|
+
}), /*#__PURE__*/__WEBPACK_EXTERNAL_MODULE_react_default__.createElement(MediaSettings, {
|
|
27582
|
+
audioTrack: audioTrack,
|
|
27583
|
+
audioTracks: audioTracks,
|
|
27584
|
+
autoplay: autoplay,
|
|
27585
|
+
className: "bp-VideoControls-settings",
|
|
27586
|
+
isHDSupported: isHDSupported,
|
|
27587
|
+
onAudioTrackChange: onAudioTrackChange,
|
|
27588
|
+
onAutoplayChange: onAutoplayChange,
|
|
27589
|
+
onQualityChange: onQualityChange,
|
|
27590
|
+
onRateChange: onRateChange,
|
|
27591
|
+
onSubtitleChange: onSubtitleChange,
|
|
27592
|
+
quality: quality,
|
|
27593
|
+
rate: rate,
|
|
27594
|
+
subtitle: subtitle,
|
|
27595
|
+
subtitles: subtitles
|
|
27596
|
+
}), videoAnnotationsEnabled && /*#__PURE__*/__WEBPACK_EXTERNAL_MODULE_react_default__.createElement(__WEBPACK_EXTERNAL_MODULE_react_default__.Fragment, null, /*#__PURE__*/__WEBPACK_EXTERNAL_MODULE_react_default__.createElement("div", {
|
|
27597
|
+
className: "bp-VideoControlsV2-divider"
|
|
27598
|
+
}), /*#__PURE__*/__WEBPACK_EXTERNAL_MODULE_react_default__.createElement(AnnotationsControls, {
|
|
27599
|
+
annotationColor: annotationColor,
|
|
27600
|
+
annotationMode: annotationMode,
|
|
27601
|
+
hasDrawing: hasDrawing,
|
|
27602
|
+
hasRegion: hasRegion,
|
|
27603
|
+
isVideo: true,
|
|
27604
|
+
onAnnotationModeClick: onAnnotationModeClick,
|
|
27605
|
+
onAnnotationModeEscape: onAnnotationModeEscape
|
|
27606
|
+
}), /*#__PURE__*/__WEBPACK_EXTERNAL_MODULE_react_default__.createElement(DrawingControls, {
|
|
27607
|
+
annotationColor: annotationColor,
|
|
27608
|
+
annotationMode: annotationMode,
|
|
27609
|
+
onAnnotationColorChange: onAnnotationColorChange
|
|
27610
|
+
})))));
|
|
27611
|
+
}
|
|
27318
27612
|
;// ./src/lib/viewers/media/DashViewer.js
|
|
27319
27613
|
function DashViewer_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
27320
27614
|
function DashViewer_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? DashViewer_ownKeys(Object(t), !0).forEach(function (r) { DashViewer_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : DashViewer_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
@@ -27334,6 +27628,7 @@ function DashViewer_toPrimitive(t, r) { if ("object" != typeof t || !t) return t
|
|
|
27334
27628
|
|
|
27335
27629
|
|
|
27336
27630
|
|
|
27631
|
+
|
|
27337
27632
|
const CSS_CLASS_DASH = 'bp-media-dash';
|
|
27338
27633
|
const CSS_CLASS_HD = 'bp-media-controls-is-hd';
|
|
27339
27634
|
const SEGMENT_SIZE = 5;
|
|
@@ -28520,28 +28815,24 @@ class DashViewer extends media_VideoBaseViewer {
|
|
|
28520
28815
|
} = this.options;
|
|
28521
28816
|
const canAnnotate = this.areNewAnnotationsEnabled() && this.hasAnnotationCreatePermission() && this.videoAnnotationsEnabled;
|
|
28522
28817
|
const annotationsEnabled = !!this.annotator && this.videoAnnotationsEnabled;
|
|
28523
|
-
|
|
28818
|
+
const sharedProps = {
|
|
28524
28819
|
annotationColor: this.annotationModule.getColor(),
|
|
28525
28820
|
annotationMode: this.annotationControlsFSM.getMode(),
|
|
28526
28821
|
aspectRatio: this.aspect,
|
|
28527
28822
|
audioTrack: this.selectedAudioTrack,
|
|
28528
28823
|
audioTracks: this.audioTracks,
|
|
28529
28824
|
autoplay: this.isAutoplayEnabled(),
|
|
28530
|
-
bufferedRange: this.mediaEl.buffered,
|
|
28531
28825
|
currentTime: this.mediaEl.currentTime,
|
|
28532
28826
|
durationTime: this.mediaEl.duration,
|
|
28533
|
-
experiences: this.experiences,
|
|
28534
28827
|
filmstripInterval: this.filmstripInterval,
|
|
28535
28828
|
filmstripUrl: this.filmstripUrl,
|
|
28536
28829
|
fps: this.featureEnabled('frameStep.enabled') && isFpsAvailable(this.player) ? getVideoFps(this.player) : undefined,
|
|
28537
28830
|
hasDrawing: canDraw,
|
|
28538
|
-
hasHighlight: false,
|
|
28539
28831
|
hasRegion: canAnnotate,
|
|
28540
28832
|
isAutoGeneratedSubtitles: !!this.autoCaptionDisplayer,
|
|
28541
28833
|
isHDSupported: this.hdVideoId !== -1,
|
|
28542
28834
|
isNarrowVideo: this.isNarrowVideo,
|
|
28543
28835
|
isPlaying: !this.mediaEl.paused,
|
|
28544
|
-
isPlayingHD: this.isPlayingHD(),
|
|
28545
28836
|
mediaEl: this.mediaEl,
|
|
28546
28837
|
movePlayback: this.movePlayback,
|
|
28547
28838
|
onAnnotationColorChange: this.handleAnnotationColorChange,
|
|
@@ -28549,7 +28840,6 @@ class DashViewer extends media_VideoBaseViewer {
|
|
|
28549
28840
|
onAnnotationModeEscape: this.handleAnnotationControlsEscape,
|
|
28550
28841
|
onAudioTrackChange: this.setAudioTrack,
|
|
28551
28842
|
onAutoplayChange: this.setAutoplay,
|
|
28552
|
-
onFullscreenToggle: this.toggleFullscreen,
|
|
28553
28843
|
onMuteChange: this.toggleMute,
|
|
28554
28844
|
onPlayPause: this.handlePlayRequest,
|
|
28555
28845
|
onQualityChange: this.setQuality,
|
|
@@ -28564,7 +28854,18 @@ class DashViewer extends media_VideoBaseViewer {
|
|
|
28564
28854
|
subtitles: this.textTracks,
|
|
28565
28855
|
videoAnnotationsEnabled: annotationsEnabled,
|
|
28566
28856
|
volume: this.mediaEl.volume
|
|
28567
|
-
}
|
|
28857
|
+
};
|
|
28858
|
+
if (this.featureEnabled('videoPlayerV2.enabled')) {
|
|
28859
|
+
this.controls.render( /*#__PURE__*/__WEBPACK_EXTERNAL_MODULE_react_default__.createElement(VideoControlsV2, sharedProps));
|
|
28860
|
+
return;
|
|
28861
|
+
}
|
|
28862
|
+
this.controls.render( /*#__PURE__*/__WEBPACK_EXTERNAL_MODULE_react_default__.createElement(VideoControls, DashViewer_extends({}, sharedProps, {
|
|
28863
|
+
bufferedRange: this.mediaEl.buffered,
|
|
28864
|
+
experiences: this.experiences,
|
|
28865
|
+
hasHighlight: false,
|
|
28866
|
+
isPlayingHD: this.isPlayingHD(),
|
|
28867
|
+
onFullscreenToggle: this.toggleFullscreen
|
|
28868
|
+
})));
|
|
28568
28869
|
}
|
|
28569
28870
|
}
|
|
28570
28871
|
/* harmony default export */ const media_DashViewer = (DashViewer);
|