Skip to content

Commit ec1bc7e

Browse files
committed
Fix playerState
JFVideo updates playerState for captionTask Moved pkg:/fonts to pkg:/components/fonts
1 parent 0bee595 commit ec1bc7e

File tree

6 files changed

+14
-9
lines changed

6 files changed

+14
-9
lines changed

components/JFVideo.brs

+1
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ end sub
131131
'
132132
' When Video Player state changes
133133
sub onState(msg)
134+
m.captionTask.playerState = m.top.state
134135
' When buffering, start timer to monitor buffering process
135136
if m.top.state = "buffering" and m.bufferCheckTimer <> invalid
136137

components/JFVideo.xml

+11-7
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?xml version="1.0" encoding="utf-8" ?>
1+
<?xml version="1.0" encoding="utf-8"?>
22
<component name="JFVideo" extends="Video">
33
<interface>
44
<field id="backPressed" type="boolean" alwaysNotify="true" />
@@ -33,16 +33,20 @@
3333

3434
<children>
3535

36-
<LayoutGroup horizAlignment = "center" vertAlignment = "center" translation="[960,980]">
37-
<Rectangle id = "captionBG" color = "#323232BF" height = "0" width="0"/>
38-
</LayoutGroup>
39-
<LayoutGroup id="captionGroup" horizAlignment = "center" vertAlignment = "center" translation="[960,980]">
40-
36+
<LayoutGroup horizAlignment="center" vertAlignment="center" translation="[960,980]">
37+
<Rectangle id="captionBG" color="#323232BF" height="0" width="0" />
4138
</LayoutGroup>
39+
<LayoutGroup id="captionGroup" horizAlignment="center" vertAlignment="center" translation="[960,980]"></LayoutGroup>
4240

4341
<timer id="playbackTimer" repeat="true" duration="30" />
4442
<timer id="bufferCheckTimer" repeat="true" />
45-
<JFButton id="nextEpisode" opacity="0" textColor="#f0f0f0" focusedTextColor="#202020" focusFootprintBitmapUri="pkg:/images/option-menu-bg.9.png" focusBitmapUri="pkg:/images/white.9.png" translation="[1500, 900]" />
43+
<JFButton id="nextEpisode"
44+
opacity="0"
45+
textColor="#f0f0f0"
46+
focusedTextColor="#202020"
47+
focusFootprintBitmapUri="pkg:/images/option-menu-bg.9.png"
48+
focusBitmapUri="pkg:/images/white.9.png"
49+
translation="[1500, 900]" />
4650

4751
<!--animation for the play next episode button-->
4852
<Animation id="showNextEpisodeButton" duration="1.0" repeat="false" easeFunction="inQuad">

components/captionTask.brs

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,9 @@ sub init()
1010
m.reader = createObject("roUrlTransfer")
1111

1212
m.font = CreateObject("roSGNode", "Font")
13-
m.font.uri = "pkg:/fonts/noto.otf"
13+
m.font.uri = "pkg:/components/fonts/noto.otf"
1414
m.font.size = 50
15+
' m.font = "font:LargeSystemFont"
1516
end sub
1617

1718
sub fetchCaption()

components/fonts/noto.otf

4.52 MB
Binary file not shown.

components/fonts/notoB.otf

4.68 MB
Binary file not shown.

source/utils/Subtitles.brs

-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@ function setupSubtitle(video, subtitles, subtitle_idx = -1) as integer
9292
else
9393
' If this is a text-based subtitle, set relevant settings for roku captions
9494
video.captionVisible = True
95-
9695
video.subtitleTrack = video.availableSubtitleTracks[availSubtitleTrackIdx(video, subtitleSelIdx)].TrackName
9796
end if
9897

0 commit comments

Comments
 (0)