- Quality button opens a modal picker over the video: Auto at the top plus every rung from the HLS master's variant list (parsed in the router; Piped videoStreams is unreliable), virtual-focus list like the rest of the dev player's chrome, OK applies / Back cancels, panel auto-sizes. - Applying a quality rebuilds the /api/hls URL with the quality filter and restarts at the saved position (stop->stopped-edge->play), persists to playback.preferred_quality, keeps the retry URL list consistent. - Captions button toggles globalCaptionMode On/Off (+ first-track fallback when the OS language match finds nothing); N/A when the video has none. - Status line above the button row: 'Quality: Auto (1080p) | Captions: On' tracks streamingSegment while auto ramps. - Fix: QualityLevelsFromPiped sort crashed the /streams converter (string vs AA compare); replaced by QualityLevelsFromHlsMaster. - Seam tests for picker open/navigate/apply/cancel/clamp + captions toggle; ButtonRow specs updated for the 4-button row. Lib tag PIPED-LIB-26.
130 lines
8.9 KiB
XML
130 lines
8.9 KiB
XML
<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="profilesService" type="node" bind="../../ProfilesService" />
|
|
<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" />
|
|
<field id="setSeek" type="float" 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>
|
|
<!-- ===================== 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 /
|
|
replayToast 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" />
|
|
|
|
<!-- ===================== 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>
|
|
|
|
<!-- ===================== 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="pkg:/images/player/PauseGradient.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>
|
|
|
|
<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>
|
|
|
|
<!-- ===================== 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" />
|
|
|
|
<!-- ===================== QualityPicker (modal; OUTSIDE Chrome, top of the z-order) ===================== -->
|
|
<!-- Opened by the Quality button; virtual focus driven by the coordinator (see OpenQualityPicker). -->
|
|
<QualityPicker id="qualityPicker" visible="false" />
|
|
|
|
</children>
|
|
</component>
|