Skip to content

Commit

Permalink
Fix playerState
Browse files Browse the repository at this point in the history
JFVideo updates playerState for captionTask

Moved pkg:/fonts to pkg:/components/fonts
  • Loading branch information
jkim2492 committed Jan 27, 2023
1 parent 0bee595 commit ec1bc7e
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 9 deletions.
1 change: 1 addition & 0 deletions components/JFVideo.brs
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ end sub
'
' When Video Player state changes
sub onState(msg)
m.captionTask.playerState = m.top.state
' When buffering, start timer to monitor buffering process
if m.top.state = "buffering" and m.bufferCheckTimer <> invalid

Expand Down
18 changes: 11 additions & 7 deletions components/JFVideo.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8" ?>
<?xml version="1.0" encoding="utf-8"?>
<component name="JFVideo" extends="Video">
<interface>
<field id="backPressed" type="boolean" alwaysNotify="true" />
Expand Down Expand Up @@ -33,16 +33,20 @@

<children>

<LayoutGroup horizAlignment = "center" vertAlignment = "center" translation="[960,980]">
<Rectangle id = "captionBG" color = "#323232BF" height = "0" width="0"/>
</LayoutGroup>
<LayoutGroup id="captionGroup" horizAlignment = "center" vertAlignment = "center" translation="[960,980]">

<LayoutGroup horizAlignment="center" vertAlignment="center" translation="[960,980]">
<Rectangle id="captionBG" color="#323232BF" height="0" width="0" />
</LayoutGroup>
<LayoutGroup id="captionGroup" horizAlignment="center" vertAlignment="center" translation="[960,980]"></LayoutGroup>

<timer id="playbackTimer" repeat="true" duration="30" />
<timer id="bufferCheckTimer" repeat="true" />
<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]" />
<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]" />

<!--animation for the play next episode button-->
<Animation id="showNextEpisodeButton" duration="1.0" repeat="false" easeFunction="inQuad">
Expand Down
3 changes: 2 additions & 1 deletion components/captionTask.brs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ sub init()
m.reader = createObject("roUrlTransfer")

m.font = CreateObject("roSGNode", "Font")
m.font.uri = "pkg:/fonts/noto.otf"
m.font.uri = "pkg:/components/fonts/noto.otf"
m.font.size = 50
' m.font = "font:LargeSystemFont"
end sub

sub fetchCaption()
Expand Down
Binary file added components/fonts/noto.otf
Binary file not shown.
Binary file added components/fonts/notoB.otf
Binary file not shown.
1 change: 0 additions & 1 deletion source/utils/Subtitles.brs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ function setupSubtitle(video, subtitles, subtitle_idx = -1) as integer
else
' If this is a text-based subtitle, set relevant settings for roku captions
video.captionVisible = True

video.subtitleTrack = video.availableSubtitleTracks[availSubtitleTrackIdx(video, subtitleSelIdx)].TrackName
end if

Expand Down

0 comments on commit ec1bc7e

Please sign in to comment.