File tree Expand file tree Collapse file tree 1 file changed +12
-7
lines changed
src/renderer/components/ft-video-player Expand file tree Collapse file tree 1 file changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -1410,6 +1410,14 @@ export default defineComponent({
1410
1410
const trackIndex = this . useDash ? 1 : 0
1411
1411
1412
1412
const tracks = this . player . textTracks ( )
1413
+
1414
+ // visually and semantically disable any other enabled tracks
1415
+ for ( let i = 0 ; i < tracks . length ; ++ i ) {
1416
+ if ( i !== trackIndex && tracks [ i ] . mode === 'showing' ) {
1417
+ tracks [ i ] . mode = 'disabled'
1418
+ }
1419
+ }
1420
+
1413
1421
if ( tracks . length > trackIndex ) {
1414
1422
if ( tracks [ trackIndex ] . mode === 'showing' ) {
1415
1423
tracks [ trackIndex ] . mode = 'disabled'
@@ -1868,19 +1876,16 @@ export default defineComponent({
1868
1876
captionList = this . captionHybridList
1869
1877
}
1870
1878
1871
- for ( const caption of this . sortCaptions ( captionList ) ) {
1879
+ this . sortCaptions ( captionList ) . forEach ( ( caption , i ) =>
1872
1880
this . player . addRemoteTextTrack ( {
1873
1881
kind : 'subtitles' ,
1874
1882
src : caption . url ,
1875
1883
srclang : caption . language_code ,
1876
1884
label : caption . label ,
1877
- type : caption . type
1885
+ type : caption . type ,
1886
+ default : i === 0 && this . enableSubtitlesByDefault
1878
1887
} , true )
1879
- }
1880
-
1881
- if ( this . enableSubtitlesByDefault ) {
1882
- this . toggleCaptions ( )
1883
- }
1888
+ )
1884
1889
} ,
1885
1890
1886
1891
toggleFullWindow : function ( ) {
You can’t perform that action at this time.
0 commit comments