Dev player rewrite (#883)
This commit is contained in:
1 parent
8c11272b92
commit
1ba454cdab
80 files changed
+8405
-921
No files matched your search
@@ -1,152 +1,123 @@
|
||||
<!--
|
||||
VideoPlayerDev is the player that will eventually be used in the Playlet app.
|
||||
It extends the Video component, and will be fully managing the UI, progress,
|
||||
buffering, and any state of the video playback.
|
||||
This would allow us to be flexible with the UI beyond the customizations
|
||||
of the stock Roku Video component.
|
||||
-->
|
||||
<component name="VideoPlayerDev" extends="Video" includes="AutoBind,Disposable">
|
||||
<component name="VideoPlayerDev" extends="Video" includes="AutoBind">
|
||||
<!-- Thin coordinator. extends Video with enableUI=false so the OS draws no chrome; this owns only the
|
||||
focused Video node + key router, the Chrome-group fade, PiP resize, and lifecycle plumbing.
|
||||
|
||||
The transport brain is a plain .bs module (TransportController) held in m.transport — not a node, so
|
||||
no field copy / no callFunc across a node boundary. The renderers (TrickPlayBar/BifDisplay/LargePause/
|
||||
LoadBufferSpinner) are SceneGraph components fed scalar int-enum/number fields after every transport
|
||||
interaction (ApplyTransport), never callFunc.
|
||||
|
||||
Z-order inside Chrome (later siblings paint on top): PauseGradient, then BifDisplay (its full-screen
|
||||
black backdrop must sit under everything else), then the title/clock group, then TrickPlayBar (so the
|
||||
bar + scan-glyph paint in front of the bif), then LoadBufferSpinner.
|
||||
LargePause is outside Chrome (pause-gated, not chrome-gated). The title/clock group holds the title +
|
||||
secondary-title labels and the shared Clock component (self-ticks once a minute, no coordinator gating). -->
|
||||
<interface>
|
||||
<!-- Bound services / container, resolved by AutoBind -> OnNodeReady. -->
|
||||
<field id="appController" type="node" bind="/AppController" />
|
||||
<field id="jobQueue" type="node" bind="/JobQueue" />
|
||||
<field id="container" type="node" bind=".." />
|
||||
<field id="notifications" type="node" bind="../../Notifications" />
|
||||
<field id="videoQueue" type="node" bind="../../VideoQueue" />
|
||||
<field id="preferences" type="node" bind="../../Preferences" />
|
||||
<field id="innertube" type="node" bind="../../Innertube" />
|
||||
<field id="invidious" type="node" bind="../../Invidious" />
|
||||
<field id="webServer" type="node" bind="../../WebServer" />
|
||||
<field id="loungeService" type="node" bind="../../LoungeService" />
|
||||
<field id="previousPlayer" type="node" />
|
||||
<!-- PiP rects: minRect/maxRect drive width/height/translation. -->
|
||||
<field id="minRect" type="rect2D" value="[834,460,426,240]" />
|
||||
<field id="maxRect" type="rect2D" value="[0,0,1280,720]" />
|
||||
<field id="close" type="boolean" alwaysNotify="true" onChange="OnClose" />
|
||||
<field id="minimizeState" type="integer" />
|
||||
<field id="playerUiState" type="integer" />
|
||||
<field id="close" type="boolean" alwaysNotify="true" />
|
||||
<function name="PlayWithContent" />
|
||||
</interface>
|
||||
<!-- Init() lives in its own file so VideoPlayerDev.bs (the coordinator logic) has no Init and is importable by
|
||||
the test mock; the @oninit/AutoBind injection needs Init in exactly one component scope. -->
|
||||
<script type="text/brightscript" uri="pkg:/components/VideoPlayerDev/VideoPlayerDevInit.bs" />
|
||||
<children>
|
||||
<!-- bs:disable-next-line LOCALE_MISSING_TRANSLATIONS -->
|
||||
<SimpleLabel text="Dev Player!"
|
||||
color="#FF0000"
|
||||
fontUri="font:SmallestBoldSystemFont"
|
||||
horizOrigin="right"
|
||||
translation="[1280,0]" />
|
||||
<!-- ===================== coordinator-owned timers ===================== -->
|
||||
<!-- Chrome auto-hide: only fires when transportMode=idle. -->
|
||||
<Timer id="autoHide" duration="5" repeat="false" />
|
||||
<!-- The one transport timer, (re)armed/stopped from TransportController.TakeTimerCmd; scrubRepeat / scan /
|
||||
liveEdgeTick all reuse this node, with the brain owning the schedule as data. -->
|
||||
<Timer id="transportTimer" duration="0.6" repeat="false" />
|
||||
<!-- Live badge hold: a live reveal forces "● LIVE", then this fires to release it so the bar swaps to the
|
||||
offset M:SS when behind the edge. -->
|
||||
<Timer id="liveBadgeHold" duration="1.6" repeat="false" />
|
||||
<!-- PiP fullScreenHint: 1s after a shrink to reveal the hint, then 5s to auto-hide (re-armed per phase). -->
|
||||
<Timer id="fullScreenHintTimer" duration="1" repeat="false" />
|
||||
<!-- Live edge heartbeat: 1/s while live content plays; feeds the brain's clock-anchored edge so the
|
||||
time-behind offset stays current even while the device is paused and emits no events. -->
|
||||
<Timer id="liveEdgeClock" duration="1" repeat="true" />
|
||||
|
||||
<Group id="VideoUi">
|
||||
<Poster
|
||||
id="BackgroundPosterSmall"
|
||||
width="1280"
|
||||
height="720"
|
||||
blendColor="0x323232" />
|
||||
<Poster
|
||||
id="BackgroundPoster"
|
||||
width="1280"
|
||||
height="720"
|
||||
blendColor="0x323232" />
|
||||
<Group id="TopUi">
|
||||
<Poster
|
||||
uri="pkg:/images/black-gradient.png"
|
||||
opacity="0.8"
|
||||
width="1280"
|
||||
height="240"
|
||||
scaleRotateCenter="[640,120]"
|
||||
rotation="3.14159265359" />
|
||||
<!--
|
||||
TODO:P2 once VideoPlayerDev replaces VideoPlayer, the clock can
|
||||
be removed to reuse the Clock from MainScene
|
||||
-->
|
||||
<Clock id="Clock" />
|
||||
<LayoutGroup
|
||||
itemSpacings="[5]"
|
||||
translation="[68,40]">
|
||||
<Label
|
||||
id="TitleLabel"
|
||||
font="font:LargeBoldSystemFont"
|
||||
width="900"
|
||||
wrap="true" />
|
||||
<Label
|
||||
id="SecondaryTitleLabel"
|
||||
font="font:SmallestSystemFont"
|
||||
width="900"
|
||||
wrap="true" />
|
||||
</LayoutGroup>
|
||||
</Group>
|
||||
<Poster
|
||||
uri="pkg:/images/black-gradient.png"
|
||||
opacity="0.8"
|
||||
width="1280"
|
||||
height="360"
|
||||
translation="[0,360]" />
|
||||
<!-- ===================== coordinator-owned animations ===================== -->
|
||||
<Animation id="chromeFadeIn" duration="0.5" easeFunction="linear">
|
||||
<FloatFieldInterpolator id="chromeFadeInInterp" key="[0.0, 1.0]" keyValue="[0.0, 1.0]" fieldToInterp="Chrome.opacity" />
|
||||
</Animation>
|
||||
<Animation id="chromeFadeOut" duration="0.3" easeFunction="linear">
|
||||
<FloatFieldInterpolator id="chromeFadeOutInterp" key="[0.0, 1.0]" keyValue="[1.0, 0.0]" fieldToInterp="Chrome.opacity" />
|
||||
</Animation>
|
||||
<!-- PiP minimize interpolates the root Video node (id "VideoPlayer", set by VideoQueue); restore reverses
|
||||
the same anim to grow back. -->
|
||||
<Animation id="minimize" duration="0.3" easeFunction="outcubic" optional="true">
|
||||
<FloatFieldInterpolator id="widthInterpolator" key="[0.0, 0.5, 1.0]" keyValue="[1280, 853, 426]" fieldToInterp="VideoPlayer.width" />
|
||||
<FloatFieldInterpolator id="heightInterpolator" key="[0.0, 0.5, 1.0]" keyValue="[720, 480, 240]" fieldToInterp="VideoPlayer.height" />
|
||||
<Vector2DFieldInterpolator id="translationInterpolator" key="[0.0, 0.5, 1.0]" keyValue="[[0,0],[417,230],[834,460]]" fieldToInterp="VideoPlayer.translation" />
|
||||
</Animation>
|
||||
|
||||
<Group id="Buttons">
|
||||
<LayoutGroup
|
||||
layoutDirection="horiz"
|
||||
horizAlignment="left"
|
||||
itemSpacings="[15,15,50]"
|
||||
translation="[562,600]">
|
||||
<VideoPlayerButton
|
||||
id="PreviousButton"
|
||||
iconUri="pkg:/images/icons/player/previous.png"
|
||||
disabled="true" />
|
||||
<VideoPlayerButton
|
||||
id="PlayButton"
|
||||
iconUri="pkg:/images/icons/player/play.png"
|
||||
iconUri2="pkg:/images/icons/player/pause.png"
|
||||
disabled="true" />
|
||||
<VideoPlayerButton
|
||||
id="NextButton"
|
||||
iconUri="pkg:/images/icons/player/next.png"
|
||||
disabled="true" />
|
||||
<VideoPlayerButton
|
||||
id="MinimizeButton"
|
||||
iconUri="pkg:/images/icons/player/minimize.png" />
|
||||
<!-- ===================== PiP fullScreenHint (coordinator child, NOT in Chrome) ===================== -->
|
||||
<!-- Strip + centered label along the bottom of the shrunk player; sized to minRect in OnNodeReady. -->
|
||||
<Rectangle id="fullScreenHint" height="26" color="0x000000" opacity="0.8" visible="false">
|
||||
<Label id="fullScreenHintLabel" text="Press Options (*) for full screen" height="26" color="0xFFFFFF" horizAlign="center" vertAlign="center" font="font:SmallestSystemFont" />
|
||||
</Rectangle>
|
||||
|
||||
<!-- ===================== Chrome group (the HUD, faded as one opacity unit) ===================== -->
|
||||
<Group id="Chrome" opacity="0" visible="false">
|
||||
<!-- Full-screen darkening scrim, chrome-gated (rides the fade), not pause-gated. -->
|
||||
<Poster id="pauseGradient"
|
||||
uri="/RokuOS/Artwork/SceneGraph/FixedTheme/Base/FHD/PauseGradient.9.png"
|
||||
width="1280" height="720" />
|
||||
|
||||
<!-- First content sibling: its full-screen black backdrop must paint UNDER the title/bar/buttons
|
||||
(all later siblings), and the bar's scan-glyph in front of the tiles. Its `visible` is
|
||||
self-derived from transportMode — it does NOT ride the fade. -->
|
||||
<BifDisplay id="bifDisplay" />
|
||||
|
||||
<!-- Title + secondary title (top-left) and the wall clock (top-right). The clock is the shared
|
||||
Clock component: it self-ticks once a minute, so it needs no coordinator gating (the player
|
||||
disposes it on close). -->
|
||||
<Group id="titleArea">
|
||||
<!-- Static wrapped title (up to 3 lines) instead of a marquee: a ScrollingLabel repaints the
|
||||
whole HUD continuously (~25fps) for as long as the chrome is up. The LayoutGroup keeps the
|
||||
secondary title flowing under however many lines the title takes. -->
|
||||
<LayoutGroup translation="[68, 40]" layoutDirection="vert" itemSpacings="[5]">
|
||||
<Label id="titleLabel" width="900" wrap="true" maxLines="3"
|
||||
color="0xFEFEFEFF" horizAlign="left">
|
||||
<Font role="font" uri="font:BoldSystemFontFile" size="30" />
|
||||
</Label>
|
||||
<Label id="secondaryTitleLabel" width="900" height="26"
|
||||
color="0xFEFEFEFF" horizAlign="left" vertAlign="top" wrap="false">
|
||||
<Font role="font" uri="font:SystemFontFile" size="24" />
|
||||
</Label>
|
||||
</LayoutGroup>
|
||||
<Clock id="clock" />
|
||||
</Group>
|
||||
<Group
|
||||
id="LoadingUi"
|
||||
visible="false">
|
||||
<Poster
|
||||
id="LoadingSpinnerBackground"
|
||||
width="80"
|
||||
height="80"
|
||||
uri="pkg:/images/white-circle.png"
|
||||
opacity="0.4"
|
||||
blendColor="0x000000" />
|
||||
<BusySpinner
|
||||
id="LoadingSpinner"
|
||||
spinInterval="1">
|
||||
<Label
|
||||
id="LoadingPercentLabel"
|
||||
horizAlign="center"
|
||||
vertAlign="center"
|
||||
width="150"
|
||||
height="150"
|
||||
font="font:SmallestSystemFont" />
|
||||
<Label
|
||||
id="LoadingLabel"
|
||||
width="150"
|
||||
horizAlign="center"
|
||||
translation="[0,150]"
|
||||
font="font:SmallestSystemFont" />
|
||||
</BusySpinner>
|
||||
</Group>
|
||||
<Group>
|
||||
<Timer id="ProgressTimer" repeat="true" duration="1" />
|
||||
<TrickPlayBar
|
||||
id="TrickPlayBar"
|
||||
translation="[68,660]" />
|
||||
</Group>
|
||||
|
||||
<TrickPlayBar id="trickPlayBar" translation="[68, 632]" />
|
||||
|
||||
<!-- Round-icon control buttons above the trackbar; virtual focus, self-positions its clusters,
|
||||
visible only while idle + chrome up. -->
|
||||
<ButtonRow id="buttonRow" />
|
||||
</Group>
|
||||
|
||||
<Timer id="HideVideoUiTimer" duration="3" />
|
||||
<Animation id="UiFadeAnimation" duration="0.3" optional="true">
|
||||
<FloatFieldInterpolator id="UiFadeOpacityInterpolator" key="[0.0, 0.5, 1.0]" keyValue="[0.0, 0.5, 1.0]" fieldToInterp="VideoUi.opacity" />
|
||||
</Animation>
|
||||
<!-- ===================== LoadBufferSpinner (OUTSIDE Chrome) ===================== -->
|
||||
<!-- One component, two modes (first-load overlay, mid-stream buffering); `visible` derives from `mode`,
|
||||
not chrome-gated, so it shows while chrome is hidden. -->
|
||||
<LoadBufferSpinner id="spinner" />
|
||||
|
||||
<!-- ===================== LargePause (explicit-pause poster; OUTSIDE Chrome) ===================== -->
|
||||
<!-- Coordinator pulses `trigger` only on an explicit pause-from-playing, `cancel` on resume. Not chrome-gated. -->
|
||||
<LargePause id="largePause" />
|
||||
|
||||
<Animation id="minimizeAnimation" duration="0.2" optional="true">
|
||||
<FloatFieldInterpolator id="widthInterpolator" key="[0.0, 0.5, 1.0]" fieldToInterp="VideoPlayer.width" />
|
||||
<FloatFieldInterpolator id="heightInterpolator" key="[0.0, 0.5, 1.0]" fieldToInterp="VideoPlayer.height" />
|
||||
<Vector2DFieldInterpolator id="translationInterpolator" key="[0.0, 0.5, 1.0]" fieldToInterp="VideoPlayer.translation" />
|
||||
</Animation>
|
||||
<Rectangle id="fullScreenHint" height="26" color="#000000" opacity="0.8" visible="false">
|
||||
<Label id="fullScreenHintLabel" text="Press Options (*) for full screen" height="26" color="#FFFFFF" horizAlign="center" vertAlign="center" font="font:SmallestSystemFont" />
|
||||
<Timer id="fullScreenHintTimer" duration="5" />
|
||||
</Rectangle>
|
||||
</children>
|
||||
</component>
|
||||
</component>
|
||||
Reference in new issue
Block a user