Skip to content

Commit 74e8d8b

Browse files
authored
Merge pull request #425 from 1hitsong/closeSkipOutro
Hide Skip Outro if back button pressed. Reset if user seeks video
2 parents 3d65783 + d8cbbe2 commit 74e8d8b

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

components/video/VideoPlayerView.bs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ sub init()
9191

9292
'Play Next Episode button
9393
m.nextupbuttonseconds = m.global.session.user.settings["playback.nextupbuttonseconds"].ToInt()
94+
m.originalNextupbuttonseconds = m.nextupbuttonseconds
9495

9596
m.checkedForNextEpisode = false
9697
m.getNextEpisodeTask = createObject("roSGNode", "GetNextEpisodeTask")
@@ -680,6 +681,7 @@ sub onNextEpisodeDataLoaded()
680681
' If there is no next episode, disable next episode button
681682
if m.getNextEpisodeTask.nextEpisodeData.Items.count() <> 2
682683
m.nextupbuttonseconds = 0
684+
m.originalNextupbuttonseconds = 0
683685
end if
684686
end sub
685687

@@ -710,7 +712,7 @@ sub displaySegmentSkipButton(segmentType as string, endticks as double)
710712
end if
711713

712714
' Check if button is already showing
713-
if isStringEqual(m.skipSegmentButton.text, `Skip ${segmentType}`) then return
715+
if isStringEqual(m.skipSegmentButton.text, `${tr("Skip")} ${segmentType}`) then return
714716

715717
if m.osd.visible then return ' Don't show if OSD is visible
716718

@@ -908,6 +910,8 @@ function getRemainingTime(videoSeekPosition = 0 as integer)
908910
end function
909911

910912
sub onTrickPlayBarTextChange()
913+
m.nextupbuttonseconds = m.originalNextupbuttonseconds
914+
911915
if not m.top.trickPlayBar.visible then return
912916

913917
setVideoEndingTime(0)
@@ -1207,6 +1211,15 @@ function onKeyEvent(key as string, press as boolean) as boolean
12071211
end if
12081212

12091213
if key = KeyCode.BACK
1214+
' If user presses back when Skip Outro button is showing, hide button and disable it so it doesn't show again
1215+
if m.skipSegmentButton.visible
1216+
if isStringEqual(m.skipSegmentButton.text, `${tr("Skip")} ${MediaSegmentType.OUTRO}`)
1217+
m.nextupbuttonseconds = 0
1218+
hideSegmentSkipButton()
1219+
return true
1220+
end if
1221+
end if
1222+
12101223
m.PreloadTrickplayImagesTask.method = "REMOVE"
12111224
m.PreloadTrickplayImagesTask.control = TaskControl.RUN
12121225

source/static/whatsNew/3.0.6.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,5 +50,9 @@
5050
{
5151
"description": "Increase shown buttons on detail screen from 5 to 6",
5252
"author": "1hitsong"
53+
},
54+
{
55+
"description": "Hide Skip Outro if back button pressed. Reset if user seeks video",
56+
"author": "1hitsong"
5357
}
5458
]

0 commit comments

Comments
 (0)