Remove IntroSkipper support

This commit is contained in:
1hitsong 2022-09-14 19:34:29 -04:00
parent d88ccdfa6e
commit d3bfaaaec9
4 changed files with 1 additions and 147 deletions

View File

@ -2,8 +2,6 @@ sub init()
m.playbackTimer = m.top.findNode("playbackTimer")
m.bufferCheckTimer = m.top.findNode("bufferCheckTimer")
m.top.observeField("state", "onState")
m.top.observeField("position", "onPositionChanged")
m.top.trickPlayBar.observeField("visible", "onTrickPlayBarVisibilityChange")
m.playbackTimer.observeField("fire", "ReportPlayback")
m.bufferPercentage = 0 ' Track whether content is being loaded
m.playReported = false
@ -14,112 +12,6 @@ sub init()
clockNode = findNodeBySubtype(m.top, "clock")
if clockNode[0] <> invalid then clockNode[0].parent.removeChild(clockNode[0].node)
end if
' Skip Intro Button
m.skipIntroButton = m.top.findNode("skipIntro")
m.skipIntroButton.text = tr("Skip Intro")
m.introCompleted = false
m.showskipIntroButtonAnimation = m.top.findNode("showskipIntroButton")
m.hideskipIntroButtonAnimation = m.top.findNode("hideskipIntroButton")
m.moveUpskipIntroButtonAnimation = m.top.findNode("moveUpskipIntroButton")
m.moveDownskipIntroButtonAnimation = m.top.findNode("moveDownskipIntroButton")
end sub
'
' Checks if we have valid skip intro param data
function haveSkipIntroParams() as boolean
' Intro data is invalid, skip
if not isValid(m.top.skipIntroParams?.Valid)
return false
end if
' Returned intro data is not valid, return
if not m.top.skipIntroParams.Valid
return false
end if
return true
end function
'
' Handles showing / hiding the skip intro button
sub handleSkipIntro()
' We've already shown the intro, return
if m.introCompleted then return
' We don't have valid data, return
if not haveSkipIntroParams() then return
' Check if it's time to hide the skip prompt
if m.top.position >= m.top.skipIntroParams.HideSkipPromptAt
if skipIntroButtonVisible()
hideSkipIntro()
end if
return
end if
' Check if it's time to show the skip prompt
if m.top.position >= m.top.skipIntroParams.ShowSkipPromptAt
if not skipIntroButtonVisible()
showSkipIntro()
end if
return
end if
end sub
'
' When Trick Playbar Visibility changes
sub onTrickPlayBarVisibilityChange()
' Skip Intro button isn't visible, return
if not skipIntroButtonVisible() then return
' Trick Playbar is visible, move the skip intro button up and fade it out
if m.top.trickPlayBar.visible
m.moveUpskipIntroButtonAnimation.control = "start"
m.skipIntroButton.setFocus(false)
m.top.setFocus(true)
return
end if
' Trick Playbar is not visible, move the skip intro button down and fade it in
m.moveDownskipIntroButtonAnimation.control = "start"
m.skipIntroButton.setFocus(true)
end sub
'
' When Video Player state changes
sub onPositionChanged()
' Check if content is episode
if m.top.content.contenttype = 4
handleSkipIntro()
end if
end sub
'
' Returns if skip intro button is currently visible
function skipIntroButtonVisible() as boolean
return m.skipIntroButton.opacity > 0
end function
'
' Runs skip intro button animation and sets focus to button
sub showSkipIntro()
m.showskipIntroButtonAnimation.control = "start"
m.skipIntroButton.setFocus(true)
end sub
'
' Runs hide intro button animation and sets focus back to video
sub hideSkipIntro()
m.top.trickPlayBar.unobserveField("visible")
m.hideskipIntroButtonAnimation.control = "start"
m.introCompleted = true
m.skipIntroButton.setFocus(false)
m.top.setFocus(true)
end sub
'
@ -237,16 +129,6 @@ end sub
function onKeyEvent(key as string, press as boolean) as boolean
if key = "OK"
if not m.top.trickPlayBar.visible
if m.skipIntroButton.hasFocus()
m.top.seek = m.top.skipIntroParams.IntroEnd
hideSkipIntro()
return true
end if
end if
end if
if not press then return false
if m.top.Subtitles.count() and key = "down"

View File

@ -17,35 +17,16 @@
<field id="retryWithTranscoding" type="boolean" value="false" />
<field id="isTranscoded" type="boolean" />
<field id="transcodeReasons" type="array" />
<field id="videoId" type="string" />
<field id="mediaSourceId" type="string" />
<field id="audioIndex" type="integer" />
<field id="skipIntroParams" type="assocarray" />
</interface>
<script type="text/brightscript" uri="JFVideo.brs" />
<script type="text/brightscript" uri="pkg:/source/utils/misc.brs" />
<script type="text/brightscript" uri="pkg:/source/utils/config.brs" />
<children>
<JFButton id="skipIntro" opacity="0" textColor="#f0f0f0" focusedTextColor="#202020" focusFootprintBitmapUri="pkg:/images/option-menu-bg.9.png" focusBitmapUri="pkg:/images/white.9.png" translation="[1575, 900]" />
<timer id="playbackTimer" repeat="true" duration="30" />
<timer id="bufferCheckTimer" repeat="true" />
<Animation id="moveUpskipIntroButton" duration=".1" repeat="false" easeFunction="linear">
<Vector2DFieldInterpolator key="[0.0,1.0]" keyValue="[[1575, 900], [1575, 825]]" fieldToInterp="skipIntro.translation"/>
<FloatFieldInterpolator key="[0.0, 1.0]" keyValue="[.9, .1]" fieldToInterp="skipIntro.opacity" />
</Animation>
<Animation id="moveDownskipIntroButton" duration=".1" repeat="false" easeFunction="linear">
<Vector2DFieldInterpolator key="[0.0,1.0]" keyValue="[[1575, 825], [1575, 900]]" fieldToInterp="skipIntro.translation"/>
<FloatFieldInterpolator key="[0.0, 1.0]" keyValue="[.1, .9]" fieldToInterp="skipIntro.opacity" />
</Animation>
<Animation id="showskipIntroButton" duration="1.0" repeat="false" easeFunction="inQuad">
<FloatFieldInterpolator key="[0.0, 1.0]" keyValue="[0.0, .9]" fieldToInterp="skipIntro.opacity" />
</Animation>
<Animation id="hideskipIntroButton" duration=".2" repeat="false" easeFunction="inQuad">
<FloatFieldInterpolator key="[0.0, 1.0]" keyValue="[.9, 0]" fieldToInterp="skipIntro.opacity" />
</Animation>
</children>
</component>

View File

@ -707,10 +707,6 @@
<translation>Hides all clocks in Jellyfin. Jellyfin will need to be closed and reopened for change to take effect.</translation>
<extracomment>Settings Menu - Description for option</extracomment>
</message>
<message>
<source>Skip Intro</source>
<translation>Skip Intro</translation>
</message>
<message>
<source>Play Trailer</source>
<translation>Play Trailer</translation>

View File

@ -45,11 +45,6 @@ sub AddVideoContent(video, mediaSourceId, audio_stream_idx = 1, subtitle_idx = -
end if
end if
if m.videotype = "Episode" or m.videotype = "Series"
video.skipIntroParams = api_API().introskipper.get(video.id)
video.content.contenttype = "episode"
end if
video.content.title = meta.title
video.showID = meta.showID