File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -7,21 +7,27 @@ if ( ableplayer.settings.replace_audio === 'true' ) {
77}
88if ( 0 !== ableplayer_selectors . length ) {
99 const mediaEls = document . querySelectorAll ( ableplayer_selectors ) ;
10+ let childTracks ;
1011 if ( mediaEls ) {
1112 mediaEls . forEach ( ( el , index , listObj ) => {
1213 let excludeClass = ableplayer . settings . exclude_class ;
1314 if ( excludeClass !== '' && el . classList . contains ( excludeClass ) || el . closest ( 'figure' ) . classList . contains ( excludeClass ) ) {
1415 el . classList . add ( 'ableplayer-skipped' ) ;
1516 } else {
1617 el . removeAttribute ( 'controls' ) ;
17-
1818 if ( ! el . hasAttribute ( 'data-able-player' ) ) {
1919 el . setAttribute ( 'data-able-player' , 'true' ) ;
2020 }
2121 if ( ! el . hasAttribute ( 'id' ) ) {
2222 el . setAttribute ( 'id' , 'able-player-id-' + index ) ;
2323 }
2424 }
25+ childTracks = el . querySelectorAll ( 'track' ) ;
26+ childTracks . forEach ( ( track , index , listObj ) => {
27+ if ( ! track . hasAttribute ( 'kind' ) ) {
28+ track . setAttribute ( 'kind' , 'subtitles' ) ;
29+ }
30+ } ) ;
2531 } ) ;
2632 }
2733}
You can’t perform that action at this time.
0 commit comments