@@ -36,21 +36,10 @@ const getSourceOptions = (sourceOptions = {}) => ({
3636 sourceTitle : ( typeof sourceOptions . title === 'string' ? sourceOptions . title : sourceOptions . info ?. title ) ,
3737 sourceDescription : ( typeof sourceOptions . description === 'string' ? sourceOptions . description : sourceOptions . info ?. subtitle || sourceOptions . info ?. description )
3838 } : { } ) ,
39- ...( sourceOptions . textTracks ? {
40- ...( hasConfig ( sourceOptions . textTracks ) && getTranscriptOptions ( sourceOptions . textTracks ) ) ,
41- ...( sourceOptions . textTracks . options ? {
42- styledTextTracksTheme : sourceOptions . textTracks . options . theme ,
43- styledTextTracksFont : sourceOptions . textTracks . options . fontFace ,
44- styledTextTracksFontSize : sourceOptions . textTracks . options . fontSize ,
45- styledTextTracksGravity : sourceOptions . textTracks . options . gravity ,
46- styledTextTracksBox : hasConfig ( sourceOptions . textTracks . options . box ) ,
47- styledTextTracksStyle : hasConfig ( sourceOptions . textTracks . options . style ) ,
48- styledTextTracksWordHighlightStyle : hasConfig ( sourceOptions . textTracks . options . wordHighlightStyle )
49- } : { } )
50- } : { } )
39+ ...( hasConfig ( sourceOptions . textTracks ) ? getTextTracksOptions ( sourceOptions . textTracks ) : { } )
5140} ) ;
5241
53- const getTranscriptOptions = ( textTracks = { } ) => {
42+ const getTextTracksOptions = ( textTracks = { } ) => {
5443 const tracksArr = [ textTracks . captions , ...( textTracks . subtitles || [ ] ) ] ;
5544 return {
5645 textTracks : hasConfig ( textTracks ) ,
@@ -62,7 +51,16 @@ const getTranscriptOptions = (textTracks = {}) => {
6251 transcriptAutoLoaded : tracksArr . some ( ( track ) => ! track . url ) || null ,
6352 transcriptFromURl : tracksArr . some ( ( track ) => track . url ?. endsWith ( '.transcript' ) ) || null ,
6453 vttFromUrl : tracksArr . some ( ( track ) => track . url ?. endsWith ( '.vtt' ) ) || null ,
65- srtFromUrl : tracksArr . some ( ( track ) => track . url ?. endsWith ( '.srt' ) ) || null
54+ srtFromUrl : tracksArr . some ( ( track ) => track . url ?. endsWith ( '.srt' ) ) || null ,
55+ ...( textTracks . options ? {
56+ styledTextTracksTheme : textTracks . options . theme ,
57+ styledTextTracksFont : textTracks . options . fontFace ,
58+ styledTextTracksFontSize : textTracks . options . fontSize ,
59+ styledTextTracksGravity : textTracks . options . gravity ,
60+ styledTextTracksBox : hasConfig ( textTracks . options . box ) ,
61+ styledTextTracksStyle : hasConfig ( textTracks . options . style ) ,
62+ styledTextTracksWordHighlightStyle : hasConfig ( textTracks . options . wordHighlightStyle )
63+ } : { } )
6664 } ;
6765} ;
6866
0 commit comments