@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
|
@@ -27,7 +27,9 @@ import '@videojs/html/ui/menu-item-indicator';
|
|
|
27
27
|
|
|
28
28
|
## Behavior
|
|
29
29
|
|
|
30
|
-
The group is available when the configured media exposes playback rates. Option labels default to the rate followed by a multiplication sign (e.g. `1.5×`); pass `formatRate` to customize them.
|
|
30
|
+
The group is available when the configured media exposes playback rates. It offers the player’s playback rates, or its own when you set `rates`. Option labels default to the rate followed by a multiplication sign (e.g. `1.5×`); pass `formatRate` to customize them.
|
|
31
|
+
|
|
32
|
+
When the current rate isn’t one the group offers, such as `1.1` set through the media API, the group adds it as an extra item before the next faster rate. That item carries `data-custom`, and its accessible name is “Custom, 1.1×” while its visible label stays `1.1×`. It goes away once the rate is back on the list.
|
|
31
33
|
|
|
32
34
|
`<media-playback-rate-radio-group>` generates `<media-menu-radio-item>` children. Add an optional `<template>` with a single `<media-menu-radio-item>` to customize each generated item.
|
|
33
35
|
|
|
@@ -40,7 +42,7 @@ The group is available when the configured media exposes playback rates. Option
|
|
|
40
42
|
| `data-hidden` | Present / absent | Present when playback-rate selection is unavailable. |
|
|
41
43
|
| `data-availability` | `"available"` / `"unavailable"` | Whether playback rates are available. |
|
|
42
44
|
|
|
43
|
-
Unavailable groups receive the native `hidden` attribute.
|
|
45
|
+
Unavailable groups receive the native `hidden` attribute. Each item carries `data-rate`, and an item for a current rate the group doesn’t offer also carries `data-custom`.
|
|
44
46
|
|
|
45
47
|
## Accessibility
|
|
46
48
|
|
|
@@ -180,6 +182,7 @@ Menu radio group that generates a `<media-menu-radio-item>` per available playba
|
|
|
180
182
|
| --- | --- | --- | --- |
|
|
181
183
|
| `disabled` | `boolean` | `false` | Whether playback rate selection is disabled. |
|
|
182
184
|
| `formatRate` (attribute `format-rate`) | `((rate: number) => string)` | `formatPlaybackRate` | Custom formatter for visible playback rate labels. |
|
|
185
|
+
| `rates` | `readonly number[] \| string` | `[]` | Rates to offer, in order, in place of the player's `defaultPlaybackRates`. HTML takes a space-separated list, such as `rates="1 1.5 2"`. |
|
|
183
186
|
|
|
184
187
|
#### State
|
|
185
188
|
|
|
@@ -192,7 +195,7 @@ State is reflected as data attributes for CSS styling.
|
|
|
192
195
|
| `options` | `readonly Option[]` | Ordered options displayed by platform adapters. |
|
|
193
196
|
| `disabled` | `boolean` | Whether the entire option group is disabled. |
|
|
194
197
|
| `hidden` | `boolean` | Whether the option group is hidden because no meaningful selection is available. |
|
|
195
|
-
| `availability` | `'available' \| 'unavailable'` | Whether the media exposes a meaningful selection. |
|
|
198
|
+
| `availability` | `'available' \| 'unavailable' \| 'unsupported'` | Whether the media exposes a meaningful selection. `unsupported` when the media has no such capability at all. |
|
|
196
199
|
| `rate` | `number` | |
|
|
197
200
|
|
|
198
201
|
#### Data attributes
|
|
@@ -202,7 +205,7 @@ State is reflected as data attributes for CSS styling.
|
|
|
202
205
|
| `data-rate` | `number` | Current playback rate. |
|
|
203
206
|
| `data-disabled` | — | Present when playback rate selection is disabled. |
|
|
204
207
|
| `data-hidden` | — | Present when playback rate selection is unavailable. |
|
|
205
|
-
| `data-availability` | `'available' \| 'unavailable'` | Indicates playback rate availability (`available
|
|
208
|
+
| `data-availability` | `'available' \| 'unavailable' \| 'unsupported'` | Indicates playback rate availability (`available`, `unavailable`, `unsupported`). |
|
|
206
209
|
|
|
207
210
|
#### Events
|
|
208
211
|
|
|
@@ -124,14 +124,14 @@ Video.js elements clean up after themselves when you remove them from the page:
|
|
|
124
124
|
- `<video-player>` and the UI elements destroy themselves two animation frames after they’re removed. Destroying the player also destroys its store.
|
|
125
125
|
- Media components such as `<hlsjs-video>` tear down their playback engine in a microtask after they’re removed.
|
|
126
126
|
|
|
127
|
-
Moving an element synchronously, removing it and inserting it elsewhere with no `await` in between, triggers neither. To keep
|
|
127
|
+
Moving an element synchronously, removing it and inserting it elsewhere with no `await` in between, triggers neither. To keep the player through a longer move, add the `keep-alive` attribute to it and to its media component:
|
|
128
128
|
|
|
129
129
|
```html
|
|
130
130
|
<video-player keep-alive>
|
|
131
|
-
<media-container
|
|
131
|
+
<media-container>
|
|
132
132
|
<hlsjs-video src="/stream.m3u8" keep-alive></hlsjs-video>
|
|
133
133
|
</media-container>
|
|
134
134
|
</video-player>
|
|
135
135
|
```
|
|
136
136
|
|
|
137
|
-
`keep-alive`
|
|
137
|
+
On the player, `keep-alive` covers the player and every UI element inside it, including the controls inside a packaged skin. Media components don’t inherit it, because destroying the player doesn’t release their engine: give each one its own `keep-alive`, or it tears down its engine as usual. An element you remove on its own from a kept-alive tree still destroys itself. `keep-alive` only stops an element from destroying itself: destroying an element, automatically or with `destroy()`, also destroys the UI elements inside it, including ones that carry `keep-alive`. When you’re finished, call `destroy()` on the player and `adapter.destroy()` on each media component to release its engine. A destroyed element can’t be reconnected; create a new one instead.
|
|
@@ -17,7 +17,7 @@ import '@videojs/html/media/playerjs-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/playerjs-video.js"></script>
|
|
21
21
|
```
|
|
22
22
|
|
|
23
23
|
## Load a source
|
|
@@ -155,7 +155,7 @@ These attributes configure the embedded media adapter:
|
|
|
155
155
|
| `seeking` | `boolean` | — | Read-only. |
|
|
156
156
|
| `source` | `{ src?: string; engine?: PlayerJsSourceEngineConfig } \| null` | `null` | Embed URL in `src`, extra URL parameters under `engine.playerJs`. Re-derives `src`; equal sources skip reload. |
|
|
157
157
|
| `src` | `string` | `''` | |
|
|
158
|
-
| `textTracks` | `TextTrackListLike` | — | Read-only.
|
|
158
|
+
| `textTracks` | `TextTrackListLike` | — | Read-only. Unsupported: player.js has no text track surface. |
|
|
159
159
|
| `volume` | `number` | — | |
|
|
160
160
|
|
|
161
161
|
### Engine options
|
|
@@ -220,7 +220,7 @@ State is reflected as data attributes for CSS styling.
|
|
|
220
220
|
| `options` | `readonly Option[]` | Ordered options displayed by platform adapters. |
|
|
221
221
|
| `disabled` | `boolean` | Whether the entire option group is disabled. |
|
|
222
222
|
| `hidden` | `boolean` | Whether the option group is hidden because no meaningful selection is available. |
|
|
223
|
-
| `availability` | `'available' \| 'unavailable'` | Whether the media exposes a meaningful selection. |
|
|
223
|
+
| `availability` | `'available' \| 'unavailable' \| 'unsupported'` | Whether the media exposes a meaningful selection. `unsupported` when the media has no such capability at all. |
|
|
224
224
|
|
|
225
225
|
#### Data attributes
|
|
226
226
|
|
|
@@ -229,7 +229,7 @@ State is reflected as data attributes for CSS styling.
|
|
|
229
229
|
| `data-quality` | `string` | Current quality value. |
|
|
230
230
|
| `data-disabled` | — | Present when quality selection is disabled. |
|
|
231
231
|
| `data-hidden` | — | Present when quality selection is unavailable. |
|
|
232
|
-
| `data-availability` | `'available' \| 'unavailable'` | Indicates quality availability (`available` or `unavailable`). |
|
|
232
|
+
| `data-availability` | `'available' \| 'unavailable' \| 'unsupported'` | Indicates quality availability (`available` or `unavailable`). |
|
|
233
233
|
|
|
234
234
|
#### Events
|
|
235
235
|
|
|
@@ -21,7 +21,7 @@ import '@videojs/html/media/shaka-video';
|
|
|
21
21
|
Or load it from the [CDN](../../guides/cdn.md):
|
|
22
22
|
|
|
23
23
|
```html
|
|
24
|
-
<script type="module" src="https://cdn.jsdelivr.net/npm/@videojs/cdn@10.
|
|
24
|
+
<script type="module" src="https://cdn.jsdelivr.net/npm/@videojs/cdn@10.4.0/media/shaka-video.js"></script>
|
|
25
25
|
```
|
|
26
26
|
|
|
27
27
|
## Load a source
|
|
@@ -134,7 +134,7 @@ Also exposes these properties from the native media API. See [HTMLVideoElement](
|
|
|
134
134
|
|
|
135
135
|
### Methods
|
|
136
136
|
|
|
137
|
-
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`.
|
|
137
|
+
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`.
|
|
138
138
|
|
|
139
139
|
### Events
|
|
140
140
|
|
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
# soundcloud-audio
|
|
2
|
+
|
|
3
|
+
Audio component that plays SoundCloud tracks and sets through the SoundCloud Widget
|
|
4
|
+
|
|
5
|
+
The [SoundCloud Widget](https://developers.soundcloud.com/docs/api/html5-widget) plays public and private SoundCloud tracks and sets. 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/soundcloud-audio
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
```ts
|
|
14
|
+
import '@videojs/html/media/soundcloud-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/soundcloud-audio.js"></script>
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Load a source
|
|
24
|
+
|
|
25
|
+
`src` takes any of these SoundCloud URLs:
|
|
26
|
+
|
|
27
|
+
- A track: `soundcloud.com/<user>/<track>`
|
|
28
|
+
- A set: `soundcloud.com/<user>/sets/<set>`
|
|
29
|
+
- A private track or set, with its secret token: `soundcloud.com/<user>/<track>/s-<token>`
|
|
30
|
+
- An API resource: `api.soundcloud.com/tracks/<id>` or `api.soundcloud.com/playlists/<id>`, with an optional `secret_token`. The id can also be a URN such as `soundcloud:tracks:<id>`
|
|
31
|
+
- A widget embed URL: `w.soundcloud.com/player/?url=...`, as SoundCloud’s own embed code gives it
|
|
32
|
+
|
|
33
|
+
`m.soundcloud.com` links work too. Add `#t=` to start at a given time, in seconds (`#t=90`), clock time (`#t=1:30`), or units (`#t=1m30s`). Profiles, likes, and other pages that list sounds are not supported.
|
|
34
|
+
|
|
35
|
+
```html
|
|
36
|
+
<soundcloud-audio src="https://soundcloud.com/forss/flickermood#t=1:30"></soundcloud-audio>
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Controls
|
|
40
|
+
|
|
41
|
+
The widget is the only UI SoundCloud 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.
|
|
42
|
+
|
|
43
|
+
```html
|
|
44
|
+
<audio-player>
|
|
45
|
+
<audio-skin>
|
|
46
|
+
<soundcloud-audio src="https://soundcloud.com/forss/flickermood"></soundcloud-audio>
|
|
47
|
+
</audio-skin>
|
|
48
|
+
</audio-player>
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
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, seeking on the waveform, and picking another track of a set. The widget is also the part of the page that credits the uploader and links back to the sound on SoundCloud (see [SoundCloud’s terms of use](#soundclouds-terms-of-use)).
|
|
52
|
+
|
|
53
|
+
```html
|
|
54
|
+
<soundcloud-audio src="https://soundcloud.com/forss/flickermood" controls></soundcloud-audio>
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
With `controls`, the component is 166 pixels tall by default, SoundCloud’s classic layout. Set a height to change it. From about 300 pixels, a set also shows its track list, and 450 pixels shows most of it. The large artwork layout of `visual: true` (see [widget parameters](#widget-parameters)) needs 300 pixels or more. At the default height, the artwork shows only behind the waveform.
|
|
58
|
+
|
|
59
|
+
```css
|
|
60
|
+
soundcloud-audio {
|
|
61
|
+
height: 300px;
|
|
62
|
+
}
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## Widget parameters
|
|
66
|
+
|
|
67
|
+
By default, the component hides the parts of the widget a skin has no use for: the buy, share, and download buttons, comments, reposts, the teaser, the related tracks shown after a track ends, and the large artwork layout. The uploader, the title, the artwork, and the SoundCloud logo stay whenever the widget shows.
|
|
68
|
+
|
|
69
|
+
Change any of these, or set `color`, under `source.engine.soundcloud`, spelled as SoundCloud spells them:
|
|
70
|
+
|
|
71
|
+
```ts
|
|
72
|
+
const audio = document.querySelector('soundcloud-audio');
|
|
73
|
+
audio.source = {
|
|
74
|
+
src: 'https://soundcloud.com/forss/sets/soulhack',
|
|
75
|
+
engine: { soundcloud: { color: '#ff5500', start_track: 2, sharing: true } },
|
|
76
|
+
};
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
Without JavaScript, put the parameters on a widget embed URL instead:
|
|
80
|
+
|
|
81
|
+
```html
|
|
82
|
+
<soundcloud-audio
|
|
83
|
+
src="https://w.soundcloud.com/player/?url=https%3A%2F%2Fsoundcloud.com%2Fforss%2Fsets%2Fsoulhack&color=%23ff5500&start_track=2"
|
|
84
|
+
></soundcloud-audio>
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
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.
|
|
88
|
+
|
|
89
|
+
## Behavior
|
|
90
|
+
|
|
91
|
+
- A set plays as one source. When the widget moves on to the next track, `duration` changes, `currentTime` starts again from `0`, and `durationchange` fires. `ended` fires only after the last track. `play()` after the end starts the set again from its first track.
|
|
92
|
+
- `loop` replays the track, or the set from its first track. If the widget does not start again, `ended` still fires.
|
|
93
|
+
- Volume and mute both work. The widget has no separate mute, so muting sets its volume to `0` and unmuting restores the previous level. Mute applies before autoplay starts, so a muted autoplay starts muted.
|
|
94
|
+
- `autoplay` starts playback once the widget is ready. Browsers can still refuse it, as they do for any embed. The widget’s own `auto_play` parameter does the same and is never written to the widget URL, so the volume always applies first.
|
|
95
|
+
- `buffered` is the stretch the widget reports as loaded, from where playback last started or landed.
|
|
96
|
+
- 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.
|
|
97
|
+
- `preload`, `playsinline`, and `poster` are accepted for parity with `<audio>` but have no effect.
|
|
98
|
+
- A track that is private without its secret token, removed, or not available in the listener’s region reports a `MEDIA_ERR_SRC_NOT_SUPPORTED` error, and so does a URL the component does not recognize. A widget that has not finished loading after 5 seconds reports a `MEDIA_ERR_NETWORK` error. An error the widget reports during playback fires a non-fatal `error` event but leaves `error` empty, because a set moves on to its next track by itself.
|
|
99
|
+
|
|
100
|
+
## SoundCloud’s terms of use
|
|
101
|
+
|
|
102
|
+
The widget is covered by the [SoundCloud Terms of Use](https://soundcloud.com/terms-of-use#use-of-soundcloud-players-and-widget), in the section about players and widgets. Without written consent from SoundCloud, you may not use the widget to:
|
|
103
|
+
|
|
104
|
+
- Aggregate SoundCloud content into a separate destination that substantially replicates what SoundCloud offers, or into a content service where SoundCloud content is a material part.
|
|
105
|
+
- Embed content on a site dedicated to one artist, unless the content is yours and you are that artist or represent them, or on a site dedicated to one genre.
|
|
106
|
+
|
|
107
|
+
These limits apply to commercial and non-commercial use. You also may not use the widget in a way that suggests that SoundCloud, an artist, or anyone else endorses or supports your site. SoundCloud can block your use of the widget at any time, for any reason.
|
|
108
|
+
|
|
109
|
+
The [SoundCloud API terms](https://developers.soundcloud.com/docs/api/terms-of-use), which ask you to credit the uploader and SoundCloud with links back to the sound, apply when you use the SoundCloud API, for example to play stream URLs in a player of your own. This component uses the widget, which [SoundCloud says handles that credit itself](https://developers.soundcloud.com/docs/api/buttons-logos). The widget gives that credit only while it shows, which is with `controls`. Without `controls`, we recommend that your page give the credit itself: name the uploader, name SoundCloud as the source, and link to the sound on SoundCloud. The Terms of Use also say you must not remove trademark, copyright, or other proprietary or legal notices that appear on content from SoundCloud.
|
|
110
|
+
|
|
111
|
+
## Privacy
|
|
112
|
+
|
|
113
|
+
The widget loads from SoundCloud as soon as the component renders. The [SoundCloud Privacy Policy](https://soundcloud.com/pages/privacy) says that SoundCloud may receive personal data when a visitor opens a page with an embedded widget, including which site they are on, and may recognize the visitor. The widget also stores data in the visitor’s browser. SoundCloud does not document an embed mode that avoids this, so if your site needs consent before it loads third-party content, render the component only after the visitor agrees.
|
|
114
|
+
|
|
115
|
+
## Examples
|
|
116
|
+
|
|
117
|
+
### Basic Usage
|
|
118
|
+
|
|
119
|
+
**index.html**
|
|
120
|
+
|
|
121
|
+
```html
|
|
122
|
+
<soundcloud-audio class="soundcloud-audio" src="https://soundcloud.com/forss/flickermood" controls></soundcloud-audio>
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
**index.css**
|
|
126
|
+
|
|
127
|
+
```css
|
|
128
|
+
.soundcloud-audio {
|
|
129
|
+
width: 100%;
|
|
130
|
+
}
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
**index.ts**
|
|
134
|
+
|
|
135
|
+
```ts
|
|
136
|
+
import '@videojs/html/media/soundcloud-audio';
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
## API Reference
|
|
140
|
+
|
|
141
|
+
### Attributes
|
|
142
|
+
|
|
143
|
+
These attributes configure the embedded media adapter:
|
|
144
|
+
|
|
145
|
+
| Attribute | Type | Default | Description |
|
|
146
|
+
| --- | --- | --- | --- |
|
|
147
|
+
| `autoplay` | `boolean` | `false` | Starts playback once the widget is ready, after the volume and start position apply. Browsers may refuse it. |
|
|
148
|
+
| `controls` | `boolean` | `false` | |
|
|
149
|
+
| `loop` | `boolean` | `false` | Replays the track, or a set from its first track, when the last one ends. |
|
|
150
|
+
| `muted` | `boolean` | `false` | |
|
|
151
|
+
| `playsinline` | `boolean` | `true` | |
|
|
152
|
+
| `poster` | `string` | `''` | |
|
|
153
|
+
| `preload` | `MediaPreloadType` | `'metadata'` | |
|
|
154
|
+
| `src` | `string` | `''` | |
|
|
155
|
+
|
|
156
|
+
### Properties
|
|
157
|
+
|
|
158
|
+
| Property | Type | Default | Description |
|
|
159
|
+
| --- | --- | --- | --- |
|
|
160
|
+
| `autoplay` | `boolean` | `false` | Starts playback once the widget is ready, after the volume and start position apply. Browsers may refuse it. |
|
|
161
|
+
| `buffered` | `TimeRangeLike` | — | Read-only. The stretch the widget reports loaded, from where playback last started or landed. |
|
|
162
|
+
| `contentData` | `{ title?: string \| null; poster?: string \| null; storyboard?: string \| null; readonly [key: string]: MediaContentValue }` | — | Read-only. The `title` and `poster` of the track playing, which change with each track of a set. Empty until the widget reports them, and again across a source change. `contentdatachange` announces both. |
|
|
163
|
+
| `controls` | `boolean` | `false` | |
|
|
164
|
+
| `currentSrc` | `string` | — | Read-only. |
|
|
165
|
+
| `currentTime` | `number` | — | |
|
|
166
|
+
| `defaultMuted` | `boolean` | `false` | |
|
|
167
|
+
| `duration` | `number` | — | Read-only. |
|
|
168
|
+
| `ended` | `boolean` | — | Read-only. |
|
|
169
|
+
| `engine` | `Window \| null` | — | Read-only. The widget's window, which commands are posted to. Null until rendered. |
|
|
170
|
+
| `error` | `MediaError \| null` | — | Read-only. |
|
|
171
|
+
| `loop` | `boolean` | `false` | Replays the track, or a set from its first track, when the last one ends. |
|
|
172
|
+
| `muted` | `boolean` | `false` | |
|
|
173
|
+
| `paused` | `boolean` | — | Read-only. |
|
|
174
|
+
| `played` | `{ length: number; start(index: number): number; end(index: number): number }` | — | Read-only. |
|
|
175
|
+
| `playsInline` | `boolean` | `true` | |
|
|
176
|
+
| `poster` | `string` | `''` | |
|
|
177
|
+
| `preload` | `MediaPreloadType` | `'metadata'` | |
|
|
178
|
+
| `readyState` | `number` | — | Read-only. |
|
|
179
|
+
| `seekable` | `TimeRangeLike` | — | Read-only. |
|
|
180
|
+
| `seeking` | `boolean` | — | Read-only. |
|
|
181
|
+
| `source` | `{ src?: string; engine?: SoundCloudSourceEngineConfig } \| null` | `null` | SoundCloud URL in `src`, widget parameters under `engine.soundcloud`. Replacing it re-derives `src`. |
|
|
182
|
+
| `src` | `string` | `''` | |
|
|
183
|
+
| `textTracks` | `TextTrackListLike` | — | Read-only. Unsupported: SoundCloud has no captions or other text tracks. |
|
|
184
|
+
| `volume` | `number` | — | |
|
|
185
|
+
|
|
186
|
+
### Engine options
|
|
187
|
+
|
|
188
|
+
#### `source.engine.soundcloud`
|
|
189
|
+
|
|
190
|
+
Pass [SoundCloud Widget parameters](https://developers.soundcloud.com/docs/api/html5-widget#parameters) under `source.engine.soundcloud`, spelled exactly as SoundCloud spells them, plus anything SoundCloud adds next. [Media Sources](../../guides/media-sources.md) covers how engine options fit into a structured source.
|
|
191
|
+
|
|
192
|
+
The sound comes from `src`, so `url` has no `engine.soundcloud` spelling. `referrerPolicy` sets the `referrerpolicy` of the widget iframe rather than a widget parameter.
|
|
193
|
+
|
|
194
|
+
| Option | Type | Description |
|
|
195
|
+
| --- | --- | --- |
|
|
196
|
+
| `auto_play` | `boolean \| null \| undefined` | Start playback once the widget is ready, as `autoplay` does. Never written to the URL. |
|
|
197
|
+
| `buying` | `boolean \| null \| undefined` | Show the buy button. Defaults to `false`. |
|
|
198
|
+
| `color` | `string \| null \| undefined` | Hex color of the play button and other accents, such as `'#ff5500'`. |
|
|
199
|
+
| `download` | `boolean \| null \| undefined` | Show the download button. Defaults to `false`. |
|
|
200
|
+
| `hide_related` | `boolean \| null \| undefined` | Hide the related tracks the widget offers once a track ends. Defaults to `true`. |
|
|
201
|
+
| `referrerPolicy` | `ReferrerPolicy \| undefined` | `referrerpolicy` for the widget iframe. Not a widget parameter. |
|
|
202
|
+
| `sharing` | `boolean \| null \| undefined` | Show the share button. Defaults to `false`. |
|
|
203
|
+
| `show_artwork` | `boolean \| null \| undefined` | Show the artwork. |
|
|
204
|
+
| `show_comments` | `boolean \| null \| undefined` | Show listener comments on the waveform. Defaults to `false`. |
|
|
205
|
+
| `show_playcount` | `boolean \| null \| undefined` | Show the play count. |
|
|
206
|
+
| `show_reposts` | `boolean \| null \| undefined` | Show reposts. Defaults to `false`. |
|
|
207
|
+
| `show_teaser` | `boolean \| null \| undefined` | Show SoundCloud's promotional teaser. Defaults to `false`. |
|
|
208
|
+
| `show_user` | `boolean \| null \| undefined` | Show the uploader's name. The widget is what credits the uploader, so keep it unless the page does that elsewhere. |
|
|
209
|
+
| `single_active` | `boolean \| null \| undefined` | When `false`, playing this widget does not pause the other SoundCloud widgets on the page. |
|
|
210
|
+
| `start_track` | `number \| null \| undefined` | Index of the track in a set to start from. |
|
|
211
|
+
| `visual` | `boolean \| null \| undefined` | The large artwork layout. Defaults to `false`. |
|
|
212
|
+
|
|
213
|
+
### Methods
|
|
214
|
+
|
|
215
|
+
Supports these media methods: `load`, `pause`, `play`.
|
|
216
|
+
|
|
217
|
+
### Events
|
|
218
|
+
|
|
219
|
+
Implements these standard media events through the embedded player: `canplay`, `canplaythrough`, `durationchange`, `emptied`, `ended`, `error`, `loadeddata`, `loadedmetadata`, `loadstart`, `pause`, `play`, `playing`, `progress`, `seeked`, `seeking`, `timeupdate`, `volumechange`, `waiting`.
|
|
220
|
+
|
|
221
|
+
Also emits these Video.js-specific events:
|
|
222
|
+
|
|
223
|
+
| Event | Description |
|
|
224
|
+
| --- | --- |
|
|
225
|
+
| `contentdatachange` | Fired when the widget reports the title and artwork of a track, and when they are cleared. Read `contentData` for them. |
|
|
226
|
+
| `loadcomplete` | |
|
|
227
|
+
| `sourcechange` | Fired when `source` changes, either directly or by resolving a new `src`. Read `source` for the new value. |
|
|
@@ -17,7 +17,7 @@ import '@videojs/html/media/spotify-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/spotify-audio.js"></script>
|
|
21
21
|
```
|
|
22
22
|
|
|
23
23
|
## Load a source
|
|
@@ -105,7 +105,7 @@ These attributes configure the embedded media adapter:
|
|
|
105
105
|
| `seeking` | `boolean` | — | Read-only. |
|
|
106
106
|
| `source` | `{ src?: string; engine?: SpotifySourceEngineConfig } \| null` | `null` | Spotify URL or URI in `src`, plus embed options under `engine.spotify`. Replacing it re-derives `src`. |
|
|
107
107
|
| `src` | `string` | `''` | |
|
|
108
|
-
| `textTracks` | `TextTrackListLike` | — | Read-only.
|
|
108
|
+
| `textTracks` | `TextTrackListLike` | — | Read-only. Unsupported: the embed exposes no captions or other text tracks. |
|
|
109
109
|
|
|
110
110
|
### Engine options
|
|
111
111
|
|
|
@@ -134,7 +134,7 @@ Supports these media methods: `load`, `pause`, `play`.
|
|
|
134
134
|
|
|
135
135
|
### Events
|
|
136
136
|
|
|
137
|
-
Implements these standard media events through the embedded player: `durationchange`, `emptied`, `ended`, `error`, `loadedmetadata`, `loadstart`, `pause`, `play`, `playing`, `seeked`, `seeking`, `timeupdate`, `waiting`.
|
|
137
|
+
Implements these standard media events through the embedded player: `durationchange`, `emptied`, `ended`, `error`, `loadedmetadata`, `loadstart`, `pause`, `play`, `playing`, `progress`, `seeked`, `seeking`, `timeupdate`, `waiting`.
|
|
138
138
|
|
|
139
139
|
Also emits these Video.js-specific events:
|
|
140
140
|
|
|
@@ -17,7 +17,7 @@ import '@videojs/html/media/tiktok-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/tiktok-video.js"></script>
|
|
21
21
|
```
|
|
22
22
|
|
|
23
23
|
## Load a source
|
|
@@ -117,7 +117,7 @@ These attributes configure the embedded media adapter:
|
|
|
117
117
|
| `seeking` | `boolean` | — | Read-only. |
|
|
118
118
|
| `source` | `{ src?: string; engine?: TikTokSourceEngineConfig } \| null` | `null` | TikTok URL or id in `src`, player params under `engine.tiktok`. Re-derives `src`; equal sources skip reload. |
|
|
119
119
|
| `src` | `string` | `''` | |
|
|
120
|
-
| `textTracks` | `TextTrackListLike` | — | Read-only.
|
|
120
|
+
| `textTracks` | `TextTrackListLike` | — | Read-only. Unsupported: `closed_caption` is the embed's only say over captions. |
|
|
121
121
|
|
|
122
122
|
### Engine options
|
|
123
123
|
|
|
@@ -155,7 +155,7 @@ Supports these media methods: `exitFullscreen`, `load`, `pause`, `play`, `reques
|
|
|
155
155
|
|
|
156
156
|
### Events
|
|
157
157
|
|
|
158
|
-
Implements these standard media events through the embedded player: `durationchange`, `emptied`, `ended`, `error`, `loadedmetadata`, `loadstart`, `pause`, `play`, `playing`, `seeked`, `seeking`, `timeupdate`, `volumechange`, `waiting`.
|
|
158
|
+
Implements these standard media events through the embedded player: `durationchange`, `emptied`, `ended`, `error`, `loadedmetadata`, `loadstart`, `pause`, `play`, `playing`, `progress`, `seeked`, `seeking`, `timeupdate`, `volumechange`, `waiting`.
|
|
159
159
|
|
|
160
160
|
Also emits these Video.js-specific events:
|
|
161
161
|
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
# media-time-slider-markers
|
|
2
|
+
|
|
3
|
+
Draws a marker on the time slider for each cue on the text tracks a filter matches, such as ad breaks
|
|
4
|
+
|
|
5
|
+
A part of the [time slider](./time-slider.md) that draws a marker for each cue on the text tracks a filter matches, such as ad breaks, quiz questions, or highlights. Its props, data attributes, and custom properties are listed with the time slider’s other parts.
|
|
6
|
+
|
|
7
|
+
## Import
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
import '@videojs/html/ui/time-slider-markers';
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Anatomy
|
|
14
|
+
|
|
15
|
+
```html
|
|
16
|
+
<media-time-slider>
|
|
17
|
+
<media-slider-track>
|
|
18
|
+
<media-slider-fill></media-slider-fill>
|
|
19
|
+
</media-slider-track>
|
|
20
|
+
<media-time-slider-markers label="ads"></media-time-slider-markers>
|
|
21
|
+
<media-slider-thumb></media-slider-thumb>
|
|
22
|
+
</media-time-slider>
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Each marker is a `<div>`, or a clone of a `<template>` child. The template must contain exactly one HTML root element, and stays in the light DOM.
|
|
26
|
+
|
|
27
|
+
```html
|
|
28
|
+
<media-time-slider-markers label="ads">
|
|
29
|
+
<template>
|
|
30
|
+
<div class="ad-marker"></div>
|
|
31
|
+
</template>
|
|
32
|
+
</media-time-slider-markers>
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Behavior
|
|
36
|
+
|
|
37
|
+
The `kind`, `label`, and `language` attributes pick the tracks whose cues are drawn. The `filter` property takes a filter object, a function, or a [track definition](../api/define-text-track.md) instead, and takes priority over the attributes. With neither, nothing is drawn.
|
|
38
|
+
|
|
39
|
+
Tracks from the media and from the app are drawn alike. While the markers are rendered, the [text cues feature](../api/feature-text-cues.md) reads the tracks they match, so tracks it skips by default work too.
|
|
40
|
+
|
|
41
|
+
A cue whose end is its start is a point, drawn as a marker with no width and `data-point`. Any other cue is a range, spanning from its start to its end and clamped to the slider. Markers sit on the same span as the slider: from `0` to the media’s duration, or to the end of its seekable range while the duration is unknown. Cues outside that span, and every cue while it’s unknown, aren’t drawn. Markers are ordered by start, then end.
|
|
42
|
+
|
|
43
|
+
## Styling
|
|
44
|
+
|
|
45
|
+
| Attribute | Description |
|
|
46
|
+
| --- | --- |
|
|
47
|
+
| `data-active` | Present while the marker’s cue is active. |
|
|
48
|
+
| `data-point` | Present when the cue marks one moment rather than a span. |
|
|
49
|
+
|
|
50
|
+
Each marker also carries the slider’s data attributes, such as `data-orientation`, and its geometry through:
|
|
51
|
+
|
|
52
|
+
- `--media-slider-marker-start`
|
|
53
|
+
- `--media-slider-marker-end`
|
|
54
|
+
- `--media-slider-marker-width`, the marker’s size along the slider, `0%` for a point
|
|
55
|
+
|
|
56
|
+
Markers are unstyled. Position each one from its custom properties, and give points a visible width:
|
|
57
|
+
|
|
58
|
+
```css
|
|
59
|
+
media-time-slider-markers > div {
|
|
60
|
+
position: absolute;
|
|
61
|
+
inset-block: 0;
|
|
62
|
+
left: var(--media-slider-marker-start);
|
|
63
|
+
width: var(--media-slider-marker-width);
|
|
64
|
+
min-width: 4px;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
media-time-slider-markers > [data-active] {
|
|
68
|
+
background: orange;
|
|
69
|
+
}
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## Accessibility
|
|
73
|
+
|
|
74
|
+
The markers render with `aria-hidden="true"`; the slider’s value is what assistive technology reads. When a marker carries meaning a viewer needs, such as an upcoming ad break, convey it another way too.
|
|
75
|
+
|
|
76
|
+
## Examples
|
|
77
|
+
|
|
78
|
+
### Basic usage
|
|
79
|
+
|
|
80
|
+
An app track labeled `ads` holds a point at 8 seconds and a range from 18 to 24 seconds. A marker turns orange while its cue is active.
|
|
81
|
+
|
|
82
|
+
**index.html**
|
|
83
|
+
|
|
84
|
+
```html
|
|
85
|
+
<video-player class="html-time-slider-markers-basic">
|
|
86
|
+
<media-container class="html-time-slider-markers-basic__container">
|
|
87
|
+
<video src="https://stream.mux.com/BV3YZtogl89mg9VcNBhhnHm02Y34zI1nlMuMQfAbl3dM/highest.mp4" autoplay muted playsinline loop></video>
|
|
88
|
+
<media-time-slider class="html-time-slider-markers-basic__slider">
|
|
89
|
+
<media-slider-track class="html-time-slider-markers-basic__track">
|
|
90
|
+
<media-slider-fill class="html-time-slider-markers-basic__fill"></media-slider-fill>
|
|
91
|
+
</media-slider-track>
|
|
92
|
+
<media-time-slider-markers label="ads" class="html-time-slider-markers-basic__markers">
|
|
93
|
+
<template>
|
|
94
|
+
<div class="html-time-slider-markers-basic__marker"></div>
|
|
95
|
+
</template>
|
|
96
|
+
</media-time-slider-markers>
|
|
97
|
+
<media-slider-thumb class="html-time-slider-markers-basic__thumb"></media-slider-thumb>
|
|
98
|
+
</media-time-slider>
|
|
99
|
+
</media-container>
|
|
100
|
+
</video-player>
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
**index.css**
|
|
104
|
+
|
|
105
|
+
```css
|
|
106
|
+
.html-time-slider-markers-basic__container {
|
|
107
|
+
position: relative;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.html-time-slider-markers-basic__container video {
|
|
111
|
+
width: 100%;
|
|
112
|
+
aspect-ratio: 16 / 9;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.html-time-slider-markers-basic__slider {
|
|
116
|
+
position: absolute;
|
|
117
|
+
right: 12px;
|
|
118
|
+
bottom: 12px;
|
|
119
|
+
left: 12px;
|
|
120
|
+
display: flex;
|
|
121
|
+
align-items: center;
|
|
122
|
+
height: 20px;
|
|
123
|
+
cursor: pointer;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.html-time-slider-markers-basic__track,
|
|
127
|
+
.html-time-slider-markers-basic__markers {
|
|
128
|
+
position: absolute;
|
|
129
|
+
right: 0;
|
|
130
|
+
left: 0;
|
|
131
|
+
height: 4px;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.html-time-slider-markers-basic__track {
|
|
135
|
+
overflow: hidden;
|
|
136
|
+
background: rgba(255, 255, 255, 0.3);
|
|
137
|
+
border-radius: 9999px;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.html-time-slider-markers-basic__fill {
|
|
141
|
+
position: absolute;
|
|
142
|
+
inset-block: 0;
|
|
143
|
+
left: 0;
|
|
144
|
+
width: var(--media-slider-fill);
|
|
145
|
+
background: white;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.html-time-slider-markers-basic__marker {
|
|
149
|
+
position: absolute;
|
|
150
|
+
inset-block: 0;
|
|
151
|
+
left: var(--media-slider-marker-start);
|
|
152
|
+
width: var(--media-slider-marker-width);
|
|
153
|
+
min-width: 4px;
|
|
154
|
+
background: #facc15;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
.html-time-slider-markers-basic__marker[data-point] {
|
|
158
|
+
transform: translateX(-50%);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
.html-time-slider-markers-basic__marker[data-active] {
|
|
162
|
+
background: #f97316;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
.html-time-slider-markers-basic__thumb {
|
|
166
|
+
position: absolute;
|
|
167
|
+
left: var(--media-slider-fill);
|
|
168
|
+
width: 12px;
|
|
169
|
+
height: 12px;
|
|
170
|
+
background: white;
|
|
171
|
+
border-radius: 50%;
|
|
172
|
+
transform: translateX(-50%);
|
|
173
|
+
}
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
**index.ts**
|
|
177
|
+
|
|
178
|
+
```ts
|
|
179
|
+
import '@videojs/html/video/player';
|
|
180
|
+
import '@videojs/html/ui/container';
|
|
181
|
+
import '@videojs/html/ui/time-slider';
|
|
182
|
+
import '@videojs/html/ui/slider-track';
|
|
183
|
+
import '@videojs/html/ui/slider-fill';
|
|
184
|
+
import '@videojs/html/ui/slider-thumb';
|
|
185
|
+
import '@videojs/html/ui/time-slider-markers';
|
|
186
|
+
|
|
187
|
+
const player = document.querySelector('video-player');
|
|
188
|
+
|
|
189
|
+
player?.store.addTextTrack({
|
|
190
|
+
kind: 'metadata',
|
|
191
|
+
label: 'ads',
|
|
192
|
+
cues: [{ startTime: 8 }, { startTime: 18, endTime: 24 }],
|
|
193
|
+
});
|
|
194
|
+
```
|
|
@@ -50,6 +50,8 @@ Add `<media-time-slider-chapters>` to divide the slider track into sections. Eac
|
|
|
50
50
|
|
|
51
51
|
The required template must contain exactly one HTML root element. It remains in the light DOM and is cloned for each normalized chapter range. When no chapter cues are available, it is cloned once as a full-width, cue-less range.
|
|
52
52
|
|
|
53
|
+
To draw a marker for each cue on a text track, such as an ad break, add the markers element, documented on its own page as [media-time-slider-markers](./time-slider-markers.md).
|
|
54
|
+
|
|
53
55
|
## Behavior
|
|
54
56
|
|
|
55
57
|
Displays and controls the current playback position. Dragging the slider seeks the media. The fill level reflects `currentTime / duration` as a percentage, and the buffer level shows how much media has been buffered.
|
|
@@ -483,6 +485,18 @@ Clones a light-DOM template once per normalized chapter range.
|
|
|
483
485
|
|
|
484
486
|
The required template must contain exactly one HTML root element. When no chapter cues are available, the template is cloned once for a full-duration range.
|
|
485
487
|
|
|
488
|
+
### media-time-slider-markers
|
|
489
|
+
|
|
490
|
+
Draws a marker on the time slider for each cue on the text tracks a filter matches, such as ad breaks. Pick tracks with the `kind`, `label`, and `language` attributes, or with the `filter` property; with neither, nothing is drawn. The store reads the matching tracks while the element is connected, so tracks it doesn't read by default work too.
|
|
491
|
+
|
|
492
|
+
Each marker clones the light-DOM template, which must contain exactly one HTML root element, or is a `<div>` without one. Markers are decorative: the slider's own value is what assistive technology reads.
|
|
493
|
+
|
|
494
|
+
#### Data attributes
|
|
495
|
+
|
|
496
|
+
| Attribute | Description |
|
|
497
|
+
| --- | --- |
|
|
498
|
+
| `data-seeking` | Present when a seek operation is in progress. |
|
|
499
|
+
|
|
486
500
|
### media-slider-buffer
|
|
487
501
|
|
|
488
502
|
Displays the buffered range on the slider track.
|
|
@@ -17,7 +17,7 @@ import '@videojs/html/media/twitch-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/twitch-video.js"></script>
|
|
21
21
|
```
|
|
22
22
|
|
|
23
23
|
## Load a source
|
|
@@ -52,7 +52,7 @@ video.source = {
|
|
|
52
52
|
## Behavior
|
|
53
53
|
|
|
54
54
|
- Volume and mute both work, like a native `<video>`.
|
|
55
|
-
-
|
|
55
|
+
- No playback rate: the embed has no rate command, so the player hides its rate controls.
|
|
56
56
|
- `loop` restarts a finished video from the top; the embed has no loop parameter.
|
|
57
57
|
- `controls` is read when the embed is built; changing it later doesn’t take effect, since rebuilding the iframe would lose the playback session.
|
|
58
58
|
- Fullscreen targets the iframe, so Twitch’s own chrome shows in fullscreen.
|
|
@@ -117,7 +117,6 @@ These attributes configure the embedded media adapter:
|
|
|
117
117
|
| `loop` | `boolean` | `false` | |
|
|
118
118
|
| `muted` | `boolean` | `false` | |
|
|
119
119
|
| `paused` | `boolean` | — | Read-only. |
|
|
120
|
-
| `playbackRate` | `number` | — | |
|
|
121
120
|
| `played` | `{ length: number; start(index: number): number; end(index: number): number }` | — | Read-only. |
|
|
122
121
|
| `playsInline` | `boolean` | `true` | |
|
|
123
122
|
| `poster` | `string` | `''` | |
|