@gcorevideo/player 2.28.23 → 2.28.25
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/assets/subtitles/style.scss +9 -8
- package/dist/core.js +8 -1
- package/dist/index.css +143 -133
- package/dist/index.embed.js +66 -23
- package/dist/index.js +70 -23
- package/lib/playback/dash-playback/DashPlayback.d.ts +4 -0
- package/lib/playback/dash-playback/DashPlayback.d.ts.map +1 -1
- package/lib/playback/dash-playback/DashPlayback.js +7 -0
- package/lib/plugins/subtitles/ClosedCaptions.d.ts +7 -2
- package/lib/plugins/subtitles/ClosedCaptions.d.ts.map +1 -1
- package/lib/plugins/subtitles/ClosedCaptions.js +61 -21
- package/package.json +1 -1
- package/src/playback/BasePlayback.ts +1 -1
- package/src/playback/dash-playback/DashPlayback.ts +8 -0
- package/src/plugins/subtitles/ClosedCaptions.ts +71 -34
- package/src/plugins/subtitles/__tests__/ClosedCaptions.test.ts +6 -6
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -53,14 +53,15 @@
|
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
56
|
+
::cue {
|
|
57
|
+
visibility: hidden !important;
|
|
58
|
+
font-size: 0 !important;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.ios-fullscreen::cue {
|
|
62
|
+
visibility: visible !important;
|
|
63
|
+
font-size: 1em !important;
|
|
64
|
+
}
|
|
64
65
|
|
|
65
66
|
.container {
|
|
66
67
|
.gplayer-cc-line {
|
package/dist/core.js
CHANGED
|
@@ -13247,6 +13247,13 @@ class DashPlayback extends BasePlayback {
|
|
|
13247
13247
|
this.trigger(Events$1.PLAYBACK_AUDIO_AVAILABLE, tracks.map(toClapprTrack$1));
|
|
13248
13248
|
}
|
|
13249
13249
|
}
|
|
13250
|
+
/**
|
|
13251
|
+
* @override
|
|
13252
|
+
*/
|
|
13253
|
+
_handleTextTrackChange() {
|
|
13254
|
+
super._handleTextTrackChange();
|
|
13255
|
+
this._dash?.setTextTrack(this.closedCaptionsTrackId);
|
|
13256
|
+
}
|
|
13250
13257
|
}
|
|
13251
13258
|
DashPlayback.canPlay = function (resource, mimeType) {
|
|
13252
13259
|
if (!isDashSource(resource, mimeType)) {
|
|
@@ -51319,7 +51326,7 @@ class Player {
|
|
|
51319
51326
|
}
|
|
51320
51327
|
}
|
|
51321
51328
|
|
|
51322
|
-
var version$1 = "2.28.
|
|
51329
|
+
var version$1 = "2.28.25";
|
|
51323
51330
|
|
|
51324
51331
|
var packages = {
|
|
51325
51332
|
"node_modules/@clappr/core": {
|
package/dist/index.css
CHANGED
|
@@ -122,55 +122,51 @@
|
|
|
122
122
|
.gplayer-lite-btn::-moz-focus-inner {
|
|
123
123
|
border: 0;
|
|
124
124
|
padding: 0;
|
|
125
|
-
}.
|
|
126
|
-
|
|
127
|
-
z-index: 9998;
|
|
128
|
-
background-color: transparent;
|
|
129
|
-
display: flex;
|
|
130
|
-
justify-content: center;
|
|
131
|
-
width: 100%;
|
|
132
|
-
height: calc(100% - 50px);
|
|
133
|
-
margin: 0 auto;
|
|
134
|
-
opacity: 0.75;
|
|
135
|
-
transition: opacity 0.1s ease;
|
|
136
|
-
pointer-events: auto;
|
|
125
|
+
}.media-control-skin-1 .media-control-item.media-control-gear {
|
|
126
|
+
order: 99;
|
|
137
127
|
}
|
|
138
|
-
.
|
|
139
|
-
|
|
128
|
+
.media-control-skin-1 .media-control-item.media-control-gear .gear-wrapper {
|
|
129
|
+
position: absolute;
|
|
130
|
+
right: 16px;
|
|
131
|
+
bottom: 52px;
|
|
132
|
+
width: 250px;
|
|
133
|
+
min-height: 48px;
|
|
134
|
+
z-index: 9999;
|
|
135
|
+
border-radius: 4px;
|
|
136
|
+
box-shadow: 0 0 1px 1px var(--gplayer-mc-popup-border-color);
|
|
140
137
|
}
|
|
141
|
-
.
|
|
142
|
-
|
|
138
|
+
.media-control-skin-1 .media-control-item.media-control-gear .gear-options-list {
|
|
139
|
+
padding: 8px 0;
|
|
143
140
|
}
|
|
144
|
-
|
|
145
|
-
|
|
141
|
+
.media-control-skin-1 .media-control-item.media-control-gear .gear-option {
|
|
142
|
+
margin: 0;
|
|
143
|
+
text-align: left;
|
|
144
|
+
line-height: 22px;
|
|
145
|
+
padding: 5px 14px;
|
|
146
|
+
width: 250px;
|
|
147
|
+
font-size: 12px;
|
|
146
148
|
display: flex;
|
|
147
149
|
align-items: center;
|
|
148
|
-
justify-content:
|
|
149
|
-
|
|
150
|
-
width: 120px;
|
|
151
|
-
height: 120px;
|
|
152
|
-
border: 2px solid white;
|
|
153
|
-
border-radius: 50%;
|
|
154
|
-
filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=60)";
|
|
155
|
-
filter: alpha(opacity=60);
|
|
156
|
-
opacity: 1;
|
|
157
|
-
box-shadow: 0 0 1px 0 white;
|
|
158
|
-
background: rgba(240, 243, 247, 0.9411764706);
|
|
159
|
-
z-index: 10000;
|
|
150
|
+
justify-content: flex-start;
|
|
151
|
+
gap: 8px;
|
|
160
152
|
}
|
|
161
|
-
.
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
height: 80px;
|
|
153
|
+
.media-control-skin-1 .media-control-item.media-control-gear .gear-option_icon {
|
|
154
|
+
flex: 24px 0 0;
|
|
155
|
+
height: 20px;
|
|
165
156
|
}
|
|
166
|
-
.
|
|
167
|
-
|
|
157
|
+
.media-control-skin-1 .media-control-item.media-control-gear .gear-option_icon.hidden {
|
|
158
|
+
visibility: hidden;
|
|
159
|
+
display: inline-block;
|
|
168
160
|
}
|
|
169
|
-
.
|
|
170
|
-
|
|
161
|
+
.media-control-skin-1 .media-control-item.media-control-gear .gear-option_label {
|
|
162
|
+
flex: 0 1 100%;
|
|
171
163
|
}
|
|
172
|
-
.
|
|
173
|
-
|
|
164
|
+
.media-control-skin-1 .media-control-item.media-control-gear .gear-option_arrow-right-icon {
|
|
165
|
+
flex: 0 0 14px;
|
|
166
|
+
height: 20px;
|
|
167
|
+
}
|
|
168
|
+
.media-control-skin-1 .media-control-item.media-control-gear .gear-option_value {
|
|
169
|
+
flex: 1 0 auto;
|
|
174
170
|
}*,
|
|
175
171
|
:focus,
|
|
176
172
|
:visited {
|
|
@@ -234,51 +230,55 @@
|
|
|
234
230
|
}
|
|
235
231
|
.gear-wrapper ul.gear-sub-menu li.current a .check-icon svg {
|
|
236
232
|
display: inline;
|
|
237
|
-
}.
|
|
238
|
-
order: 99;
|
|
239
|
-
}
|
|
240
|
-
.media-control-skin-1 .media-control-item.media-control-gear .gear-wrapper {
|
|
233
|
+
}.big-mute-icon-wrapper[data-big-mute] {
|
|
241
234
|
position: absolute;
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
235
|
+
z-index: 9998;
|
|
236
|
+
background-color: transparent;
|
|
237
|
+
display: flex;
|
|
238
|
+
justify-content: center;
|
|
239
|
+
width: 100%;
|
|
240
|
+
height: calc(100% - 50px);
|
|
241
|
+
margin: 0 auto;
|
|
242
|
+
opacity: 0.75;
|
|
243
|
+
transition: opacity 0.1s ease;
|
|
244
|
+
pointer-events: auto;
|
|
249
245
|
}
|
|
250
|
-
.
|
|
251
|
-
|
|
246
|
+
.big-mute-icon-wrapper[data-big-mute].hide {
|
|
247
|
+
display: none;
|
|
252
248
|
}
|
|
253
|
-
.
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
width: 250px;
|
|
259
|
-
font-size: 12px;
|
|
249
|
+
.big-mute-icon-wrapper[data-big-mute]:hover {
|
|
250
|
+
cursor: pointer;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
.big-mute-icon[data-big-mute-icon] {
|
|
260
254
|
display: flex;
|
|
261
255
|
align-items: center;
|
|
262
|
-
justify-content:
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
256
|
+
justify-content: center;
|
|
257
|
+
align-self: center;
|
|
258
|
+
width: 120px;
|
|
259
|
+
height: 120px;
|
|
260
|
+
border: 2px solid white;
|
|
261
|
+
border-radius: 50%;
|
|
262
|
+
filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=60)";
|
|
263
|
+
filter: alpha(opacity=60);
|
|
264
|
+
opacity: 1;
|
|
265
|
+
box-shadow: 0 0 1px 0 white;
|
|
266
|
+
background: rgba(240, 243, 247, 0.9411764706);
|
|
267
|
+
z-index: 10000;
|
|
268
268
|
}
|
|
269
|
-
.
|
|
270
|
-
|
|
271
|
-
|
|
269
|
+
.big-mute-icon[data-big-mute-icon] svg {
|
|
270
|
+
margin-left: 5px;
|
|
271
|
+
width: 80px;
|
|
272
|
+
height: 80px;
|
|
272
273
|
}
|
|
273
|
-
.
|
|
274
|
-
|
|
274
|
+
.big-mute-icon[data-big-mute-icon] svg path {
|
|
275
|
+
fill: #1f1e1e !important;
|
|
275
276
|
}
|
|
276
|
-
.
|
|
277
|
-
|
|
278
|
-
height: 20px;
|
|
277
|
+
.big-mute-icon[data-big-mute-icon]:hover {
|
|
278
|
+
background: rgba(240, 243, 247, 0.8784313725);
|
|
279
279
|
}
|
|
280
|
-
.
|
|
281
|
-
|
|
280
|
+
.big-mute-icon[data-big-mute-icon]:hover svg path {
|
|
281
|
+
fill: #151515 !important;
|
|
282
282
|
}:root {
|
|
283
283
|
--primary-background-color: #000;
|
|
284
284
|
--secondary-background-color: #262626;
|
|
@@ -643,42 +643,6 @@
|
|
|
643
643
|
.fullscreen .clappr-nerd-stats .stats-box {
|
|
644
644
|
top: unset;
|
|
645
645
|
}
|
|
646
|
-
}.context-menu {
|
|
647
|
-
z-index: 999;
|
|
648
|
-
position: absolute;
|
|
649
|
-
top: 0;
|
|
650
|
-
left: 0;
|
|
651
|
-
text-align: center;
|
|
652
|
-
}
|
|
653
|
-
.context-menu .context-menu-list {
|
|
654
|
-
font-family: "Proxima Nova", sans-serif;
|
|
655
|
-
font-size: 12px;
|
|
656
|
-
line-height: 12px;
|
|
657
|
-
list-style-type: none;
|
|
658
|
-
text-align: left;
|
|
659
|
-
padding: 5px;
|
|
660
|
-
margin-left: auto;
|
|
661
|
-
margin-right: auto;
|
|
662
|
-
background-color: rgba(0, 0, 0, 0.75);
|
|
663
|
-
border: 1px solid #666;
|
|
664
|
-
border-radius: 4px;
|
|
665
|
-
}
|
|
666
|
-
.context-menu .context-menu-list-item button {
|
|
667
|
-
border: none;
|
|
668
|
-
background-color: transparent;
|
|
669
|
-
padding: 0;
|
|
670
|
-
color: white;
|
|
671
|
-
display: flex;
|
|
672
|
-
gap: 8px;
|
|
673
|
-
align-items: center;
|
|
674
|
-
justify-content: center;
|
|
675
|
-
cursor: pointer;
|
|
676
|
-
padding: 5px;
|
|
677
|
-
width: 100%;
|
|
678
|
-
}
|
|
679
|
-
.context-menu .context-menu-list-item_icon {
|
|
680
|
-
width: 20px;
|
|
681
|
-
height: 20px;
|
|
682
646
|
}@charset "UTF-8";
|
|
683
647
|
.gplayer-mc-clips {
|
|
684
648
|
display: flex;
|
|
@@ -759,6 +723,42 @@
|
|
|
759
723
|
.dvr-controls .live-button:hover {
|
|
760
724
|
opacity: 1;
|
|
761
725
|
text-shadow: rgba(255, 255, 255, 0.75) 0 0 5px;
|
|
726
|
+
}.context-menu {
|
|
727
|
+
z-index: 999;
|
|
728
|
+
position: absolute;
|
|
729
|
+
top: 0;
|
|
730
|
+
left: 0;
|
|
731
|
+
text-align: center;
|
|
732
|
+
}
|
|
733
|
+
.context-menu .context-menu-list {
|
|
734
|
+
font-family: "Proxima Nova", sans-serif;
|
|
735
|
+
font-size: 12px;
|
|
736
|
+
line-height: 12px;
|
|
737
|
+
list-style-type: none;
|
|
738
|
+
text-align: left;
|
|
739
|
+
padding: 5px;
|
|
740
|
+
margin-left: auto;
|
|
741
|
+
margin-right: auto;
|
|
742
|
+
background-color: rgba(0, 0, 0, 0.75);
|
|
743
|
+
border: 1px solid #666;
|
|
744
|
+
border-radius: 4px;
|
|
745
|
+
}
|
|
746
|
+
.context-menu .context-menu-list-item button {
|
|
747
|
+
border: none;
|
|
748
|
+
background-color: transparent;
|
|
749
|
+
padding: 0;
|
|
750
|
+
color: white;
|
|
751
|
+
display: flex;
|
|
752
|
+
gap: 8px;
|
|
753
|
+
align-items: center;
|
|
754
|
+
justify-content: center;
|
|
755
|
+
cursor: pointer;
|
|
756
|
+
padding: 5px;
|
|
757
|
+
width: 100%;
|
|
758
|
+
}
|
|
759
|
+
.context-menu .context-menu-list-item_icon {
|
|
760
|
+
width: 20px;
|
|
761
|
+
height: 20px;
|
|
762
762
|
}div.player-error-screen, [data-player] div.player-error-screen {
|
|
763
763
|
color: #CCCACA;
|
|
764
764
|
position: absolute;
|
|
@@ -1680,27 +1680,6 @@ div.player-error-screen__reload, [data-player] div.player-error-screen__reload {
|
|
|
1680
1680
|
display: inline-block;
|
|
1681
1681
|
margin-right: 5px;
|
|
1682
1682
|
cursor: pointer;
|
|
1683
|
-
}.container-with-poster-clickable .mc-skip-time {
|
|
1684
|
-
height: 0;
|
|
1685
|
-
}
|
|
1686
|
-
|
|
1687
|
-
.mc-skip-time {
|
|
1688
|
-
position: absolute;
|
|
1689
|
-
width: 100%;
|
|
1690
|
-
height: calc(100% - 50px);
|
|
1691
|
-
z-index: 9998;
|
|
1692
|
-
background-color: transparent;
|
|
1693
|
-
font-family: Roboto, "Open Sans", Arial, sans-serif;
|
|
1694
|
-
}
|
|
1695
|
-
.mc-skip-time .skip-container {
|
|
1696
|
-
width: 100%;
|
|
1697
|
-
height: 100%;
|
|
1698
|
-
display: flex;
|
|
1699
|
-
justify-content: space-between;
|
|
1700
|
-
}
|
|
1701
|
-
.mc-skip-time .skip-container .skip-item {
|
|
1702
|
-
flex: 1 0 0px;
|
|
1703
|
-
height: 100%;
|
|
1704
1683
|
}.seek-time {
|
|
1705
1684
|
position: absolute;
|
|
1706
1685
|
white-space: nowrap;
|
|
@@ -1772,6 +1751,27 @@ div.player-error-screen__reload, [data-player] div.player-error-screen__reload {
|
|
|
1772
1751
|
40% {
|
|
1773
1752
|
transform: scale(1);
|
|
1774
1753
|
}
|
|
1754
|
+
}.container-with-poster-clickable .mc-skip-time {
|
|
1755
|
+
height: 0;
|
|
1756
|
+
}
|
|
1757
|
+
|
|
1758
|
+
.mc-skip-time {
|
|
1759
|
+
position: absolute;
|
|
1760
|
+
width: 100%;
|
|
1761
|
+
height: calc(100% - 50px);
|
|
1762
|
+
z-index: 9998;
|
|
1763
|
+
background-color: transparent;
|
|
1764
|
+
font-family: Roboto, "Open Sans", Arial, sans-serif;
|
|
1765
|
+
}
|
|
1766
|
+
.mc-skip-time .skip-container {
|
|
1767
|
+
width: 100%;
|
|
1768
|
+
height: 100%;
|
|
1769
|
+
display: flex;
|
|
1770
|
+
justify-content: space-between;
|
|
1771
|
+
}
|
|
1772
|
+
.mc-skip-time .skip-container .skip-item {
|
|
1773
|
+
flex: 1 0 0px;
|
|
1774
|
+
height: 100%;
|
|
1775
1775
|
}.media-control-skin-1 .media-control-cc button.media-control-button {
|
|
1776
1776
|
display: flex;
|
|
1777
1777
|
justify-content: center;
|
|
@@ -1809,6 +1809,16 @@ div.player-error-screen__reload, [data-player] div.player-error-screen__reload {
|
|
|
1809
1809
|
order: 85;
|
|
1810
1810
|
}
|
|
1811
1811
|
|
|
1812
|
+
::cue {
|
|
1813
|
+
visibility: hidden !important;
|
|
1814
|
+
font-size: 0 !important;
|
|
1815
|
+
}
|
|
1816
|
+
|
|
1817
|
+
.ios-fullscreen::cue {
|
|
1818
|
+
visibility: visible !important;
|
|
1819
|
+
font-size: 1em !important;
|
|
1820
|
+
}
|
|
1821
|
+
|
|
1812
1822
|
.container .gplayer-cc-line {
|
|
1813
1823
|
position: absolute;
|
|
1814
1824
|
bottom: calc(var(--bottom-panel) + 5px);
|
package/dist/index.embed.js
CHANGED
|
@@ -13186,6 +13186,13 @@ class DashPlayback extends BasePlayback {
|
|
|
13186
13186
|
this.trigger(Events$1.PLAYBACK_AUDIO_AVAILABLE, tracks.map(toClapprTrack$1));
|
|
13187
13187
|
}
|
|
13188
13188
|
}
|
|
13189
|
+
/**
|
|
13190
|
+
* @override
|
|
13191
|
+
*/
|
|
13192
|
+
_handleTextTrackChange() {
|
|
13193
|
+
super._handleTextTrackChange();
|
|
13194
|
+
this._dash?.setTextTrack(this.closedCaptionsTrackId);
|
|
13195
|
+
}
|
|
13189
13196
|
}
|
|
13190
13197
|
DashPlayback.canPlay = function (resource, mimeType) {
|
|
13191
13198
|
if (!isDashSource(resource, mimeType)) {
|
|
@@ -58395,7 +58402,7 @@ class SourceController extends CorePlugin {
|
|
|
58395
58402
|
}
|
|
58396
58403
|
}
|
|
58397
58404
|
|
|
58398
|
-
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.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}");
|
|
58405
|
+
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}");
|
|
58399
58406
|
|
|
58400
58407
|
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";
|
|
58401
58408
|
|
|
@@ -58491,6 +58498,12 @@ class ClosedCaptions extends UICorePlugin {
|
|
|
58491
58498
|
return (this.core.options.cc?.language ??
|
|
58492
58499
|
this.core.options.subtitles?.language);
|
|
58493
58500
|
}
|
|
58501
|
+
isPreselectedLanguage(language) {
|
|
58502
|
+
if (!this.preselectedLanguage) {
|
|
58503
|
+
return false;
|
|
58504
|
+
}
|
|
58505
|
+
return language.startsWith(this.preselectedLanguage);
|
|
58506
|
+
}
|
|
58494
58507
|
/**
|
|
58495
58508
|
* @internal
|
|
58496
58509
|
*/
|
|
@@ -58517,7 +58530,11 @@ class ClosedCaptions extends UICorePlugin {
|
|
|
58517
58530
|
this.listenTo(this.core.activeContainer, Events$1.CONTAINER_DESTROYED, () => {
|
|
58518
58531
|
this.clickaway(null);
|
|
58519
58532
|
});
|
|
58520
|
-
this.listenTo(
|
|
58533
|
+
// this.listenTo(
|
|
58534
|
+
// this.core.activeContainer,
|
|
58535
|
+
// 'container:advertisement:start',
|
|
58536
|
+
// this.onStartAd,
|
|
58537
|
+
// )
|
|
58521
58538
|
this.listenTo(this.core.activePlayback, Events$1.PLAYBACK_SUBTITLE_AVAILABLE, this.onSubtitleAvailable);
|
|
58522
58539
|
this.listenTo(this.core.activePlayback, Events$1.PLAYBACK_SUBTITLE_CHANGED, this.onSubtitleChanged);
|
|
58523
58540
|
this.listenTo(this.core.activeContainer, Events$1.CONTAINER_CLICK, () => {
|
|
@@ -58537,6 +58554,7 @@ class ClosedCaptions extends UICorePlugin {
|
|
|
58537
58554
|
video.classList.remove('ios-fullscreen');
|
|
58538
58555
|
}
|
|
58539
58556
|
});
|
|
58557
|
+
this.isPreselectedApplied = false;
|
|
58540
58558
|
}
|
|
58541
58559
|
onSubtitleAvailable() {
|
|
58542
58560
|
trace(`${T} onSubtitleAvailable`, {
|
|
@@ -58545,17 +58563,23 @@ class ClosedCaptions extends UICorePlugin {
|
|
|
58545
58563
|
this.applyTracks();
|
|
58546
58564
|
this.mount();
|
|
58547
58565
|
}
|
|
58548
|
-
onSubtitleChanged({ id:
|
|
58566
|
+
onSubtitleChanged({ id: changedId }) {
|
|
58549
58567
|
// ignoring the subtitle selected by the playback engine or user agent
|
|
58550
58568
|
const id = this.track?.id ?? -1;
|
|
58551
58569
|
if (id === -1) {
|
|
58552
58570
|
this.clearSubtitleText();
|
|
58553
58571
|
}
|
|
58572
|
+
this.activateTrack(id);
|
|
58573
|
+
}
|
|
58574
|
+
activateTrack(id) {
|
|
58554
58575
|
for (const track of this.tracks) {
|
|
58555
|
-
// Native subtitles are always hidden
|
|
58556
|
-
track.track.mode = 'hidden';
|
|
58557
58576
|
if (track.id === id) {
|
|
58558
|
-
|
|
58577
|
+
if (this.useNativeSubtitles) {
|
|
58578
|
+
track.track.mode = 'showing';
|
|
58579
|
+
}
|
|
58580
|
+
else {
|
|
58581
|
+
track.track.mode = 'hidden';
|
|
58582
|
+
}
|
|
58559
58583
|
this.setSubtitleText(this.getSubtitleText(track.track));
|
|
58560
58584
|
track.track.oncuechange = (e) => {
|
|
58561
58585
|
try {
|
|
@@ -58573,7 +58597,7 @@ class ClosedCaptions extends UICorePlugin {
|
|
|
58573
58597
|
}
|
|
58574
58598
|
else {
|
|
58575
58599
|
track.track.oncuechange = null;
|
|
58576
|
-
|
|
58600
|
+
track.track.mode = 'disabled';
|
|
58577
58601
|
}
|
|
58578
58602
|
}
|
|
58579
58603
|
}
|
|
@@ -58586,16 +58610,24 @@ class ClosedCaptions extends UICorePlugin {
|
|
|
58586
58610
|
catch (error) {
|
|
58587
58611
|
}
|
|
58588
58612
|
}
|
|
58589
|
-
onStartAd() {
|
|
58590
|
-
|
|
58591
|
-
|
|
58592
|
-
|
|
58593
|
-
|
|
58594
|
-
|
|
58595
|
-
onFinishAd
|
|
58596
|
-
|
|
58597
|
-
|
|
58598
|
-
}
|
|
58613
|
+
// private onStartAd() {
|
|
58614
|
+
// if (this.active && this.core.activeContainer) {
|
|
58615
|
+
// this.hide()
|
|
58616
|
+
// this.listenTo(
|
|
58617
|
+
// this.core.activeContainer,
|
|
58618
|
+
// 'container:advertisement:finish',
|
|
58619
|
+
// this.onFinishAd,
|
|
58620
|
+
// )
|
|
58621
|
+
// }
|
|
58622
|
+
// }
|
|
58623
|
+
// private onFinishAd() {
|
|
58624
|
+
// this.show()
|
|
58625
|
+
// this.stopListening(
|
|
58626
|
+
// this.core.activeContainer,
|
|
58627
|
+
// 'container:advertisement:finish',
|
|
58628
|
+
// this.onFinishAd,
|
|
58629
|
+
// )
|
|
58630
|
+
// }
|
|
58599
58631
|
onContainerResize() {
|
|
58600
58632
|
const shouldShow = this.core.activeContainer &&
|
|
58601
58633
|
isFullscreen(this.core.activeContainer.el) &&
|
|
@@ -58639,7 +58671,7 @@ class ClosedCaptions extends UICorePlugin {
|
|
|
58639
58671
|
isFullscreen(this.core.activeContainer.el) &&
|
|
58640
58672
|
this.track &&
|
|
58641
58673
|
this.track.track.mode &&
|
|
58642
|
-
Browser.isiOS) {
|
|
58674
|
+
(Browser.isiOS || this.useNativeSubtitles)) {
|
|
58643
58675
|
this.$line.hide();
|
|
58644
58676
|
this.track.track.mode = 'showing';
|
|
58645
58677
|
}
|
|
@@ -58686,13 +58718,16 @@ class ClosedCaptions extends UICorePlugin {
|
|
|
58686
58718
|
selectItem(item) {
|
|
58687
58719
|
this.clearSubtitleText();
|
|
58688
58720
|
this.track = item;
|
|
58721
|
+
const trackId = item?.id ?? -1;
|
|
58722
|
+
this.core.activePlayback.closedCaptionsTrackId = trackId;
|
|
58689
58723
|
this.updateSelection();
|
|
58724
|
+
this.activateTrack(trackId);
|
|
58690
58725
|
}
|
|
58691
58726
|
onItemSelect(event) {
|
|
58692
58727
|
// event.target does not exist for some reason in tests
|
|
58693
58728
|
const id = (event.target ?? event.currentTarget).dataset?.item ??
|
|
58694
58729
|
'-1';
|
|
58695
|
-
localStorage.setItem(LOCAL_STORAGE_CC_ID, id); // TODO store language instead
|
|
58730
|
+
localStorage.setItem(LOCAL_STORAGE_CC_ID, id); // TODO store language instead?
|
|
58696
58731
|
this.selectItem(this.findById(Number(id)));
|
|
58697
58732
|
this.hideMenu();
|
|
58698
58733
|
return false;
|
|
@@ -58703,7 +58738,7 @@ class ClosedCaptions extends UICorePlugin {
|
|
|
58703
58738
|
// if the language is undefined, then let the engine decide
|
|
58704
58739
|
// to hide the subtitles forcefully, set the language to 'none'
|
|
58705
58740
|
setTimeout(() => {
|
|
58706
|
-
this.selectItem(this.tracks.find((t) => t.track.language
|
|
58741
|
+
this.selectItem(this.tracks.find((t) => this.isPreselectedLanguage(t.track.language)) ?? null);
|
|
58707
58742
|
}, 0);
|
|
58708
58743
|
}
|
|
58709
58744
|
}
|
|
@@ -58739,10 +58774,10 @@ class ClosedCaptions extends UICorePlugin {
|
|
|
58739
58774
|
return this.$el.find('#gplayer-cc-menu li'); // TODO fix semantically
|
|
58740
58775
|
}
|
|
58741
58776
|
selectSubtitles() {
|
|
58742
|
-
this.track ? this.track.id : -1;
|
|
58777
|
+
const trackId = this.track ? this.track.id : -1;
|
|
58743
58778
|
// TODO find out if this is needed
|
|
58744
|
-
|
|
58745
|
-
this.core.activePlayback.closedCaptionsTrackId = -1
|
|
58779
|
+
this.core.activePlayback.closedCaptionsTrackId = trackId;
|
|
58780
|
+
// this.core.activePlayback.closedCaptionsTrackId = -1
|
|
58746
58781
|
}
|
|
58747
58782
|
getSubtitleText(track) {
|
|
58748
58783
|
const currentTime = this.core.activePlayback?.getCurrentTime() ?? 0;
|
|
@@ -58804,6 +58839,14 @@ class ClosedCaptions extends UICorePlugin {
|
|
|
58804
58839
|
mediaControl.slot('cc', this.$el);
|
|
58805
58840
|
}
|
|
58806
58841
|
}
|
|
58842
|
+
get useNativeSubtitles() {
|
|
58843
|
+
if (this.core.activePlayback?.name === 'dash') {
|
|
58844
|
+
return true;
|
|
58845
|
+
}
|
|
58846
|
+
const mode = this.core.options.cc?.mode ?? this.core.options.subtitles?.mode ?? 'custom';
|
|
58847
|
+
// TODO or Safari? or iOS?
|
|
58848
|
+
return mode === 'native';
|
|
58849
|
+
}
|
|
58807
58850
|
clickaway = mediaControlClickaway(() => this.hideMenu());
|
|
58808
58851
|
}
|
|
58809
58852
|
|