FrameworkStyle

PlayerController

Reactive controller for accessing player store state in HTML custom elements

PlayerController is a reactive controller that consumes the player store from playerContext . Without a selector it returns the store instance directly (no subscription — use this for actions). With a selector it returns the selected value and subscribes to changes, triggering a host update on shallow-equal change. Access the current value via .value, which returns undefined until connected to a provider.

Examples

Basic Usage

Paused: Yes | Time: 0.0s | Volume: 100%
<demo-ctrl-player class="html-player-controller-basic">
    <video
        src="https://stream.mux.com/lhnU49l1VGi3zrTAZhDm9LUUxSjpaPW9BL4jY25Kwo4/highest.mp4"
        autoplay
        muted
        playsinline
    ></video>
    <div class="html-player-controller-basic__panel">
        <demo-ctrl-actions class="html-player-controller-basic__actions">
            <button class="action-play">Play</button>
            <button class="action-pause">Pause</button>
            <button class="action-volume">50% Volume</button>
        </demo-ctrl-actions>
        <demo-ctrl-state class="html-player-controller-basic__state">
            <span class="state-text">Paused: Yes | Time: 0.0s | Volume: 100%</span>
        </demo-ctrl-state>
    </div>
</demo-ctrl-player>

API Reference

Without Selector

Parameters

Parameter Type Default
host* PlayerControllerHost
context* PlayerContext<Store>

Return Value

Property Type
value Result | undefined

With Selector

Parameters

Parameter Type Default
host* PlayerControllerHost
context* PlayerContext<Store>
selector* Selector<InferStoreState<Store>, Result>

Return Value

Property Type
value Result | undefined

Video.js is a free and open source HTML5 video player.
The term VIDEO.JS is a registered trademark of Brightcove Inc.
© 2010–2026 Video.js contributors  |  Sponsored by Mux

VideoJS