@gcorevideo/player 2.28.35 → 2.29.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 +22 -1
- package/assets/{subtitles → cc}/style.scss +5 -0
- package/assets/media-control/media-control.scss +8 -6
- package/assets/multi-camera/multicamera.ejs +27 -23
- package/assets/multi-camera/style.scss +7 -34
- package/assets/style/main.scss +2 -2
- package/dist/core.js +24 -28
- package/dist/index.css +384 -402
- package/dist/index.embed.js +54 -84
- package/dist/index.js +122 -219
- package/docs/api/player.md +22 -9
- package/docs/api/player.mediacontrol.setkeepvisible.md +56 -0
- package/docs/api/player.multicamera.md +0 -28
- package/docs/api/player.multiccamerasourceinfo.md +27 -0
- package/docs/api/{player.multicamera.unbindevents.md → player.multisourcesmode.md} +4 -7
- package/docs/api/player.sourcecontroller.md +0 -37
- package/lib/playback/BasePlayback.d.ts +1 -0
- package/lib/playback/BasePlayback.d.ts.map +1 -1
- package/lib/playback/BasePlayback.js +3 -0
- package/lib/playback/dash-playback/DashPlayback.d.ts +3 -1
- package/lib/playback/dash-playback/DashPlayback.d.ts.map +1 -1
- package/lib/playback/dash-playback/DashPlayback.js +9 -22
- package/lib/playback/hls-playback/HlsPlayback.d.ts +2 -1
- package/lib/playback/hls-playback/HlsPlayback.d.ts.map +1 -1
- package/lib/playback/hls-playback/HlsPlayback.js +4 -0
- package/lib/playback/types.d.ts +9 -0
- package/lib/playback/types.d.ts.map +1 -1
- package/lib/playback.types.d.ts +0 -6
- package/lib/playback.types.d.ts.map +1 -1
- package/lib/plugins/multi-camera/MultiCamera.d.ts +21 -4
- package/lib/plugins/multi-camera/MultiCamera.d.ts.map +1 -1
- package/lib/plugins/multi-camera/MultiCamera.js +70 -134
- package/lib/plugins/source-controller/SourceController.d.ts +0 -39
- package/lib/plugins/source-controller/SourceController.d.ts.map +1 -1
- package/lib/plugins/source-controller/SourceController.js +0 -39
- package/lib/plugins/subtitles/ClosedCaptions.d.ts +1 -1
- package/lib/plugins/subtitles/ClosedCaptions.d.ts.map +1 -1
- package/lib/plugins/subtitles/ClosedCaptions.js +32 -22
- package/lib/testUtils.d.ts +1 -0
- package/lib/testUtils.d.ts.map +1 -1
- package/lib/testUtils.js +3 -0
- package/lib/utils/mediaSources.d.ts +4 -0
- package/lib/utils/mediaSources.d.ts.map +1 -1
- package/lib/utils/mediaSources.js +8 -6
- package/package.json +1 -1
- package/src/playback/BasePlayback.ts +4 -0
- package/src/playback/dash-playback/DashPlayback.ts +11 -29
- package/src/playback/hls-playback/HlsPlayback.ts +5 -1
- package/src/playback/types.ts +10 -0
- package/src/playback.types.ts +0 -6
- package/src/plugins/multi-camera/MultiCamera.ts +103 -166
- package/src/plugins/source-controller/SourceController.ts +0 -39
- package/src/plugins/subtitles/ClosedCaptions.ts +35 -21
- package/src/plugins/subtitles/__tests__/ClosedCaptions.test.ts +73 -112
- package/src/plugins/subtitles/__tests__/__snapshots__/ClosedCaptions.test.ts.snap +3 -3
- package/src/testUtils.ts +3 -0
- package/src/utils/mediaSources.ts +10 -6
- package/tsconfig.tsbuildinfo +1 -1
- package/docs/api/player.multicamera.activebyid.md +0 -67
- /package/assets/{subtitles → cc}/combobox.ejs +0 -0
- /package/assets/{subtitles → cc}/string.ejs +0 -0
package/dist/index.embed.js
CHANGED
|
@@ -12554,6 +12554,9 @@ var PlayerEvent;
|
|
|
12554
12554
|
PlayerEvent["VolumeUpdate"] = "volumeupdate";
|
|
12555
12555
|
})(PlayerEvent || (PlayerEvent = {}));
|
|
12556
12556
|
|
|
12557
|
+
const MIME_TYPES_HLS = ['application/x-mpegurl', 'application/vnd.apple.mpegurl'];
|
|
12558
|
+
const MIME_TYPE_HLS = MIME_TYPES_HLS[0];
|
|
12559
|
+
const MIME_TYPE_DASH = 'application/dash+xml';
|
|
12557
12560
|
// TODO rewrite using the Playback classes and canPlay static methods
|
|
12558
12561
|
function buildMediaSourcesList(sources, priorityTransport = 'dash') {
|
|
12559
12562
|
const playbacks = Loader.registeredPlaybacks;
|
|
@@ -12592,22 +12595,21 @@ function wrapSource(s) {
|
|
|
12592
12595
|
}
|
|
12593
12596
|
function guessMimeType(s) {
|
|
12594
12597
|
if (s.endsWith('.mpd')) {
|
|
12595
|
-
return
|
|
12598
|
+
return MIME_TYPE_DASH;
|
|
12596
12599
|
}
|
|
12597
12600
|
if (s.endsWith('.m3u8')) {
|
|
12598
|
-
|
|
12599
|
-
return 'application/x-mpegurl';
|
|
12601
|
+
return MIME_TYPE_HLS;
|
|
12600
12602
|
}
|
|
12601
12603
|
}
|
|
12602
12604
|
function isDashSource(source, mimeType) {
|
|
12603
12605
|
if (mimeType) {
|
|
12604
|
-
return mimeType ===
|
|
12606
|
+
return mimeType === MIME_TYPE_DASH; // TODO consider video/mp4
|
|
12605
12607
|
}
|
|
12606
12608
|
return source.endsWith('.mpd');
|
|
12607
12609
|
}
|
|
12608
12610
|
function isHlsSource(source, mimeType) {
|
|
12609
12611
|
if (mimeType) {
|
|
12610
|
-
return
|
|
12612
|
+
return MIME_TYPES_HLS.includes(mimeType.toLowerCase());
|
|
12611
12613
|
}
|
|
12612
12614
|
return source.endsWith('.m3u8');
|
|
12613
12615
|
}
|
|
@@ -12674,6 +12676,9 @@ class BasePlayback extends HTML5Video$1 {
|
|
|
12674
12676
|
super._onPlaying();
|
|
12675
12677
|
this.trigger(Events$1.PLAYBACK_MEDIACONTROL_ENABLE);
|
|
12676
12678
|
}
|
|
12679
|
+
setTextTrack(id) {
|
|
12680
|
+
// noop
|
|
12681
|
+
}
|
|
12677
12682
|
}
|
|
12678
12683
|
|
|
12679
12684
|
var PlaybackEvents;
|
|
@@ -12696,6 +12701,7 @@ const T$8 = 'playback.dash';
|
|
|
12696
12701
|
class DashPlayback extends BasePlayback {
|
|
12697
12702
|
_levels = [];
|
|
12698
12703
|
_currentLevel = AUTO$1;
|
|
12704
|
+
_currentTextTrackId = -1;
|
|
12699
12705
|
// true when the actual duration is longer than hlsjs's live sync point
|
|
12700
12706
|
// when this is false playableRegionDuration will be the actual duration
|
|
12701
12707
|
// when this is true playableRegionDuration will exclude the time after the sync point
|
|
@@ -12828,7 +12834,11 @@ class DashPlayback extends BasePlayback {
|
|
|
12828
12834
|
streaming: {
|
|
12829
12835
|
text: {
|
|
12830
12836
|
defaultEnabled: false,
|
|
12831
|
-
|
|
12837
|
+
// NOTE: dispatchForManualRendering is not correctly implemented in DASH.js;
|
|
12838
|
+
// it does not work when there are multiple text tracks.
|
|
12839
|
+
// CUE_ENTER and CUE_EXIT events might be dispatched additionally
|
|
12840
|
+
// for a track, other than the currently active one.
|
|
12841
|
+
// dispatchForManualRendering: true, // TODO only when useNativeSubtitles is not true?
|
|
12832
12842
|
},
|
|
12833
12843
|
},
|
|
12834
12844
|
}, this.options.dash);
|
|
@@ -12872,24 +12882,6 @@ class DashPlayback extends BasePlayback {
|
|
|
12872
12882
|
this._dash.on(_.events.PLAYBACK_RATE_CHANGED, (e) => {
|
|
12873
12883
|
this.trigger(PlaybackEvents.PLAYBACK_RATE_CHANGED, e.playbackRate);
|
|
12874
12884
|
});
|
|
12875
|
-
this._dash.on(_.events.TRACK_CHANGE_RENDERED, (e) => {
|
|
12876
|
-
if (e.mediaType === 'audio') {
|
|
12877
|
-
this.trigger(Events$1.PLAYBACK_AUDIO_CHANGED, toClapprTrack$1(e.newMediaInfo));
|
|
12878
|
-
}
|
|
12879
|
-
});
|
|
12880
|
-
this._dash.on(_.events.CUE_ENTER, (e) => {
|
|
12881
|
-
this.oncueenter?.({
|
|
12882
|
-
end: e.end,
|
|
12883
|
-
id: e.id,
|
|
12884
|
-
start: e.start,
|
|
12885
|
-
text: e.text,
|
|
12886
|
-
});
|
|
12887
|
-
});
|
|
12888
|
-
this._dash.on(_.events.CUE_EXIT, (e) => {
|
|
12889
|
-
this.oncueexit?.({
|
|
12890
|
-
id: e.id,
|
|
12891
|
-
});
|
|
12892
|
-
});
|
|
12893
12885
|
}
|
|
12894
12886
|
render() {
|
|
12895
12887
|
this._ready();
|
|
@@ -13199,14 +13191,14 @@ class DashPlayback extends BasePlayback {
|
|
|
13199
13191
|
this._dash?.setTextTrack(this.closedCaptionsTrackId);
|
|
13200
13192
|
}
|
|
13201
13193
|
setTextTrack(id) {
|
|
13194
|
+
this._currentTextTrackId = id;
|
|
13202
13195
|
this._dash?.setTextTrack(id);
|
|
13203
13196
|
}
|
|
13204
13197
|
/**
|
|
13205
13198
|
* @override
|
|
13206
13199
|
*/
|
|
13207
13200
|
get closedCaptionsTracks() {
|
|
13208
|
-
|
|
13209
|
-
return tt;
|
|
13201
|
+
return this.getTextTracks();
|
|
13210
13202
|
}
|
|
13211
13203
|
getTextTracks() {
|
|
13212
13204
|
return this._dash?.getTracksFor('text').map((t, index) => ({
|
|
@@ -13216,7 +13208,7 @@ class DashPlayback extends BasePlayback {
|
|
|
13216
13208
|
id: index,
|
|
13217
13209
|
label: getTextTrackLabel(t) || "",
|
|
13218
13210
|
language: t.lang,
|
|
13219
|
-
mode: "hidden",
|
|
13211
|
+
mode: this._currentTextTrackId === index ? "showing" : "hidden",
|
|
13220
13212
|
},
|
|
13221
13213
|
})) || [];
|
|
13222
13214
|
}
|
|
@@ -50727,7 +50719,11 @@ class HlsPlayback extends BasePlayback {
|
|
|
50727
50719
|
this.trigger(Events$1.PLAYBACK_AUDIO_CHANGED, toClapprTrack(track));
|
|
50728
50720
|
}
|
|
50729
50721
|
setTextTrack(id) {
|
|
50722
|
+
if (id === this._hls.subtitleTrack) {
|
|
50723
|
+
return;
|
|
50724
|
+
}
|
|
50730
50725
|
this._hls.subtitleTrack = id;
|
|
50726
|
+
this.cues = [];
|
|
50731
50727
|
}
|
|
50732
50728
|
/**
|
|
50733
50729
|
* @override
|
|
@@ -57007,7 +57003,7 @@ class ErrorScreen extends UICorePlugin {
|
|
|
57007
57003
|
|
|
57008
57004
|
insertStyle(".player-logo[data-logo] {\n position: absolute;\n z-index: 2;\n width: 100%;\n height: 100%;\n}\n\n.clappr-logo {\n position: absolute;\n}");
|
|
57009
57005
|
|
|
57010
|
-
insertStyle("*,\n:focus,\n:visited {\n outline: none !important;\n}\n\n.multicamera[data-multicamera] {\n
|
|
57006
|
+
insertStyle("*,\n:focus,\n:visited {\n outline: none !important;\n}\n\n.multicamera[data-multicamera] {\n position: relative;\n order: 80;\n}\n.multicamera[data-multicamera] button {\n background-color: transparent;\n color: #fff;\n font-family: Roboto, \"Open Sans\", Arial, sans-serif;\n -webkit-font-smoothing: antialiased;\n border: none;\n font-size: 14px;\n padding: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n width: 24px;\n height: 20px;\n}\n.multicamera[data-multicamera] button svg {\n height: 20px;\n position: relative;\n}\n.multicamera[data-multicamera] button:hover {\n color: #c9c9c9;\n}\n.multicamera[data-multicamera] button.changing {\n animation: pulse 0.5s infinite alternate;\n}\n.multicamera[data-multicamera] > ul {\n padding: 6px 0;\n right: -24px;\n width: 245px;\n list-style-type: none;\n position: absolute;\n bottom: 48px;\n border-radius: 4px;\n display: none;\n background-color: rgba(74, 74, 74, 0.9);\n}\n.multicamera[data-multicamera] > ul::after {\n content: \"\";\n position: absolute;\n top: 100%;\n left: 85%;\n margin-left: -10px;\n width: 0;\n height: 0;\n border-top: 10px solid rgba(74, 74, 74, 0.9);\n border-right: 10px solid transparent;\n border-left: 10px solid transparent;\n}\n.multicamera[data-multicamera] li {\n font-size: 10px;\n cursor: pointer;\n}\n.multicamera[data-multicamera] li .multicamera-item {\n display: flex;\n padding: 10px 0;\n justify-content: center;\n position: relative;\n}\n.multicamera[data-multicamera] li .multicamera-item[data-mulitcamera-selector-live=false] .multicamera-screenshot {\n opacity: 0.5;\n}\n.multicamera[data-multicamera] li .multicamera-item[data-mulitcamera-selector-live=false] .multicamera-text {\n opacity: 0.5;\n}\n.multicamera[data-multicamera] li .multicamera-item[data-mulitcamera-selector-live=false]:hover {\n background-color: rgba(0, 0, 0, 0);\n}\n.multicamera[data-multicamera] li .multicamera-item[data-mulitcamera-selector-live=false] {\n pointer-events: none;\n}\n.multicamera[data-multicamera] li .multicamera-item:hover, .multicamera[data-multicamera] li .multicamera-item.multicamera-active {\n background-color: rgba(0, 0, 0, 0.3);\n}\n.multicamera[data-multicamera] li .multicamera-item .multicamera-screenshot {\n width: 80px;\n height: 60px;\n}\n.multicamera[data-multicamera] li .multicamera-item .multicamera-screenshot img {\n width: 80px;\n height: 60px;\n}\n.multicamera[data-multicamera] li .multicamera-item .multicamera-text {\n width: 120px;\n text-align: left;\n margin-left: 15px;\n}\n.multicamera[data-multicamera] li .multicamera-item .multicamera-text .multicamera-title,\n.multicamera[data-multicamera] li .multicamera-item .multicamera-text .multicamera-description {\n width: 120px;\n height: 20px;\n font-family: Roboto, \"Open Sans\", Arial, sans-serif;\n font-size: 14px;\n font-weight: normal;\n font-style: normal;\n font-stretch: normal;\n line-height: 1.43;\n letter-spacing: normal;\n text-align: left;\n color: #fff;\n text-overflow: ellipsis;\n overflow: hidden;\n}\n.multicamera[data-multicamera] li .multicamera-item .multicamera-text .multicamera-description {\n opacity: 0.6;\n}");
|
|
57011
57007
|
|
|
57012
57008
|
const pipIcon = "<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n d=\"M21.05 3.00001C21.302 3.00001 21.5435 3.10003 21.7217 3.27833C21.9 3.45646 22 3.69802 22 3.95003V10.6H20.1V4.90003H4.90001V18.2H10.6V20.1H3.95001C3.69802 20.1 3.45647 20 3.27832 19.8217C3.10002 19.6436 3 19.402 3 19.15V3.95001C3 3.69802 3.10002 3.45647 3.27832 3.27832C3.45644 3.10002 3.69801 3 3.95001 3L21.05 3.00001ZM21.05 12.5C21.302 12.5 21.5435 12.6 21.7217 12.7783C21.9 12.9565 22 13.198 22 13.45V19.15C22 19.402 21.9 19.6436 21.7217 19.8217C21.5436 20 21.302 20.1 21.05 20.1H13.45C13.198 20.1 12.9564 20 12.7783 19.8217C12.6 19.6436 12.5 19.402 12.5 19.15V13.45C12.5 13.198 12.6 12.9565 12.7783 12.7783C12.9564 12.6 13.198 12.5 13.45 12.5H21.05ZM7.47178 6.12823L9.60928 8.26572L11.5501 6.32492V11.5499H6.32509L8.26589 9.60911L6.12839 7.47161L7.47178 6.12823Z\"\n fill=\"#C9C9C9\"/>\n</svg>\n";
|
|
57013
57009
|
|
|
@@ -58307,45 +58303,6 @@ function noSync(cb) {
|
|
|
58307
58303
|
* `PLUGIN` that is managing the automatic failover between media sources.
|
|
58308
58304
|
* @public
|
|
58309
58305
|
* @remarks
|
|
58310
|
-
* Have a look at the {@link https://miro.com/app/board/uXjVLiN15tY=/?share_link_id=390327585787 | source failover diagram} for the details
|
|
58311
|
-
* on how sources ordering and selection works. Below is a simplified diagram:
|
|
58312
|
-
*
|
|
58313
|
-
* ```markdown
|
|
58314
|
-
* sources_list:
|
|
58315
|
-
* - a.mpd | +--------------------+
|
|
58316
|
-
* - b.m3u8 |--->| init |
|
|
58317
|
-
* - ... | |--------------------|
|
|
58318
|
-
* | current_source = 0 |
|
|
58319
|
-
* +--------------------+
|
|
58320
|
-
* |
|
|
58321
|
-
* | source = a.mpd
|
|
58322
|
-
* | playback = dash.js
|
|
58323
|
-
* v
|
|
58324
|
-
* +------------------+
|
|
58325
|
-
* +-->| load source |
|
|
58326
|
-
* | +---------|--------+
|
|
58327
|
-
* | v
|
|
58328
|
-
* | +------------------+
|
|
58329
|
-
* | | play |
|
|
58330
|
-
* | +---------|--------+
|
|
58331
|
-
* | |
|
|
58332
|
-
* | v
|
|
58333
|
-
* | +-----------------------+
|
|
58334
|
-
* | | on playback_error |
|
|
58335
|
-
* | |-----------------------|
|
|
58336
|
-
* | | current_source = |
|
|
58337
|
-
* | | (current_source + 1) |
|
|
58338
|
-
* | | % len sources_list |
|
|
58339
|
-
* | | |
|
|
58340
|
-
* | | delay 1..3s |
|
|
58341
|
-
* | +---------------|-------+
|
|
58342
|
-
* | |
|
|
58343
|
-
* | source=b.m3u8 |
|
|
58344
|
-
* | playback=hls.js |
|
|
58345
|
-
* +-------------------+
|
|
58346
|
-
*
|
|
58347
|
-
* ```
|
|
58348
|
-
*
|
|
58349
58306
|
* @example
|
|
58350
58307
|
* ```ts
|
|
58351
58308
|
* import { SourceController } from '@gcorevideo/player'
|
|
@@ -58549,7 +58506,7 @@ class SourceController extends CorePlugin {
|
|
|
58549
58506
|
}
|
|
58550
58507
|
}
|
|
58551
58508
|
|
|
58552
|
-
insertStyle(".media-control-skin-1 .media-control-cc button.media-control-button {\n display: flex;\n justify-content: center;\n padding: 0;\n align-items: center;\n vertical-align: top;\n}\n.media-control-skin-1 .media-control-cc button.media-control-button:hover {\n color: white;\n}\n.media-control-skin-1 .media-control-cc ul li {\n text-align: center;\n}\n.media-control-skin-1 .media-control-cc ul li a {\n height: 30px;\n padding: 5px 10px;\n color: #fffffe;\n}\n.media-control-skin-1 .media-control-cc ul li a:hover {\n background-color: rgba(0, 0, 0, 0.4);\n}\n.media-control-skin-1 .media-control-cc ul li.current a {\n background-color: rgba(0, 0, 0, 0.4);\n}\n.media-control-skin-1 .media-control-cc ul li:first-child a {\n border-bottom-left-radius: 4px;\n border-bottom-right-radius: 4px;\n}\n.media-control-skin-1 .media-control-cc ul li:last-child a {\n border-top-left-radius: 4px;\n border-top-right-radius: 4px;\n}\n.media-control-skin-1 .media-control-cc {\n position: relative;\n order: 85;\n}\n\n::cue {\n visibility: hidden !important;\n font-size: 0 !important;\n}\n\n.ios-fullscreen::cue {\n visibility: visible !important;\n font-size: 1em !important;\n}\n\n.container .gplayer-cc-line {\n position: absolute;\n bottom: calc(var(--bottom-panel) + 5px);\n width: 100%;\n}\n.container .gplayer-cc-line p {\n width: auto;\n background-color: rgba(0, 0, 0, 0.4);\n color: white;\n display: inline-block;\n}");
|
|
58509
|
+
insertStyle(".media-control-skin-1 .media-control-cc button.media-control-button {\n display: flex;\n justify-content: center;\n padding: 0;\n align-items: center;\n vertical-align: top;\n}\n.media-control-skin-1 .media-control-cc button.media-control-button:hover {\n color: white;\n}\n.media-control-skin-1 .media-control-cc ul li {\n text-align: center;\n}\n.media-control-skin-1 .media-control-cc ul li a {\n height: 30px;\n padding: 5px 10px;\n color: #fffffe;\n}\n.media-control-skin-1 .media-control-cc ul li a:hover {\n background-color: rgba(0, 0, 0, 0.4);\n}\n.media-control-skin-1 .media-control-cc ul li.current a {\n background-color: rgba(0, 0, 0, 0.4);\n}\n.media-control-skin-1 .media-control-cc ul li:first-child a {\n border-bottom-left-radius: 4px;\n border-bottom-right-radius: 4px;\n}\n.media-control-skin-1 .media-control-cc ul li:last-child a {\n border-top-left-radius: 4px;\n border-top-right-radius: 4px;\n}\n.media-control-skin-1 .media-control-cc {\n position: relative;\n order: 85;\n}\n\n::cue {\n visibility: hidden !important;\n font-size: 0 !important;\n}\n\n.ios-fullscreen::cue {\n visibility: visible !important;\n font-size: 1em !important;\n}\n\n.container .gplayer-cc-line {\n position: absolute;\n bottom: calc(var(--bottom-panel) + 5px);\n width: 100%;\n transition: transform 0.3s ease-out;\n}\n.container .gplayer-cc-line.media-control-cc-pulled {\n transform: translateY(var(--bottom-panel));\n}\n.container .gplayer-cc-line p {\n width: auto;\n background-color: rgba(0, 0, 0, 0.4);\n color: white;\n display: inline-block;\n}");
|
|
58553
58510
|
|
|
58554
58511
|
const subtitlesOffIcon = "<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n d=\"M16.238 16.1C13.979 16.1 12.578 14.538 12.578 11.997C12.578 9.462 13.973 7.9 16.238 7.9C18.087 7.9 19.5029 9.127 19.6219 10.824H18.032C17.876 9.927 17.168 9.338 16.238 9.338C15.011 9.338 14.249 10.354 14.249 11.997C14.249 13.641 15.011 14.662 16.243 14.662C17.178 14.662 17.881 14.111 18.038 13.251H19.627C19.492 14.938 18.119 16.1 16.238 16.1ZM8.03198 16.1C5.77298 16.1 4.37299 14.538 4.37299 11.997C4.37299 9.462 5.76798 7.9 8.03198 7.9C9.88098 7.9 11.298 9.127 11.416 10.824H9.82697C9.67097 9.927 8.96198 9.338 8.03198 9.338C6.80598 9.338 6.04297 10.354 6.04297 11.997C6.04297 13.641 6.80596 14.662 8.03796 14.662C8.97296 14.662 9.67601 14.111 9.83301 13.251H11.422C11.287 14.938 9.91398 16.1 8.03198 16.1ZM22.5 3H1.5C0.672 3 0 3.671 0 4.5V19.5C0 20.329 0.672 21 1.5 21H22.5C23.329 21 24 20.329 24 19.5V4.5C24 3.671 23.329 3 22.5 3Z\"\n fill=\"#C9C9C9\"/>\n</svg>\n";
|
|
58555
58512
|
|
|
@@ -58661,8 +58618,12 @@ class ClosedCaptions extends UICorePlugin {
|
|
|
58661
58618
|
const mediaControl = this.core.getPlugin('media_control');
|
|
58662
58619
|
assert(mediaControl, 'media_control plugin is required');
|
|
58663
58620
|
this.listenTo(mediaControl, Events$1.MEDIACONTROL_RENDERED, this.mount);
|
|
58621
|
+
this.listenTo(mediaControl, Events$1.MEDIACONTROL_SHOW, () => {
|
|
58622
|
+
this.$line?.removeClass('media-control-cc-pulled');
|
|
58623
|
+
});
|
|
58664
58624
|
this.listenTo(mediaControl, Events$1.MEDIACONTROL_HIDE, () => {
|
|
58665
58625
|
this.hideMenu();
|
|
58626
|
+
this.$line?.addClass('media-control-cc-pulled');
|
|
58666
58627
|
});
|
|
58667
58628
|
this.listenTo(mediaControl, ExtendedEvents.MEDIACONTROL_MENU_COLLAPSE, (from) => {
|
|
58668
58629
|
if (from !== this.name) {
|
|
@@ -58720,23 +58681,27 @@ class ClosedCaptions extends UICorePlugin {
|
|
|
58720
58681
|
this.activateTrack(id);
|
|
58721
58682
|
}
|
|
58722
58683
|
activateTrack(id) {
|
|
58723
|
-
|
|
58724
|
-
|
|
58684
|
+
const isManaged = this.core.activePlayback?.name === 'hls';
|
|
58685
|
+
this.core.activePlayback.setTextTrack(id);
|
|
58686
|
+
if (isManaged) {
|
|
58725
58687
|
return;
|
|
58726
58688
|
}
|
|
58727
|
-
|
|
58728
|
-
|
|
58689
|
+
if (!this.core.activePlayback?.el.textTracks) {
|
|
58690
|
+
return;
|
|
58691
|
+
}
|
|
58692
|
+
for (const [index, track] of Array.from(this.core.activePlayback?.el.textTracks ?? []).entries()) {
|
|
58693
|
+
if (index === id) {
|
|
58729
58694
|
if (this.useNativeSubtitles) {
|
|
58730
|
-
track.
|
|
58695
|
+
track.mode = 'showing';
|
|
58731
58696
|
}
|
|
58732
58697
|
else {
|
|
58733
|
-
track.
|
|
58698
|
+
track.mode = 'hidden';
|
|
58734
58699
|
}
|
|
58735
|
-
this.setSubtitleText(this.getSubtitleText(track
|
|
58736
|
-
track.
|
|
58700
|
+
this.setSubtitleText(this.getSubtitleText(track));
|
|
58701
|
+
track.oncuechange = () => {
|
|
58737
58702
|
try {
|
|
58738
|
-
if (track.
|
|
58739
|
-
const html = track.
|
|
58703
|
+
if (track.activeCues?.length) {
|
|
58704
|
+
const html = track.activeCues[0].getCueAsHTML();
|
|
58740
58705
|
this.setSubtitleText(html);
|
|
58741
58706
|
}
|
|
58742
58707
|
else {
|
|
@@ -58748,8 +58713,8 @@ class ClosedCaptions extends UICorePlugin {
|
|
|
58748
58713
|
};
|
|
58749
58714
|
}
|
|
58750
58715
|
else {
|
|
58751
|
-
track.
|
|
58752
|
-
track.
|
|
58716
|
+
track.oncuechange = () => { };
|
|
58717
|
+
track.mode = 'disabled';
|
|
58753
58718
|
}
|
|
58754
58719
|
}
|
|
58755
58720
|
}
|
|
@@ -58790,8 +58755,10 @@ class ClosedCaptions extends UICorePlugin {
|
|
|
58790
58755
|
this.$el.find('#gplayer-cc-menu').hide();
|
|
58791
58756
|
this.$el.find('#gplayer-cc-button').attr('aria-expanded', 'false');
|
|
58792
58757
|
this.$line.hide();
|
|
58793
|
-
for (const track of this.
|
|
58794
|
-
track.
|
|
58758
|
+
for (const track of this.core.activePlayback.el.textTracks) {
|
|
58759
|
+
if (track.mode === 'showing') {
|
|
58760
|
+
track.mode = 'hidden';
|
|
58761
|
+
}
|
|
58795
58762
|
}
|
|
58796
58763
|
}
|
|
58797
58764
|
/**
|
|
@@ -58803,7 +58770,6 @@ class ClosedCaptions extends UICorePlugin {
|
|
|
58803
58770
|
if (this.core.activeContainer &&
|
|
58804
58771
|
isFullscreen(this.core.activeContainer.el) &&
|
|
58805
58772
|
this.currentTrack &&
|
|
58806
|
-
// this.currentTrack.track.mode &&
|
|
58807
58773
|
(Browser.isiOS || this.useNativeSubtitles)) {
|
|
58808
58774
|
this.$line.hide();
|
|
58809
58775
|
this.currentTrack.track.mode = 'showing';
|
|
@@ -58845,6 +58811,10 @@ class ClosedCaptions extends UICorePlugin {
|
|
|
58845
58811
|
this.resizeFont();
|
|
58846
58812
|
this.clampPopup();
|
|
58847
58813
|
this.core.activeContainer.$el.append(this.$line);
|
|
58814
|
+
const mc = this.core.getPlugin('media_control');
|
|
58815
|
+
if (!mc?.isVisible()) {
|
|
58816
|
+
this.$line?.addClass('media-control-cc-pulled');
|
|
58817
|
+
}
|
|
58848
58818
|
this.updateSelection();
|
|
58849
58819
|
this.renderIcon();
|
|
58850
58820
|
return this;
|
|
@@ -58950,7 +58920,7 @@ class ClosedCaptions extends UICorePlugin {
|
|
|
58950
58920
|
this.setSubtitleText('');
|
|
58951
58921
|
}
|
|
58952
58922
|
updateSelection() {
|
|
58953
|
-
if (
|
|
58923
|
+
if (this.core.activePlayback.closedCaptionsTrackId === -1) {
|
|
58954
58924
|
this.hide();
|
|
58955
58925
|
}
|
|
58956
58926
|
else {
|