From 6e5e14444e5f20e528d63d1b2d35642f14a115ca Mon Sep 17 00:00:00 2001 From: Jinho Kim <54465744+jkim2492@users.noreply.github.com> Date: Sun, 5 Feb 2023 03:07:01 -0500 Subject: [PATCH] Optimize parseVTT Change back to gettofile Fix default font in captionTask Update captionTask.brs --- components/JFVideo.brs | 7 +-- components/JFVideo.xml | 1 + components/captionTask.brs | 88 +++++++++++++++++++------------------- components/captionTask.xml | 1 + source/Main.brs | 3 +- 5 files changed, 51 insertions(+), 49 deletions(-) diff --git a/components/JFVideo.brs b/components/JFVideo.brs index 3fbedc4f..aaab4860 100644 --- a/components/JFVideo.brs +++ b/components/JFVideo.brs @@ -35,14 +35,16 @@ sub init() m.captionGroup.createchildren(9, "LayoutGroup") m.captionTask = createObject("roSGNode", "captionTask") m.captionTask.observeField("currentCaption", "updateCaption") + m.captionTask.observeField("useThis", "checkCaptionMode") m.top.observeField("currentSubtitleTrack", "loadCaption") m.top.observeField("globalCaptionMode", "toggleCaption") m.top.suppressCaptions = True toggleCaption() + end sub - sub loadCaption() + m.top.suppressCaptions = m.captionTask.useThis m.captionTask.url = m.top.currentSubtitleTrack end sub @@ -124,7 +126,7 @@ end sub ' When Video Player state changes sub onPositionChanged() - m.captionTask.currentPos = Cint(m.top.position * 1000) + m.captionTask.currentPos = Int(m.top.position * 1000) m.dialog = m.top.getScene().findNode("dialogBackground") if not isValid(m.dialog) checkTimeToDisplayNextEpisode() @@ -134,7 +136,6 @@ end sub ' ' When Video Player state changes sub onState(msg) - m.captionTask.playerState = m.top.state + m.top.globalCaptionMode ' When buffering, start timer to monitor buffering process if m.top.state = "buffering" and m.bufferCheckTimer <> invalid diff --git a/components/JFVideo.xml b/components/JFVideo.xml index 0089f053..fa338b28 100644 --- a/components/JFVideo.xml +++ b/components/JFVideo.xml @@ -23,6 +23,7 @@ +