@videojs/html 10.2.0 → 10.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/default/define/audio/compat-skin.css +161 -41
- package/dist/default/define/audio/compat-skin2.js +1 -1
- package/dist/default/define/audio/neutral-skin.css +73 -34
- package/dist/default/define/audio/neutral-skin2.js +1 -1
- package/dist/default/define/audio/scaffold-skin.css +166 -42
- package/dist/default/define/audio/scaffold-skin2.js +1 -1
- package/dist/default/define/audio/skin.css +72 -34
- package/dist/default/define/audio/skin2.js +1 -1
- package/dist/default/define/extensions/google-analytics.js +6 -0
- package/dist/default/define/live-audio/compat-skin.css +143 -41
- package/dist/default/define/live-audio/compat-skin2.js +1 -1
- package/dist/default/define/live-audio/neutral-skin.css +56 -31
- package/dist/default/define/live-audio/neutral-skin2.js +1 -1
- package/dist/default/define/live-audio/scaffold-skin.css +148 -42
- package/dist/default/define/live-audio/scaffold-skin2.js +1 -1
- package/dist/default/define/live-audio/skin.css +55 -31
- package/dist/default/define/live-audio/skin2.js +1 -1
- package/dist/default/define/live-video/compat-skin.css +234 -51
- package/dist/default/define/live-video/compat-skin2.js +1 -1
- package/dist/default/define/live-video/neutral-skin.css +300 -46
- package/dist/default/define/live-video/neutral-skin2.js +1 -1
- package/dist/default/define/live-video/scaffold-skin.css +231 -53
- package/dist/default/define/live-video/scaffold-skin2.js +1 -1
- package/dist/default/define/live-video/skin.css +314 -49
- package/dist/default/define/live-video/skin2.js +1 -1
- package/dist/default/define/media/dailymotion-video.js +11 -0
- package/dist/default/define/media/mixcloud-audio.js +11 -0
- package/dist/default/define/media/soundcloud-audio.js +11 -0
- package/dist/default/define/ui/time-slider-markers.js +5 -0
- package/dist/default/define/video/compat-skin.css +242 -51
- package/dist/default/define/video/compat-skin2.js +1 -1
- package/dist/default/define/video/neutral-skin.css +382 -57
- package/dist/default/define/video/neutral-skin2.js +1 -1
- package/dist/default/define/video/scaffold-skin.css +240 -53
- package/dist/default/define/video/scaffold-skin2.js +1 -1
- package/dist/default/define/video/skin.css +415 -55
- package/dist/default/define/video/skin2.js +1 -1
- package/dist/default/extensions/google-analytics/extension.js +75 -0
- package/dist/default/extensions/mux-data/extension.js +7 -2
- package/dist/default/index.js +3 -1
- package/dist/default/internal/skins/compat-audio/skin.css +161 -41
- package/dist/default/internal/skins/compat-audio/template.js +1 -1
- package/dist/default/internal/skins/compat-live-audio/skin.css +143 -41
- package/dist/default/internal/skins/compat-live-video/skin.css +234 -51
- package/dist/default/internal/skins/compat-live-video/template.js +2 -0
- package/dist/default/internal/skins/compat-video/skin.css +242 -51
- package/dist/default/internal/skins/compat-video/template.js +2 -0
- package/dist/default/internal/skins/default-audio/skin.css +72 -34
- package/dist/default/internal/skins/default-live-audio/skin.css +55 -31
- package/dist/default/internal/skins/default-live-video/skin.css +314 -49
- package/dist/default/internal/skins/default-live-video/template.js +14 -0
- package/dist/default/internal/skins/default-video/register.js +3 -0
- package/dist/default/internal/skins/default-video/skin.css +415 -55
- package/dist/default/internal/skins/default-video/template.js +33 -5
- package/dist/default/internal/skins/neutral-audio/skin.css +73 -34
- package/dist/default/internal/skins/neutral-live-audio/skin.css +56 -31
- package/dist/default/internal/skins/neutral-live-video/skin.css +300 -46
- package/dist/default/internal/skins/neutral-live-video/template.js +14 -0
- package/dist/default/internal/skins/neutral-video/skin.css +382 -57
- package/dist/default/internal/skins/neutral-video/template.js +25 -11
- package/dist/default/internal/skins/scaffold-audio/skin.css +166 -42
- package/dist/default/internal/skins/scaffold-audio/template.js +1 -1
- package/dist/default/internal/skins/scaffold-live-audio/skin.css +148 -42
- package/dist/default/internal/skins/scaffold-live-video/skin.css +231 -53
- package/dist/default/internal/skins/scaffold-live-video/template.js +2 -0
- package/dist/default/internal/skins/scaffold-video/skin.css +240 -53
- package/dist/default/internal/skins/scaffold-video/template.js +3 -1
- package/dist/default/media/background-video/adapter.js +13 -35
- package/dist/default/media/background-video/base.js +95 -0
- package/dist/default/media/background-video/template.js +13 -20
- package/dist/default/media/dailymotion-video/adapter.js +31 -0
- package/dist/default/media/hls-background-video/adapter.js +23 -35
- package/dist/default/media/mixcloud-audio/adapter.js +16 -0
- package/dist/default/media/soundcloud-audio/adapter.js +16 -0
- package/dist/default/player/element.js +1 -5
- package/dist/default/presets/background/skin.js +2 -2
- package/dist/default/presets/skin.js +4 -3
- package/dist/default/ui/captions-radio-group/element.js +14 -1
- package/dist/default/ui/controls/element.js +6 -3
- package/dist/default/ui/dialog/element.js +13 -1
- package/dist/default/ui/gesture/element.js +3 -0
- package/dist/default/ui/media-button-element.js +10 -1
- package/dist/default/ui/playback-rate-button/element.js +7 -2
- package/dist/default/ui/playback-rate-radio-group/element.js +10 -3
- package/dist/default/ui/radio-options/controller.js +18 -5
- package/dist/default/ui/time-slider/markers.js +160 -0
- package/dist/default/version.js +1 -1
- package/dist/dev/define/audio/compat-skin.css +161 -41
- package/dist/dev/define/audio/compat-skin2.js +1 -1
- package/dist/dev/define/audio/compat-skin2.js.map +1 -1
- package/dist/dev/define/audio/neutral-skin.css +73 -34
- package/dist/dev/define/audio/neutral-skin2.js +1 -1
- package/dist/dev/define/audio/neutral-skin2.js.map +1 -1
- package/dist/dev/define/audio/scaffold-skin.css +166 -42
- package/dist/dev/define/audio/scaffold-skin2.js +1 -1
- package/dist/dev/define/audio/scaffold-skin2.js.map +1 -1
- package/dist/dev/define/audio/skin.css +72 -34
- package/dist/dev/define/audio/skin2.js +1 -1
- package/dist/dev/define/audio/skin2.js.map +1 -1
- package/dist/dev/define/extensions/google-analytics.d.ts +11 -0
- package/dist/dev/define/extensions/google-analytics.js +8 -0
- package/dist/dev/define/extensions/google-analytics.js.map +1 -0
- package/dist/dev/define/live-audio/compat-skin.css +143 -41
- package/dist/dev/define/live-audio/compat-skin2.js +1 -1
- package/dist/dev/define/live-audio/compat-skin2.js.map +1 -1
- package/dist/dev/define/live-audio/neutral-skin.css +56 -31
- package/dist/dev/define/live-audio/neutral-skin2.js +1 -1
- package/dist/dev/define/live-audio/neutral-skin2.js.map +1 -1
- package/dist/dev/define/live-audio/scaffold-skin.css +148 -42
- package/dist/dev/define/live-audio/scaffold-skin2.js +1 -1
- package/dist/dev/define/live-audio/scaffold-skin2.js.map +1 -1
- package/dist/dev/define/live-audio/skin.css +55 -31
- package/dist/dev/define/live-audio/skin2.js +1 -1
- package/dist/dev/define/live-audio/skin2.js.map +1 -1
- package/dist/dev/define/live-video/compat-skin.css +234 -51
- package/dist/dev/define/live-video/compat-skin2.js +1 -1
- package/dist/dev/define/live-video/compat-skin2.js.map +1 -1
- package/dist/dev/define/live-video/neutral-skin.css +300 -46
- package/dist/dev/define/live-video/neutral-skin2.js +1 -1
- package/dist/dev/define/live-video/neutral-skin2.js.map +1 -1
- package/dist/dev/define/live-video/scaffold-skin.css +231 -53
- package/dist/dev/define/live-video/scaffold-skin2.js +1 -1
- package/dist/dev/define/live-video/scaffold-skin2.js.map +1 -1
- package/dist/dev/define/live-video/skin.css +314 -49
- package/dist/dev/define/live-video/skin2.js +1 -1
- package/dist/dev/define/live-video/skin2.js.map +1 -1
- package/dist/dev/define/media/dailymotion-video.d.ts +15 -0
- package/dist/dev/define/media/dailymotion-video.js +13 -0
- package/dist/dev/define/media/dailymotion-video.js.map +1 -0
- package/dist/dev/define/media/mixcloud-audio.d.ts +15 -0
- package/dist/dev/define/media/mixcloud-audio.js +13 -0
- package/dist/dev/define/media/mixcloud-audio.js.map +1 -0
- package/dist/dev/define/media/soundcloud-audio.d.ts +15 -0
- package/dist/dev/define/media/soundcloud-audio.js +13 -0
- package/dist/dev/define/media/soundcloud-audio.js.map +1 -0
- package/dist/dev/define/ui/time-slider-markers.d.ts +8 -0
- package/dist/dev/define/ui/time-slider-markers.js +7 -0
- package/dist/dev/define/ui/time-slider-markers.js.map +1 -0
- package/dist/dev/define/video/compat-skin.css +242 -51
- package/dist/dev/define/video/compat-skin2.js +1 -1
- package/dist/dev/define/video/compat-skin2.js.map +1 -1
- package/dist/dev/define/video/neutral-skin.css +382 -57
- package/dist/dev/define/video/neutral-skin2.js +1 -1
- package/dist/dev/define/video/neutral-skin2.js.map +1 -1
- package/dist/dev/define/video/scaffold-skin.css +240 -53
- package/dist/dev/define/video/scaffold-skin2.js +1 -1
- package/dist/dev/define/video/scaffold-skin2.js.map +1 -1
- package/dist/dev/define/video/skin.css +415 -55
- package/dist/dev/define/video/skin2.js +1 -1
- package/dist/dev/define/video/skin2.js.map +1 -1
- package/dist/dev/extensions/google-analytics/extension.d.ts +52 -0
- package/dist/dev/extensions/google-analytics/extension.js +77 -0
- package/dist/dev/extensions/google-analytics/extension.js.map +1 -0
- package/dist/dev/extensions/google-analytics/index.d.ts +2 -0
- package/dist/dev/extensions/mux-data/extension.d.ts +4 -1
- package/dist/dev/extensions/mux-data/extension.js +7 -2
- package/dist/dev/extensions/mux-data/extension.js.map +1 -1
- package/dist/dev/index.d.ts +5 -4
- package/dist/dev/index.js +3 -1
- package/dist/dev/internal/skins/compat-audio/skin.css +161 -41
- package/dist/dev/internal/skins/compat-audio/template.js +1 -1
- package/dist/dev/internal/skins/compat-audio/template.js.map +1 -1
- package/dist/dev/internal/skins/compat-live-audio/skin.css +143 -41
- package/dist/dev/internal/skins/compat-live-video/skin.css +234 -51
- package/dist/dev/internal/skins/compat-live-video/template.js +2 -0
- package/dist/dev/internal/skins/compat-live-video/template.js.map +1 -1
- package/dist/dev/internal/skins/compat-video/skin.css +242 -51
- package/dist/dev/internal/skins/compat-video/template.js +2 -0
- package/dist/dev/internal/skins/compat-video/template.js.map +1 -1
- package/dist/dev/internal/skins/default-audio/skin.css +72 -34
- package/dist/dev/internal/skins/default-live-audio/skin.css +55 -31
- package/dist/dev/internal/skins/default-live-video/register.js.map +1 -1
- package/dist/dev/internal/skins/default-live-video/skin.css +314 -49
- package/dist/dev/internal/skins/default-live-video/template.js +14 -0
- package/dist/dev/internal/skins/default-live-video/template.js.map +1 -1
- package/dist/dev/internal/skins/default-video/register.d.ts +1 -0
- package/dist/dev/internal/skins/default-video/register.js +3 -0
- package/dist/dev/internal/skins/default-video/register.js.map +1 -1
- package/dist/dev/internal/skins/default-video/skin.css +415 -55
- package/dist/dev/internal/skins/default-video/template.js +33 -5
- package/dist/dev/internal/skins/default-video/template.js.map +1 -1
- package/dist/dev/internal/skins/neutral-audio/skin.css +73 -34
- package/dist/dev/internal/skins/neutral-live-audio/skin.css +56 -31
- package/dist/dev/internal/skins/neutral-live-video/register.js.map +1 -1
- package/dist/dev/internal/skins/neutral-live-video/skin.css +300 -46
- package/dist/dev/internal/skins/neutral-live-video/template.js +14 -0
- package/dist/dev/internal/skins/neutral-live-video/template.js.map +1 -1
- package/dist/dev/internal/skins/neutral-video/register.js.map +1 -1
- package/dist/dev/internal/skins/neutral-video/skin.css +382 -57
- package/dist/dev/internal/skins/neutral-video/template.js +25 -11
- package/dist/dev/internal/skins/neutral-video/template.js.map +1 -1
- package/dist/dev/internal/skins/scaffold-audio/skin.css +166 -42
- package/dist/dev/internal/skins/scaffold-audio/template.js +1 -1
- package/dist/dev/internal/skins/scaffold-audio/template.js.map +1 -1
- package/dist/dev/internal/skins/scaffold-live-audio/skin.css +148 -42
- package/dist/dev/internal/skins/scaffold-live-video/skin.css +231 -53
- package/dist/dev/internal/skins/scaffold-live-video/template.js +2 -0
- package/dist/dev/internal/skins/scaffold-live-video/template.js.map +1 -1
- package/dist/dev/internal/skins/scaffold-video/skin.css +240 -53
- package/dist/dev/internal/skins/scaffold-video/template.js +3 -1
- package/dist/dev/internal/skins/scaffold-video/template.js.map +1 -1
- package/dist/dev/media/background-video/adapter.d.ts +7 -13
- package/dist/dev/media/background-video/adapter.js +13 -35
- package/dist/dev/media/background-video/adapter.js.map +1 -1
- package/dist/dev/media/background-video/base.d.ts +44 -0
- package/dist/dev/media/background-video/base.js +97 -0
- package/dist/dev/media/background-video/base.js.map +1 -0
- package/dist/dev/media/background-video/template.d.ts +3 -0
- package/dist/dev/media/background-video/template.js +13 -20
- package/dist/dev/media/background-video/template.js.map +1 -1
- package/dist/dev/media/dailymotion-video/adapter.d.ts +17 -0
- package/dist/dev/media/dailymotion-video/adapter.js +47 -0
- package/dist/dev/media/dailymotion-video/adapter.js.map +1 -0
- package/dist/dev/media/dailymotion-video/index.d.ts +2 -0
- package/dist/dev/media/hls-background-video/adapter.d.ts +14 -19
- package/dist/dev/media/hls-background-video/adapter.js +23 -35
- package/dist/dev/media/hls-background-video/adapter.js.map +1 -1
- package/dist/dev/media/mixcloud-audio/adapter.d.ts +11 -0
- package/dist/dev/media/mixcloud-audio/adapter.js +52 -0
- package/dist/dev/media/mixcloud-audio/adapter.js.map +1 -0
- package/dist/dev/media/mixcloud-audio/index.d.ts +2 -0
- package/dist/dev/media/soundcloud-audio/adapter.d.ts +11 -0
- package/dist/dev/media/soundcloud-audio/adapter.js +53 -0
- package/dist/dev/media/soundcloud-audio/adapter.js.map +1 -0
- package/dist/dev/media/soundcloud-audio/index.d.ts +2 -0
- package/dist/dev/player/element.js +1 -5
- package/dist/dev/player/element.js.map +1 -1
- package/dist/dev/presets/background/skin.d.ts +2 -1
- package/dist/dev/presets/background/skin.js +2 -2
- package/dist/dev/presets/background/skin.js.map +1 -1
- package/dist/dev/presets/skin.d.ts +4 -3
- package/dist/dev/presets/skin.js +4 -3
- package/dist/dev/presets/skin.js.map +1 -1
- package/dist/dev/ui/captions-button/element.d.ts +2 -0
- package/dist/dev/ui/captions-radio-group/element.d.ts +2 -1
- package/dist/dev/ui/captions-radio-group/element.js +14 -1
- package/dist/dev/ui/captions-radio-group/element.js.map +1 -1
- package/dist/dev/ui/controls/element.d.ts +2 -2
- package/dist/dev/ui/controls/element.js +6 -3
- package/dist/dev/ui/controls/element.js.map +1 -1
- package/dist/dev/ui/dialog/element.js +13 -1
- package/dist/dev/ui/dialog/element.js.map +1 -1
- package/dist/dev/ui/gesture/element.js +3 -0
- package/dist/dev/ui/gesture/element.js.map +1 -1
- package/dist/dev/ui/media-button-element.d.ts +9 -0
- package/dist/dev/ui/media-button-element.js +10 -1
- package/dist/dev/ui/media-button-element.js.map +1 -1
- package/dist/dev/ui/play-button/element.d.ts +2 -0
- package/dist/dev/ui/playback-rate-button/element.d.ts +9 -1
- package/dist/dev/ui/playback-rate-button/element.js +7 -2
- package/dist/dev/ui/playback-rate-button/element.js.map +1 -1
- package/dist/dev/ui/playback-rate-radio-group/element.d.ts +4 -0
- package/dist/dev/ui/playback-rate-radio-group/element.js +10 -3
- package/dist/dev/ui/playback-rate-radio-group/element.js.map +1 -1
- package/dist/dev/ui/radio-options/controller.js +18 -5
- package/dist/dev/ui/radio-options/controller.js.map +1 -1
- package/dist/dev/ui/time-slider/markers.d.ts +48 -0
- package/dist/dev/ui/time-slider/markers.js +165 -0
- package/dist/dev/ui/time-slider/markers.js.map +1 -0
- package/dist/dev/version.js +1 -1
- package/docs/README.md +1 -1
- package/docs/guides/autoplay.md +2 -2
- package/docs/guides/background-video.md +2 -4
- package/docs/guides/browser-support.md +23 -15
- package/docs/guides/build-your-own-skin.md +3 -1
- package/docs/guides/cdn.md +10 -9
- package/docs/guides/content-security-policy.md +3 -0
- package/docs/guides/customize-skins.md +7 -2
- package/docs/guides/features.md +1 -1
- package/docs/guides/google-analytics.md +199 -0
- package/docs/guides/installation-cdn.md +4 -4
- package/docs/guides/installation-shadcn.md +3 -3
- package/docs/guides/installation-svelte.md +4 -4
- package/docs/guides/installation-vue.md +4 -4
- package/docs/guides/installation.md +4 -4
- package/docs/guides/internationalization.md +5 -5
- package/docs/guides/keyboard-shortcuts.md +11 -1
- package/docs/guides/llms.txt +3 -1
- package/docs/guides/media-sources.md +3 -0
- package/docs/guides/migrate-from-media-chrome.md +4 -4
- package/docs/guides/migrate-from-mux-player.md +9 -9
- package/docs/guides/migrate-from-plyr.md +8 -8
- package/docs/guides/migrate-from-video-js-8.md +8 -9
- package/docs/guides/migrate-from-vidstack.md +10 -10
- package/docs/guides/mux-data.md +22 -0
- package/docs/guides/presets.md +5 -5
- package/docs/guides/self-hosting.md +5 -5
- package/docs/guides/skins.md +21 -5
- package/docs/guides/timed-metadata.md +318 -0
- package/docs/guides/ui-components.md +1 -1
- package/docs/llms.txt +25 -6
- package/docs/reference/api/chapters-track.md +71 -0
- package/docs/reference/api/define-text-track.md +113 -0
- package/docs/reference/api/feature-playback-rate.md +54 -3
- package/docs/reference/api/feature-playback.md +5 -1
- package/docs/reference/api/feature-text-cues.md +133 -0
- package/docs/reference/api/feature-text-tracks.md +11 -5
- package/docs/reference/api/get-active-text-cues.md +69 -0
- package/docs/reference/api/get-text-cues.md +69 -0
- package/docs/reference/api/get-text-tracks.md +41 -0
- package/docs/reference/api/hls-metadata-track.md +48 -0
- package/docs/reference/api/html-create-player.md +2 -2
- package/docs/reference/api/llms.txt +13 -1
- package/docs/reference/api/media-capabilities.md +4 -4
- package/docs/reference/api/player-store.md +15 -7
- package/docs/reference/api/preset-audio.md +15 -5
- package/docs/reference/api/preset-background.md +2 -2
- package/docs/reference/api/preset-live-audio.md +15 -5
- package/docs/reference/api/preset-live-video.md +14 -5
- package/docs/reference/api/preset-video.md +14 -5
- package/docs/reference/api/resolve-adapter-type.md +4 -1
- package/docs/reference/api/ui-element.md +2 -2
- package/docs/reference/components/alert-dialog.md +21 -16
- package/docs/reference/components/audio-compat-skin.md +8 -2
- package/docs/reference/components/audio-neutral-skin.md +2 -2
- package/docs/reference/components/audio-scaffold-skin.md +2 -2
- package/docs/reference/components/audio-skin.md +2 -2
- package/docs/reference/components/audio-track-radio-group.md +2 -2
- package/docs/reference/components/audio.md +19 -1
- package/docs/reference/components/background-video-skin.md +1 -1
- package/docs/reference/components/background-video.md +26 -11
- package/docs/reference/components/buffering-indicator.md +2 -2
- package/docs/reference/components/captions-radio-group.md +3 -3
- package/docs/reference/components/cloudflare-video.md +1 -1
- package/docs/reference/components/controls.md +16 -3
- package/docs/reference/components/dailymotion-video.md +192 -0
- package/docs/reference/components/dash-video.md +20 -2
- package/docs/reference/components/dialog.md +49 -22
- package/docs/reference/components/error-dialog.md +13 -10
- package/docs/reference/components/gesture.md +2 -2
- package/docs/reference/components/google-analytics.md +51 -0
- package/docs/reference/components/google-cast.md +1 -1
- package/docs/reference/components/hls-audio.md +56 -2
- package/docs/reference/components/hls-background-video.md +25 -5
- package/docs/reference/components/hls-video.md +99 -7
- package/docs/reference/components/hlsjs-video.md +53 -12
- package/docs/reference/components/hotkey.md +2 -2
- package/docs/reference/components/live-audio-compat-skin.md +8 -2
- package/docs/reference/components/live-audio-neutral-skin.md +2 -2
- package/docs/reference/components/live-audio-scaffold-skin.md +2 -2
- package/docs/reference/components/live-audio-skin.md +2 -2
- package/docs/reference/components/live-video-compat-skin.md +12 -2
- package/docs/reference/components/live-video-neutral-skin.md +6 -2
- package/docs/reference/components/live-video-scaffold-skin.md +6 -2
- package/docs/reference/components/live-video-skin.md +6 -2
- package/docs/reference/components/llms.txt +10 -5
- package/docs/reference/components/mixcloud-audio.md +203 -0
- package/docs/reference/components/mux-audio.md +35 -2
- package/docs/reference/components/mux-background-video.md +1 -1
- package/docs/reference/components/mux-data.md +20 -2
- package/docs/reference/components/mux-video.md +18 -2
- package/docs/reference/components/native-hls-video.md +32 -2
- package/docs/reference/components/play-button.md +7 -5
- package/docs/reference/components/playback-rate-button.md +26 -7
- package/docs/reference/components/playback-rate-radio-group.md +7 -4
- package/docs/reference/components/player.md +3 -3
- package/docs/reference/components/playerjs-video.md +2 -2
- package/docs/reference/components/quality-radio-group.md +2 -2
- package/docs/reference/components/shaka-video.md +2 -2
- package/docs/reference/components/soundcloud-audio.md +227 -0
- package/docs/reference/components/spotify-audio.md +3 -3
- package/docs/reference/components/tiktok-video.md +3 -3
- package/docs/reference/components/time-slider-markers.md +194 -0
- package/docs/reference/components/time-slider.md +14 -0
- package/docs/reference/components/twitch-video.md +2 -3
- package/docs/reference/components/video-compat-skin.md +12 -2
- package/docs/reference/components/video-neutral-skin.md +6 -2
- package/docs/reference/components/video-scaffold-skin.md +6 -2
- package/docs/reference/components/video-skin.md +6 -2
- package/docs/reference/components/video.md +19 -1
- package/docs/reference/components/vimeo-video.md +1 -1
- package/docs/reference/components/wistia-video.md +1 -1
- package/docs/reference/components/youtube-video.md +1 -1
- package/package.json +60 -40
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
The live video preset's default skin, which swaps time controls for a Live button
|
|
4
4
|
|
|
5
|
-
The default skin of the live video preset: the video layout with the time slider and time displays swapped for a Live button. [NeutralLiveVideoSkin](./live-video-neutral-skin.md)
|
|
5
|
+
The default skin of the live video preset: the video layout with the time slider and time displays swapped for a Live button. The preset also provides [NeutralLiveVideoSkin](./live-video-neutral-skin.md), [CompatLiveVideoSkin](./live-video-compat-skin.md), and [ScaffoldLiveVideoSkin](./live-video-scaffold-skin.md). See [Skins](../../guides/skins.md#choose-a-skin) to choose between them and [Presets](../../guides/presets.md) for what the live video preset ships.
|
|
6
6
|
|
|
7
7
|
## Import
|
|
8
8
|
|
|
@@ -13,7 +13,7 @@ import '@videojs/html/live-video/skin';
|
|
|
13
13
|
The import registers the skin and every UI element it composes. The [CDN](../../guides/cdn.md) player bundle registers this skin together with its player:
|
|
14
14
|
|
|
15
15
|
```html
|
|
16
|
-
<script type="module" src="https://cdn.jsdelivr.net/npm/@videojs/cdn@10.
|
|
16
|
+
<script type="module" src="https://cdn.jsdelivr.net/npm/@videojs/cdn@10.4.0/live-video.js"></script>
|
|
17
17
|
```
|
|
18
18
|
|
|
19
19
|
## Anatomy
|
|
@@ -36,6 +36,10 @@ The skin renders a poster image before playback starts. An element with `slot="p
|
|
|
36
36
|
|
|
37
37
|
See [Add a poster and loading placeholder](../../guides/poster.md) for complete examples.
|
|
38
38
|
|
|
39
|
+
## Controls before playback
|
|
40
|
+
|
|
41
|
+
Before playback starts, the skin shows only the large center play button. The other controls appear once playback starts or the media begins to autoplay. Set `--media-controls-before-start: visible` to show them from the start. See [Customize skins](../../guides/customize-skins.md#set-the-skins-styles).
|
|
42
|
+
|
|
39
43
|
## Styling
|
|
40
44
|
|
|
41
45
|
Packaged skins style themselves and expose a small set of public CSS custom properties. Everything else inside the skin is private and may change between releases. [Customize skins](../../guides/customize-skins.md#style-a-packaged-skin) documents the properties. For deeper changes, the Video.js registry provides the skin files.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Video.js v10 — HTML Components
|
|
2
2
|
|
|
3
|
-
> API reference for skins, media components, extensions, and interface components. Bundled with `@videojs/html` v10.
|
|
3
|
+
> API reference for skins, media components, extensions, and interface components. Bundled with `@videojs/html` v10.4.0. Links are relative paths to files in this directory.
|
|
4
4
|
|
|
5
5
|
## Layout
|
|
6
6
|
|
|
@@ -16,19 +16,19 @@ API reference for the packaged skins each preset ships.
|
|
|
16
16
|
|
|
17
17
|
- [video-skin](./video-skin.md): The video preset's default skin with the modern, frosted look
|
|
18
18
|
- [video-neutral-skin](./video-neutral-skin.md): The video preset's visually lighter skin, closer to a classic control bar
|
|
19
|
-
- [video-compat-skin](./video-compat-skin.md):
|
|
19
|
+
- [video-compat-skin](./video-compat-skin.md): The video preset's plain, unbranded skin, a polished step above native controls
|
|
20
20
|
- [video-scaffold-skin](./video-scaffold-skin.md): A video skin with minimal styling for custom skins
|
|
21
21
|
- [audio-skin](./audio-skin.md): The audio preset's default skin with the modern, frosted look
|
|
22
22
|
- [audio-neutral-skin](./audio-neutral-skin.md): The audio preset's visually lighter skin, closer to a classic control bar
|
|
23
|
-
- [audio-compat-skin](./audio-compat-skin.md):
|
|
23
|
+
- [audio-compat-skin](./audio-compat-skin.md): The audio preset's plain, unbranded skin, a polished step above native controls
|
|
24
24
|
- [audio-scaffold-skin](./audio-scaffold-skin.md): An audio skin with minimal styling for custom skins
|
|
25
25
|
- [live-video-skin](./live-video-skin.md): The live video preset's default skin, which swaps time controls for a Live button
|
|
26
26
|
- [live-video-neutral-skin](./live-video-neutral-skin.md): The live video preset's visually lighter skin, closer to a classic control bar
|
|
27
|
-
- [live-video-compat-skin](./live-video-compat-skin.md):
|
|
27
|
+
- [live-video-compat-skin](./live-video-compat-skin.md): The live video preset's plain, unbranded skin, a polished step above native controls
|
|
28
28
|
- [live-video-scaffold-skin](./live-video-scaffold-skin.md): A live video skin with minimal styling for custom skins
|
|
29
29
|
- [live-audio-skin](./live-audio-skin.md): The live audio preset's default skin, which swaps time controls for a Live button
|
|
30
30
|
- [live-audio-neutral-skin](./live-audio-neutral-skin.md): The live audio preset's visually lighter skin, closer to a classic control bar
|
|
31
|
-
- [live-audio-compat-skin](./live-audio-compat-skin.md):
|
|
31
|
+
- [live-audio-compat-skin](./live-audio-compat-skin.md): The live audio preset's plain, unbranded skin, a polished step above native controls
|
|
32
32
|
- [live-audio-scaffold-skin](./live-audio-scaffold-skin.md): A live audio skin with minimal styling for custom skins
|
|
33
33
|
- [background-video-skin](./background-video-skin.md): The background preset's chrome-less skin for ambient video
|
|
34
34
|
|
|
@@ -39,17 +39,20 @@ API reference for media components that handle streaming protocols and playback.
|
|
|
39
39
|
- [audio](./audio.md): Native audio playback that can provide media to a Video.js player
|
|
40
40
|
- [background-video](./background-video.md): Decorative background video element with automatic muting and looping
|
|
41
41
|
- [cloudflare-video](./cloudflare-video.md): Video component that plays Cloudflare Stream videos through the Stream player
|
|
42
|
+
- [dailymotion-video](./dailymotion-video.md): Video component that plays Dailymotion videos through a Dailymotion player configuration
|
|
42
43
|
- [dash-video](./dash-video.md): DASH video element powered by dash.js for adaptive bitrate streaming
|
|
43
44
|
- [hls-audio](./hls-audio.md): Audio-only HLS element that plays the audio rendition of an HLS stream
|
|
44
45
|
- [hls-background-video](./hls-background-video.md): HLS background video without controls, audio, captions, or adaptive quality
|
|
45
46
|
- [hls-video](./hls-video.md): Lightweight HLS video element with minimal bundle size
|
|
46
47
|
- [hlsjs-video](./hlsjs-video.md): HLS video element powered by hls.js for adaptive bitrate streaming
|
|
48
|
+
- [mixcloud-audio](./mixcloud-audio.md): Audio component that plays Mixcloud shows through the Mixcloud Widget
|
|
47
49
|
- [mux-audio](./mux-audio.md): Audio element for Mux-hosted HLS streams
|
|
48
50
|
- [mux-background-video](./mux-background-video.md): Mux-specific name for the HLS background video component
|
|
49
51
|
- [mux-video](./mux-video.md): Video element for Mux-hosted HLS streams
|
|
50
52
|
- [native-hls-video](./native-hls-video.md): HLS video element using the browser's built-in HLS support
|
|
51
53
|
- [playerjs-video](./playerjs-video.md): Video component that plays any embed implementing the player.js protocol, such as Mux Player, Gumlet, FrameRate, Livid, Bunny Stream, and Streamable
|
|
52
54
|
- [shaka-video](./shaka-video.md): Video element powered by Shaka Player for DASH, HLS, and progressive playback with DRM
|
|
55
|
+
- [soundcloud-audio](./soundcloud-audio.md): Audio component that plays SoundCloud tracks and sets through the SoundCloud Widget
|
|
53
56
|
- [spotify-audio](./spotify-audio.md): Audio component that plays Spotify tracks, episodes, playlists, and shows through the Spotify embed
|
|
54
57
|
- [tiktok-video](./tiktok-video.md): Video component that plays TikTok videos through the TikTok embed player
|
|
55
58
|
- [twitch-video](./twitch-video.md): Video component that plays Twitch videos and live channels through the Twitch embed player
|
|
@@ -62,6 +65,7 @@ API reference for media components that handle streaming protocols and playback.
|
|
|
62
65
|
|
|
63
66
|
API reference for extensions that connect external services to the player.
|
|
64
67
|
|
|
68
|
+
- [google-analytics](./google-analytics.md): Options for the Google Analytics 4 extension that tracks video engagement and playback events
|
|
65
69
|
- [google-cast](./google-cast.md): Options for the Google Cast extension that configures the receiver and load request
|
|
66
70
|
- [mux-data](./mux-data.md): Options for the Mux Data extension that monitors playback quality
|
|
67
71
|
|
|
@@ -86,6 +90,7 @@ API reference for the slider components that scrub time and adjust volume.
|
|
|
86
90
|
|
|
87
91
|
- [media-slider](./slider.md): A composable slider component with track, fill, thumb, preview, and value parts
|
|
88
92
|
- [media-time-slider](./time-slider.md): A slider component for seeking through media playback time
|
|
93
|
+
- [media-time-slider-markers](./time-slider-markers.md): Draws a marker on the time slider for each cue on the text tracks a filter matches, such as ad breaks
|
|
89
94
|
- [media-volume-slider](./volume-slider.md): A slider component for controlling media playback volume
|
|
90
95
|
|
|
91
96
|
## Menus
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
# mixcloud-audio
|
|
2
|
+
|
|
3
|
+
Audio component that plays Mixcloud shows through the Mixcloud Widget
|
|
4
|
+
|
|
5
|
+
The [Mixcloud Widget](https://www.mixcloud.com/developers/widget/) plays Mixcloud shows. This component drives the widget and reports its state like a native `<audio>` element, so a [player skin](../../guides/skins.md) can control it.
|
|
6
|
+
|
|
7
|
+
## Import
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
pnpm add @videojs/mixcloud-audio
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
```ts
|
|
14
|
+
import '@videojs/html/media/mixcloud-audio';
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Or load it from the [CDN](../../guides/cdn.md):
|
|
18
|
+
|
|
19
|
+
```html
|
|
20
|
+
<script type="module" src="https://cdn.jsdelivr.net/npm/@videojs/cdn@10.4.0/media/mixcloud-audio.js"></script>
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Load a source
|
|
24
|
+
|
|
25
|
+
`src` takes either of these Mixcloud URLs:
|
|
26
|
+
|
|
27
|
+
- A show: `mixcloud.com/<user>/<show>/`
|
|
28
|
+
- A widget embed URL with its widget parameters, as Mixcloud’s embed code gives it: `www.mixcloud.com/widget/iframe/?feed=...`
|
|
29
|
+
|
|
30
|
+
`www.` and `m.` links work too. Profiles, playlists, and other pages that list shows are not supported.
|
|
31
|
+
|
|
32
|
+
```html
|
|
33
|
+
<mixcloud-audio src="https://www.mixcloud.com/spartacus/lambiance/"></mixcloud-audio>
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Controls
|
|
37
|
+
|
|
38
|
+
The widget is the only UI Mixcloud offers, so `controls` decides whether the component is visible at all. Without `controls`, the component hides itself and plays as an invisible transport: a hidden iframe still loads and plays, so a [player skin](../../guides/skins.md) drives playback while the widget takes no room on the page.
|
|
39
|
+
|
|
40
|
+
```html
|
|
41
|
+
<audio-player>
|
|
42
|
+
<audio-skin>
|
|
43
|
+
<mixcloud-audio src="https://www.mixcloud.com/spartacus/lambiance/"></mixcloud-audio>
|
|
44
|
+
</audio-skin>
|
|
45
|
+
</audio-player>
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
With `controls`, the component shows the widget, and the audio skin draws its controls below it, so the two do not overlap. Anything the listener does in the widget shows in the skin: play, pause, and seek. The widget is also the part of the page that credits the show and links back to it on Mixcloud (see [Mixcloud’s terms of use](#mixclouds-terms-of-use)).
|
|
49
|
+
|
|
50
|
+
```html
|
|
51
|
+
<mixcloud-audio src="https://www.mixcloud.com/spartacus/lambiance/" controls></mixcloud-audio>
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
With `controls`, the component is 120 pixels tall by default, Mixcloud’s classic layout. Set a height to change it. With [widget parameters](#widget-parameters), `mini: true` selects the mini layout, which needs 60 pixels, and `hide_cover: false` selects the picture layout, a large cover that needs about 400 pixels. The widget hides the Mixcloud logo when it is narrower than 560 pixels.
|
|
55
|
+
|
|
56
|
+
## Widget parameters
|
|
57
|
+
|
|
58
|
+
By default, the component sets `hide_cover`, so the widget does not use its picture layout. Change it, or set `mini`, `hide_artwork`, `hide_tracklist`, or `light`, under `source.engine.mixcloud`, spelled as Mixcloud spells them:
|
|
59
|
+
|
|
60
|
+
```ts
|
|
61
|
+
const audio = document.querySelector('mixcloud-audio');
|
|
62
|
+
audio.source = {
|
|
63
|
+
src: 'https://www.mixcloud.com/spartacus/lambiance/',
|
|
64
|
+
engine: { mixcloud: { light: true, hide_artwork: true } },
|
|
65
|
+
};
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Without JavaScript, put the parameters on a widget embed URL instead:
|
|
69
|
+
|
|
70
|
+
```html
|
|
71
|
+
<mixcloud-audio
|
|
72
|
+
src="https://www.mixcloud.com/widget/iframe/?feed=%2Fspartacus%2Flambiance%2F&light=1&hide_artwork=1"
|
|
73
|
+
></mixcloud-audio>
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Engine options win over the parameters of a widget embed URL, which win over the defaults. Set an option to `null` to drop a default. The widget applies `mini`, `hide_cover`, `hide_artwork`, `hide_tracklist`, and `light` without reloading the show. Other options reload it.
|
|
77
|
+
|
|
78
|
+
`light` is the only theme option: Mixcloud offers no other colors. The widget has no start time parameter, so it ignores `start_time`. Set `currentTime` instead.
|
|
79
|
+
|
|
80
|
+
## Behavior
|
|
81
|
+
|
|
82
|
+
- `play()` asks the widget to play. Browsers apply their autoplay policy to the widget as they do to any embed, so a play without a user gesture can be refused. Then the widget reports nothing, and the media stays paused.
|
|
83
|
+
- `autoplay` starts playback once the widget is ready, after the volume applies. The widget’s own `autoplay` parameter does the same and is never written to the widget URL.
|
|
84
|
+
- The widget loads from `player-widget.mixcloud.com`, the host that Mixcloud’s embed URL redirects to. A frame that redirects to another host loses the `autoplay` permission of the page, and then the widget cannot start playback from the skin.
|
|
85
|
+
- Seeking uses whole seconds, as the widget does. The widget ignores a seek before the show first plays, so the component keeps that seek and applies it when playback starts.
|
|
86
|
+
- Mixcloud limits seeks and replays for listeners without a Mixcloud subscription: 6 fast-forwards and 6 rewinds per show in a rolling 60-minute period, and 4 replays of a show in a rolling 14-day period (see [Mixcloud’s help center](https://help.mixcloud.com/hc/en-us/articles/360004054059-Why-are-there-limits-for-rewinds-and-fast-forwards)). When the widget refuses a seek, `currentTime` goes back to the position of the widget, and `seeked` fires.
|
|
87
|
+
- `loop` plays the show again from the start when it ends.
|
|
88
|
+
- Volume and mute both work. The widget has no separate mute, so muting sets its volume to `0`, and unmuting restores the previous level.
|
|
89
|
+
- `buffered` is always empty, because the widget does not report how much of the show it has loaded.
|
|
90
|
+
- The widget does not support playback rate, picture-in-picture, fullscreen, or text tracks, so the component offers none of them, and a player skin hides those controls.
|
|
91
|
+
- `preload`, `playsinline`, and `poster` are accepted for parity with `<audio>` but have no effect.
|
|
92
|
+
- A URL that is not a Mixcloud show reports a `MEDIA_ERR_SRC_NOT_SUPPORTED` error, and so does a show the widget cannot find, such as a private or removed show. A show whose audio the widget does not load within 15 seconds reports a `MEDIA_ERR_NETWORK` error. An error the widget reports before playback starts is a `MEDIA_ERR_SRC_NOT_SUPPORTED` error, and an error during playback is a `MEDIA_ERR_NETWORK` error.
|
|
93
|
+
|
|
94
|
+
## Mixcloud’s terms of use
|
|
95
|
+
|
|
96
|
+
The Mixcloud widget is subject to Mixcloud’s own terms. Before you use this component, read the [Mixcloud Terms of Use](https://www.mixcloud.com/terms/) and the [Widget documentation](https://www.mixcloud.com/developers/widget/) to learn where and how you can use the widget. To keep the widget visible on the page, set `controls`.
|
|
97
|
+
|
|
98
|
+
## Privacy
|
|
99
|
+
|
|
100
|
+
The widget is subject to Mixcloud’s own privacy policy. Read the [Mixcloud Privacy Policy](https://www.mixcloud.com/privacy/) to learn what the widget collects from visitors and what you must do when you embed it. The widget loads from Mixcloud as soon as the component renders, so to wait for a visitor’s consent, render the component only after the visitor agrees.
|
|
101
|
+
|
|
102
|
+
## Examples
|
|
103
|
+
|
|
104
|
+
### Basic Usage
|
|
105
|
+
|
|
106
|
+
**index.html**
|
|
107
|
+
|
|
108
|
+
```html
|
|
109
|
+
<mixcloud-audio class="mixcloud-audio" src="https://www.mixcloud.com/spartacus/lambiance/" controls></mixcloud-audio>
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
**index.css**
|
|
113
|
+
|
|
114
|
+
```css
|
|
115
|
+
.mixcloud-audio {
|
|
116
|
+
width: 100%;
|
|
117
|
+
}
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
**index.ts**
|
|
121
|
+
|
|
122
|
+
```ts
|
|
123
|
+
import '@videojs/html/media/mixcloud-audio';
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
## API Reference
|
|
127
|
+
|
|
128
|
+
### Attributes
|
|
129
|
+
|
|
130
|
+
These attributes configure the embedded media adapter:
|
|
131
|
+
|
|
132
|
+
| Attribute | Type | Default | Description |
|
|
133
|
+
| --- | --- | --- | --- |
|
|
134
|
+
| `autoplay` | `boolean` | `false` | Starts playback once the widget is ready, after the volume applies. Browsers may refuse it. |
|
|
135
|
+
| `controls` | `boolean` | `false` | |
|
|
136
|
+
| `loop` | `boolean` | `false` | Plays the show again from the start when it ends. |
|
|
137
|
+
| `muted` | `boolean` | `false` | |
|
|
138
|
+
| `playsinline` | `boolean` | `true` | |
|
|
139
|
+
| `poster` | `string` | `''` | |
|
|
140
|
+
| `preload` | `MediaPreloadType` | `'metadata'` | |
|
|
141
|
+
| `src` | `string` | `''` | |
|
|
142
|
+
|
|
143
|
+
### Properties
|
|
144
|
+
|
|
145
|
+
| Property | Type | Default | Description |
|
|
146
|
+
| --- | --- | --- | --- |
|
|
147
|
+
| `autoplay` | `boolean` | `false` | Starts playback once the widget is ready, after the volume applies. Browsers may refuse it. |
|
|
148
|
+
| `buffered` | `TimeRangeLike` | — | Read-only. Always empty: the widget does not report how much of the show it has loaded. |
|
|
149
|
+
| `controls` | `boolean` | `false` | |
|
|
150
|
+
| `currentSrc` | `string` | — | Read-only. |
|
|
151
|
+
| `currentTime` | `number` | — | |
|
|
152
|
+
| `defaultMuted` | `boolean` | `false` | |
|
|
153
|
+
| `duration` | `number` | — | Read-only. |
|
|
154
|
+
| `ended` | `boolean` | — | Read-only. |
|
|
155
|
+
| `engine` | `Window \| null` | — | Read-only. The widget's window, which commands are posted to. Null until rendered. |
|
|
156
|
+
| `error` | `MediaError \| null` | — | Read-only. |
|
|
157
|
+
| `loop` | `boolean` | `false` | Plays the show again from the start when it ends. |
|
|
158
|
+
| `muted` | `boolean` | `false` | |
|
|
159
|
+
| `paused` | `boolean` | — | Read-only. |
|
|
160
|
+
| `played` | `{ length: number; start(index: number): number; end(index: number): number }` | — | Read-only. |
|
|
161
|
+
| `playsInline` | `boolean` | `true` | |
|
|
162
|
+
| `poster` | `string` | `''` | |
|
|
163
|
+
| `preload` | `MediaPreloadType` | `'metadata'` | |
|
|
164
|
+
| `readyState` | `number` | — | Read-only. |
|
|
165
|
+
| `seekable` | `TimeRangeLike` | — | Read-only. |
|
|
166
|
+
| `seeking` | `boolean` | — | Read-only. |
|
|
167
|
+
| `source` | `{ src?: string; engine?: MixcloudSourceEngineConfig } \| null` | `null` | Mixcloud show URL in `src`, widget parameters under `engine.mixcloud`. Replacing it re-derives `src`. |
|
|
168
|
+
| `src` | `string` | `''` | |
|
|
169
|
+
| `textTracks` | `TextTrackListLike` | — | Read-only. Unsupported: Mixcloud has no captions or other text tracks. |
|
|
170
|
+
| `volume` | `number` | — | |
|
|
171
|
+
|
|
172
|
+
### Engine options
|
|
173
|
+
|
|
174
|
+
#### `source.engine.mixcloud`
|
|
175
|
+
|
|
176
|
+
Pass Mixcloud Widget options under `source.engine.mixcloud`, spelled exactly as Mixcloud spells them, plus anything Mixcloud adds next. [Media Sources](../../guides/media-sources.md) covers how engine options fit into a structured source.
|
|
177
|
+
|
|
178
|
+
The show comes from `src`, so `feed` has no `engine.mixcloud` spelling. `referrerPolicy` sets the `referrerpolicy` of the widget iframe rather than a widget parameter.
|
|
179
|
+
|
|
180
|
+
| Option | Type | Description |
|
|
181
|
+
| --- | --- | --- |
|
|
182
|
+
| `autoplay` | `boolean \| null \| undefined` | Start playback once the widget is ready, as `autoplay` does. Never written to the URL. |
|
|
183
|
+
| `hide_artwork` | `boolean \| null \| undefined` | Hide the show's artwork. |
|
|
184
|
+
| `hide_cover` | `boolean \| null \| undefined` | Hide the picture layout, a large cover that needs about 400 pixels of height. Defaults to `true`. |
|
|
185
|
+
| `hide_tracklist` | `boolean \| null \| undefined` | Hide the tracklist. |
|
|
186
|
+
| `light` | `boolean \| null \| undefined` | The light theme. Mixcloud offers no other colors. |
|
|
187
|
+
| `mini` | `boolean \| null \| undefined` | The mini layout, 60 pixels tall, without the repost, favorite, and share buttons. |
|
|
188
|
+
| `referrerPolicy` | `ReferrerPolicy \| undefined` | `referrerpolicy` for the widget iframe. Not a widget parameter. |
|
|
189
|
+
|
|
190
|
+
### Methods
|
|
191
|
+
|
|
192
|
+
Supports these media methods: `load`, `pause`, `play`.
|
|
193
|
+
|
|
194
|
+
### Events
|
|
195
|
+
|
|
196
|
+
Implements these standard media events through the embedded player: `canplay`, `canplaythrough`, `durationchange`, `emptied`, `ended`, `error`, `loadeddata`, `loadedmetadata`, `loadstart`, `pause`, `play`, `playing`, `seeked`, `seeking`, `timeupdate`, `volumechange`, `waiting`.
|
|
197
|
+
|
|
198
|
+
Also emits these Video.js-specific events:
|
|
199
|
+
|
|
200
|
+
| Event | Description |
|
|
201
|
+
| --- | --- |
|
|
202
|
+
| `loadcomplete` | |
|
|
203
|
+
| `sourcechange` | Fired when `source` changes, either directly or by resolving a new `src`. Read `source` for the new value. |
|
|
@@ -17,7 +17,39 @@ import '@videojs/html/media/mux-audio';
|
|
|
17
17
|
Or load it from the [CDN](../../guides/cdn.md):
|
|
18
18
|
|
|
19
19
|
```html
|
|
20
|
-
<script type="module" src="https://cdn.jsdelivr.net/npm/@videojs/cdn@10.
|
|
20
|
+
<script type="module" src="https://cdn.jsdelivr.net/npm/@videojs/cdn@10.4.0/media/mux-audio.js"></script>
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Load a source
|
|
24
|
+
|
|
25
|
+
`<mux-audio>` takes Mux content two ways: a stream URL through `src`, or a structured `source` object.
|
|
26
|
+
|
|
27
|
+
```html
|
|
28
|
+
<mux-audio src="https://stream.mux.com/BV3YZtogl89mg9VcNBhhnHm02Y34zI1nlMuMQfAbl3dM.m3u8"></mux-audio>
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
The `source` object builds the URL for you from a playback ID, an optional custom domain, and `playback` params. Playback params are camelCased [Mux playback query params](https://www.mux.com/docs/api-reference/stream/streaming/get-hls-manifest?utm_source=videojs&utm_campaign=vjs10&utm_content=docs-content); for example, `max_resolution` becomes `maxResolution`.
|
|
32
|
+
|
|
33
|
+
```ts
|
|
34
|
+
const audio = document.querySelector('mux-audio')!;
|
|
35
|
+
audio.source = {
|
|
36
|
+
playbackId: 'BV3YZtogl89mg9VcNBhhnHm02Y34zI1nlMuMQfAbl3dM',
|
|
37
|
+
customDomain: 'media.example.com',
|
|
38
|
+
};
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
`<mux-audio>` ignores the same source object when it is assigned again. A new object fires `sourcechange` even when its values are equal, although an equivalent playback source does not reload.
|
|
42
|
+
|
|
43
|
+
## Signed playback
|
|
44
|
+
|
|
45
|
+
For [signed playback](https://www.mux.com/docs/guides/secure-video-playback?utm_source=videojs&utm_campaign=vjs10&utm_content=docs-content), put the playback token on `source.playback.token`. The token replaces every other playback param, so bake modifiers like time bounds into the token when you sign it.
|
|
46
|
+
|
|
47
|
+
```ts
|
|
48
|
+
const audio = document.querySelector('mux-audio')!;
|
|
49
|
+
audio.source = {
|
|
50
|
+
playbackId: 'BV3YZtogl89mg9VcNBhhnHm02Y34zI1nlMuMQfAbl3dM',
|
|
51
|
+
playback: { token: playbackToken },
|
|
52
|
+
};
|
|
21
53
|
```
|
|
22
54
|
|
|
23
55
|
## Analytics and casting
|
|
@@ -87,6 +119,7 @@ These Video.js-specific attributes configure media behavior:
|
|
|
87
119
|
| `contentData` | `{ readonly [key: string]: MediaContentValue; title?: string; poster?: string; storyboard?: string }` | — | Read-only. What `source` says about its content. `poster` and `storyboard` are image URLs it describes rather than plays, from its `poster` and `storyboard` params; a key is absent when the URL can't be built — no playback ID, or signed playback without a matching image token. `title` and the rest come from the metadata Mux publishes for the asset, which loads with the source, so they arrive later than the URLs and are absent until then. The same object is handed back until something in it changes, and `contentdatachange` announces it when it does. Nothing here is applied for you, apart from the thumbnail track `<mux-video>` adds from `storyboard` (and drops for live streams). |
|
|
88
120
|
| `disableRemotePlayback` | `unknown` | `false` | Whether remote playback (AirPlay, Google Cast) is disabled for this media. |
|
|
89
121
|
| `engine` | `Hls \| null` | — | Read-only. Underlying playback engine — the hls.js `Hls` instance when playing via MSE, otherwise `null`. An advanced escape hatch for direct engine access; normal playback is driven through this element's own properties and methods. |
|
|
122
|
+
| `engineName` | `string \| undefined` | — | Read-only. Engine this media is playing through, reported to analytics such as Mux Data: `hlsjs` via MSE, `browser` for native HLS, or `undefined` until a source loads. Read from the instance because the engine is picked per source. |
|
|
90
123
|
| `error` | `MediaError \| null` | — | Read-only. |
|
|
91
124
|
| `liveEdgeStart` | `number` | — | Read-only. Presentation time marking the start of the Live Edge Window. Derived from the delegate on every read; `NaN` when no delegate is attached or the stream is not live. |
|
|
92
125
|
| `preload` | `MediaPreloadType` | `'metadata'` | Preload type (`'none'` / `'metadata'` / `'auto'`). |
|
|
@@ -111,7 +144,7 @@ Options passed under `source.engine.nativeHls`.
|
|
|
111
144
|
|
|
112
145
|
### Methods
|
|
113
146
|
|
|
114
|
-
Supports these media methods. See [HTMLAudioElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLAudioElement) for details: `addTextTrack`, `canPlayType`, `load`, `pause`, `play`.
|
|
147
|
+
Supports these media methods. See [HTMLAudioElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLAudioElement) for details: `addTextTrack`, `canPlayType`, `load`, `pause`, `play`, `removeTextTrack`.
|
|
115
148
|
|
|
116
149
|
### Events
|
|
117
150
|
|
|
@@ -15,7 +15,7 @@ import '@videojs/html/media/mux-background-video';
|
|
|
15
15
|
Or load it from the [CDN](../../guides/cdn.md):
|
|
16
16
|
|
|
17
17
|
```html
|
|
18
|
-
<script type="module" src="https://cdn.jsdelivr.net/npm/@videojs/cdn@10.
|
|
18
|
+
<script type="module" src="https://cdn.jsdelivr.net/npm/@videojs/cdn@10.4.0/media/mux-background-video.js"></script>
|
|
19
19
|
```
|
|
20
20
|
|
|
21
21
|
## Load a Mux source
|
|
@@ -17,7 +17,7 @@ import '@videojs/html/extensions/mux-data';
|
|
|
17
17
|
Or load it from the [CDN](../../guides/cdn.md):
|
|
18
18
|
|
|
19
19
|
```html
|
|
20
|
-
<script type="module" src="https://cdn.jsdelivr.net/npm/@videojs/cdn@10.
|
|
20
|
+
<script type="module" src="https://cdn.jsdelivr.net/npm/@videojs/cdn@10.4.0/extensions/mux-data.js"></script>
|
|
21
21
|
```
|
|
22
22
|
|
|
23
23
|
## Anatomy
|
|
@@ -32,7 +32,7 @@ Or load it from the [CDN](../../guides/cdn.md):
|
|
|
32
32
|
| --- | --- | --- |
|
|
33
33
|
| `env-key` | `envKey` | Mux Data environment key the beacons are sent to. Optional for Mux-hosted playback |
|
|
34
34
|
| — | `metadata` | Mux Data metadata for the view |
|
|
35
|
-
| `player-software-name` | `playerSoftwareName` | Player name reported to Mux Data. Defaults to `
|
|
35
|
+
| `player-software-name` | `playerSoftwareName` | Player name reported to Mux Data. Defaults to `videojs-html-<engine>`; see [Player software name](#player-software-name) |
|
|
36
36
|
| `player-software-version` | `playerSoftwareVersion` | Player version reported to Mux Data. Defaults to the Video.js version |
|
|
37
37
|
| `player-init-time` | `playerInitTime` | Epoch milliseconds the player was initialized. Defaults to when the player was created |
|
|
38
38
|
| `beacon-collection-domain` | `beaconCollectionDomain` | Custom domain the beacons are sent to |
|
|
@@ -44,6 +44,24 @@ Or load it from the [CDN](../../guides/cdn.md):
|
|
|
44
44
|
|
|
45
45
|
Views also report the extension itself as the Mux plugin, so they can be told apart from other Video.js integrations such as `videojs-mux`.
|
|
46
46
|
|
|
47
|
+
## Player software name
|
|
48
|
+
|
|
49
|
+
When no player software name is set, views report `videojs-<framework>-<engine>`, where the framework is `html` or `react` and the engine is the one playing the current source:
|
|
50
|
+
|
|
51
|
+
| Engine | Played by |
|
|
52
|
+
| --- | --- |
|
|
53
|
+
| `hlsjs` | hls.js |
|
|
54
|
+
| `spf-hls-video` | The SPF video engine |
|
|
55
|
+
| `spf-hls-audio` | The audio-only SPF engine |
|
|
56
|
+
| `spf-hls-background-video` | The SPF background video engine |
|
|
57
|
+
| `shaka` | Shaka Player |
|
|
58
|
+
| `dashjs` | dash.js |
|
|
59
|
+
| `browser` | The browser itself, like native HLS in Safari or an MP4 file |
|
|
60
|
+
|
|
61
|
+
The framework is always one word, so everything after the second hyphen is the engine. The name updates on the current view when a source change switches engines. Media that doesn’t declare an engine name leaves it out, as in `videojs-html`. A player software name you set always takes precedence.
|
|
62
|
+
|
|
63
|
+
The player software version defaults to the Video.js version, and the Mux plugin is reported as `@videojs/mux-data` at the same version.
|
|
64
|
+
|
|
47
65
|
Changing `MuxDataSdk`, `beaconCollectionDomain`, `debug`, or `disableCookies` restarts monitoring, which ends the current view and starts a new one. The rest update the view in place.
|
|
48
66
|
|
|
49
67
|
## See also
|
|
@@ -17,7 +17,7 @@ import '@videojs/html/media/mux-video';
|
|
|
17
17
|
Or load it from the [CDN](../../guides/cdn.md):
|
|
18
18
|
|
|
19
19
|
```html
|
|
20
|
-
<script type="module" src="https://cdn.jsdelivr.net/npm/@videojs/cdn@10.
|
|
20
|
+
<script type="module" src="https://cdn.jsdelivr.net/npm/@videojs/cdn@10.4.0/media/mux-video.js"></script>
|
|
21
21
|
```
|
|
22
22
|
|
|
23
23
|
## Load a source
|
|
@@ -85,6 +85,21 @@ video.source = {
|
|
|
85
85
|
};
|
|
86
86
|
```
|
|
87
87
|
|
|
88
|
+
## Protected content
|
|
89
|
+
|
|
90
|
+
For [DRM-protected](https://www.mux.com/docs/guides/protect-videos-with-drm?utm_source=videojs&utm_campaign=vjs10&utm_content=docs-content) playback, put the DRM license token on `source.drm.token`. The Mux video component derives the FairPlay, Widevine, and PlayReady license servers from it. DRM playback is always signed, so a `playback.token` belongs alongside it.
|
|
91
|
+
|
|
92
|
+
```ts
|
|
93
|
+
const video = document.querySelector('mux-video')!;
|
|
94
|
+
video.source = {
|
|
95
|
+
playbackId: 'BV3YZtogl89mg9VcNBhhnHm02Y34zI1nlMuMQfAbl3dM',
|
|
96
|
+
playback: { token: playbackToken },
|
|
97
|
+
drm: { token: drmToken },
|
|
98
|
+
};
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
[Media sources](../../guides/media-sources.md#mux-signs-drm-with-a-token) covers mixing Mux’s license servers with your own.
|
|
102
|
+
|
|
88
103
|
## Analytics and casting
|
|
89
104
|
|
|
90
105
|
The Mux video component plays Mux streams. It doesn’t monitor them or cast them — [Mux Data](../../guides/mux-data.md) and [Google Cast](../../guides/casting.md) are separate extensions you add to the player alongside it. Mux Data needs no environment key here, since Mux attributes the views to the environment that owns the playback ID:
|
|
@@ -164,6 +179,7 @@ These Video.js-specific attributes configure media behavior:
|
|
|
164
179
|
| `contentData` | `{ readonly [key: string]: MediaContentValue; title?: string; poster?: string; storyboard?: string }` | — | Read-only. What `source` says about its content. `poster` and `storyboard` are image URLs it describes rather than plays, from its `poster` and `storyboard` params; a key is absent when the URL can't be built — no playback ID, or signed playback without a matching image token. `title` and the rest come from the metadata Mux publishes for the asset, which loads with the source, so they arrive later than the URLs and are absent until then. The same object is handed back until something in it changes, and `contentdatachange` announces it when it does. Nothing here is applied for you, apart from the thumbnail track `<mux-video>` adds from `storyboard` (and drops for live streams). |
|
|
165
180
|
| `disableRemotePlayback` | `unknown` | `false` | Whether remote playback (AirPlay, Google Cast) is disabled for this media. |
|
|
166
181
|
| `engine` | `Hls \| null` | — | Read-only. Underlying playback engine — the hls.js `Hls` instance when playing via MSE, otherwise `null`. An advanced escape hatch for direct engine access; normal playback is driven through this element's own properties and methods. |
|
|
182
|
+
| `engineName` | `string \| undefined` | — | Read-only. Engine this media is playing through, reported to analytics such as Mux Data: `hlsjs` via MSE, `browser` for native HLS, or `undefined` until a source loads. Read from the instance because the engine is picked per source. |
|
|
167
183
|
| `error` | `MediaError \| null` | — | Read-only. |
|
|
168
184
|
| `isFullscreen` | `boolean` | — | Read-only. |
|
|
169
185
|
| `isPictureInPicture` | `boolean` | — | Read-only. |
|
|
@@ -193,7 +209,7 @@ Options passed under `source.engine.nativeHls`.
|
|
|
193
209
|
|
|
194
210
|
### Methods
|
|
195
211
|
|
|
196
|
-
Supports these media methods. See [HTMLVideoElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLVideoElement) for details: `addTextTrack`, `canPlayType`, `exitFullscreen`, `exitPictureInPicture`, `load`, `pause`, `play`, `requestFullscreen`, `requestPictureInPicture`.
|
|
212
|
+
Supports these media methods. See [HTMLVideoElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLVideoElement) for details: `addTextTrack`, `canPlayType`, `exitFullscreen`, `exitPictureInPicture`, `load`, `pause`, `play`, `removeTextTrack`, `requestFullscreen`, `requestPictureInPicture`.
|
|
197
213
|
|
|
198
214
|
### Events
|
|
199
215
|
|
|
@@ -13,9 +13,39 @@ import '@videojs/html/media/native-hls-video';
|
|
|
13
13
|
Or load it from the [CDN](../../guides/cdn.md):
|
|
14
14
|
|
|
15
15
|
```html
|
|
16
|
-
<script type="module" src="https://cdn.jsdelivr.net/npm/@videojs/cdn@10.
|
|
16
|
+
<script type="module" src="https://cdn.jsdelivr.net/npm/@videojs/cdn@10.4.0/media/native-hls-video.js"></script>
|
|
17
17
|
```
|
|
18
18
|
|
|
19
|
+
## Load a source
|
|
20
|
+
|
|
21
|
+
`src` takes an HLS manifest URL, which the browser plays with its own HLS support.
|
|
22
|
+
|
|
23
|
+
```html
|
|
24
|
+
<native-hls-video src="https://example.com/playlist.m3u8"></native-hls-video>
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
The structured `source` object adds `drm` and engine options to the URL. Setting `source` derives `src`.
|
|
28
|
+
|
|
29
|
+
## Protected content
|
|
30
|
+
|
|
31
|
+
`source.drm` names your license servers, keyed by [EME key system id](https://developer.mozilla.org/en-US/docs/Web/API/Navigator/requestMediaKeySystemAccess).
|
|
32
|
+
|
|
33
|
+
```ts
|
|
34
|
+
const video = document.querySelector('native-hls-video')!;
|
|
35
|
+
video.source = {
|
|
36
|
+
src: 'https://example.com/protected.m3u8',
|
|
37
|
+
drm: {
|
|
38
|
+
'com.apple.fps': {
|
|
39
|
+
licenseUrl: 'https://example.com/fairplay',
|
|
40
|
+
serverCertificateUrl: 'https://example.com/fairplay.cer',
|
|
41
|
+
},
|
|
42
|
+
'com.widevine.alpha': { licenseUrl: 'https://example.com/widevine' },
|
|
43
|
+
},
|
|
44
|
+
};
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
The browser’s own HLS licenses FairPlay only, so the `com.apple.fps` entry is the one this component uses. [Media sources](../../guides/media-sources.md#drm-protected-sources) covers DRM in more depth.
|
|
48
|
+
|
|
19
49
|
## Examples
|
|
20
50
|
|
|
21
51
|
### Basic Usage
|
|
@@ -103,7 +133,7 @@ video.source = {
|
|
|
103
133
|
|
|
104
134
|
### Methods
|
|
105
135
|
|
|
106
|
-
Supports these media methods. See [HTMLVideoElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLVideoElement) for details: `addTextTrack`, `canPlayType`, `exitFullscreen`, `exitPictureInPicture`, `load`, `pause`, `play`, `requestFullscreen`, `requestPictureInPicture`.
|
|
136
|
+
Supports these media methods. See [HTMLVideoElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLVideoElement) for details: `addTextTrack`, `canPlayType`, `exitFullscreen`, `exitPictureInPicture`, `load`, `pause`, `play`, `removeTextTrack`, `requestFullscreen`, `requestPictureInPicture`.
|
|
107
137
|
|
|
108
138
|
### Events
|
|
109
139
|
|
|
@@ -18,22 +18,24 @@ import '@videojs/html/ui/play-button';
|
|
|
18
18
|
|
|
19
19
|
The play button is a three-state button: **play**, **pause**, and **replay**. When media reaches the end (`ended` state), clicking restarts playback from the beginning.
|
|
20
20
|
|
|
21
|
+
While media with `autoplay` is trying to start, the button shows **pause**, and clicking it cancels the autoplay. If the browser refuses the autoplay, the button returns to **play**.
|
|
22
|
+
|
|
21
23
|
## Styling
|
|
22
24
|
|
|
23
|
-
Style with the `[data-paused]` and `[data-ended]` attributes to show/hide play/pause/replay icons based on state. For example:
|
|
25
|
+
Style with the `[data-paused]` and `[data-ended]` attributes to show/hide play/pause/replay icons based on state. While autoplay is pending, the button omits `data-paused` and adds `data-started`, so the pause icon shows. For example:
|
|
24
26
|
|
|
25
27
|
```css
|
|
26
28
|
/* Paused (but not ended) */
|
|
27
29
|
media-play-button[data-paused]:not([data-ended]) .play-icon { display: inline; }
|
|
28
30
|
|
|
29
|
-
/* Playing */
|
|
31
|
+
/* Playing, or autoplay pending */
|
|
30
32
|
media-play-button:not([data-paused]) .pause-icon { display: inline; }
|
|
31
33
|
|
|
32
34
|
/* Ended */
|
|
33
35
|
media-play-button[data-ended] .replay-icon { display: inline; }
|
|
34
36
|
```
|
|
35
37
|
|
|
36
|
-
|
|
38
|
+
The `data-started` attribute is present while the media tries to autoplay, and from first play until a new source is loaded. Use this to hide the play button when media hasn’t started yet:
|
|
37
39
|
|
|
38
40
|
```css
|
|
39
41
|
/* Hide play button before first play */
|
|
@@ -146,6 +148,6 @@ State is reflected as data attributes for CSS styling.
|
|
|
146
148
|
|
|
147
149
|
| Attribute | Description |
|
|
148
150
|
| --- | --- |
|
|
149
|
-
| `data-paused` | Present when the media is paused. |
|
|
151
|
+
| `data-paused` | Present when the media is paused and not trying to autoplay. |
|
|
150
152
|
| `data-ended` | Present when the media has ended. |
|
|
151
|
-
| `data-started` | Present when playback has started. |
|
|
153
|
+
| `data-started` | Present when playback has started or the media is trying to autoplay. |
|
|
@@ -16,12 +16,20 @@ import '@videojs/html/ui/playback-rate-button';
|
|
|
16
16
|
|
|
17
17
|
## Behavior
|
|
18
18
|
|
|
19
|
-
Cycles through playback rates on click. The default
|
|
19
|
+
Cycles through the player’s playback rates on click, in the order they are listed. The default list is `[0.5, 0.75, 1, 1.25, 1.5, 1.75, 2]`; see the [playback rate feature](../api/feature-playback-rate.md) to set your own for the whole player, or set `rates` on the button to give it its own list. After the last rate, it wraps back to the first. If the current rate isn’t in the list (e.g., set programmatically), the button jumps to the next rate greater than the current one.
|
|
20
20
|
|
|
21
21
|
When `commandfor` is set, activation opens the linked playback-rate menu instead of cycling through rates. Use this mode when the button is the trigger for a `<media-menu>` that contains playback-rate options.
|
|
22
22
|
|
|
23
|
+
When the media’s playback rate is unavailable or unsupported, such as on an embed that takes no speed command, the element receives the native `hidden` attribute and ignores activation.
|
|
24
|
+
|
|
23
25
|
## Styling
|
|
24
26
|
|
|
27
|
+
| Attribute | Values | Description |
|
|
28
|
+
| --- | --- | --- |
|
|
29
|
+
| `data-rate` | Number | Current playback rate |
|
|
30
|
+
| `data-availability` | `"available"` \| `"unavailable"` \| `"unsupported"` | Whether the media can change its playback rate |
|
|
31
|
+
| `data-hidden` | Present / absent | Present on the HTML element while playback rate is unavailable or unsupported |
|
|
32
|
+
|
|
25
33
|
Display the current rate using the `data-rate` attribute:
|
|
26
34
|
|
|
27
35
|
```css
|
|
@@ -32,7 +40,7 @@ media-playback-rate-button::after {
|
|
|
32
40
|
|
|
33
41
|
## Accessibility
|
|
34
42
|
|
|
35
|
-
Renders a `<button>` with an automatic `aria-label` of `"Playback rate {rate}"` (e.g., `"Playback rate 1.5"`). Override with the `label` prop. Keyboard activation: Enter / Space.
|
|
43
|
+
Renders a `<button>` with an automatic `aria-label` of `"Playback rate, {rate}"` (e.g., `"Playback rate, 1.5"`). Its tooltip shows `"Playback rate"` without the value. Override both with the `label` prop. Keyboard activation: Enter / Space.
|
|
36
44
|
|
|
37
45
|
In menu-trigger mode, the button behaves as a menu trigger and reflects menu state through the trigger attributes.
|
|
38
46
|
|
|
@@ -97,18 +105,29 @@ import '@videojs/html/ui/playback-rate-button';
|
|
|
97
105
|
| --- | --- | --- | --- |
|
|
98
106
|
| `disabled` | `boolean` | `false` | Whether the button is disabled. |
|
|
99
107
|
| `label` | `{ key: string; text: string } \| string \| ((state: PlaybackRateButtonState) => Text \| string)` | `''` | Custom label for the button. |
|
|
108
|
+
| `rates` | `readonly number[] \| string` | `[]` | Rates to cycle through, in order, in place of the player's `defaultPlaybackRates`. HTML takes a space-separated list, such as `rates="1 1.5 2"`. |
|
|
100
109
|
|
|
101
110
|
### State
|
|
102
111
|
|
|
103
112
|
State is reflected as data attributes for CSS styling.
|
|
104
113
|
|
|
105
|
-
| Property | Type |
|
|
106
|
-
| --- | --- |
|
|
107
|
-
| `label` | `{ key: string; text: string } \| string` |
|
|
108
|
-
| `rate` | `number` |
|
|
114
|
+
| Property | Type | Description |
|
|
115
|
+
| --- | --- | --- |
|
|
116
|
+
| `label` | `{ key: string; text: string } \| string` | |
|
|
117
|
+
| `rate` | `number` | |
|
|
118
|
+
| `availability` | `'available' \| 'unavailable' \| 'unsupported'` | Whether the media can change its playback rate. |
|
|
119
|
+
| `hidden` | `boolean` | Whether the button is hidden because the media has no playback rate to change. |
|
|
109
120
|
|
|
110
121
|
### Data attributes
|
|
111
122
|
|
|
112
123
|
| Attribute | Type | Description |
|
|
113
124
|
| --- | --- | --- |
|
|
114
|
-
| `data-rate` | `number` | Current playback rate. |
|
|
125
|
+
| `data-rate` | `number` | Current playback rate. |
|
|
126
|
+
| `data-availability` | `'available' \| 'unavailable' \| 'unsupported'` | Indicates playback rate availability (`available`, `unavailable`, `unsupported`). |
|
|
127
|
+
| `data-hidden` | — | Present when the button is hidden because the media has no playback rate to change. |
|
|
128
|
+
|
|
129
|
+
### CSS custom properties
|
|
130
|
+
|
|
131
|
+
| Variable | Description |
|
|
132
|
+
| --- | --- |
|
|
133
|
+
| `--media-playback-rate-length` | Characters in the current rate as text, such as `4` for `1.75`. Lets a skin size the label to fit the button. |
|