* Move src under playlet-lib * Update configuration * Update script * Update script * Working version * Vs code config WIP * Package lock sync * Lint fix * Fix images * Reuse config files * Kind of a working setup * Lock node version * Rename scripts to tools * Fix build scripts, lib url system * Lint fix * rale * Fix args and web server * Load fallbacks and build script cleanups * Remove unused method * no message * no message * Remove generic message field * Lint fix * no message * Use loading indicator on main app * Add playlet lib version to settings --------- Co-authored-by: github-action linter <githubaction@githubaction.com>
25 lines
814 B
Plaintext
25 lines
814 B
Plaintext
function SetCaptions(metadata as object, videoPlayer as object, contentNode as object) as void
|
|
' TODO: check if we have caption settings ON
|
|
' TODO: read favorate language from system settings
|
|
' TODO: populate list of caption tracks
|
|
if metadata.captions.Count() = 0
|
|
return
|
|
end if
|
|
videoPlayer.globalCaptionMode = "ON"
|
|
contentNode.ClosedCaptions = True
|
|
selectedCaption = metadata.captions[0]
|
|
|
|
' Use favorite caption langauage, or the first one
|
|
for each caption in metadata.captions
|
|
if caption.language_code = "en"
|
|
selectedCaption = caption
|
|
exit for
|
|
end if
|
|
end for
|
|
|
|
contentNode.SubtitleConfig = {
|
|
ShowSubtitle: 1,
|
|
TrackName: InvidiousSettings.GetSelectedInstance() + selectedCaption.url
|
|
}
|
|
end function
|