@videojs/html 10.3.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 +91 -38
- package/dist/default/define/audio/compat-skin2.js +1 -1
- package/dist/default/define/audio/neutral-skin.css +52 -31
- package/dist/default/define/audio/neutral-skin2.js +1 -1
- package/dist/default/define/audio/scaffold-skin.css +105 -40
- package/dist/default/define/audio/scaffold-skin2.js +1 -1
- package/dist/default/define/audio/skin.css +53 -31
- package/dist/default/define/audio/skin2.js +1 -1
- package/dist/default/define/live-audio/compat-skin.css +91 -38
- package/dist/default/define/live-audio/compat-skin2.js +1 -1
- package/dist/default/define/live-audio/neutral-skin.css +50 -29
- package/dist/default/define/live-audio/neutral-skin2.js +1 -1
- package/dist/default/define/live-audio/scaffold-skin.css +105 -40
- package/dist/default/define/live-audio/scaffold-skin2.js +1 -1
- package/dist/default/define/live-audio/skin.css +51 -29
- package/dist/default/define/live-audio/skin2.js +1 -1
- package/dist/default/define/live-video/compat-skin.css +142 -61
- package/dist/default/define/live-video/compat-skin2.js +1 -1
- package/dist/default/define/live-video/neutral-skin.css +241 -55
- package/dist/default/define/live-video/neutral-skin2.js +1 -1
- package/dist/default/define/live-video/scaffold-skin.css +159 -63
- package/dist/default/define/live-video/scaffold-skin2.js +1 -1
- package/dist/default/define/live-video/skin.css +245 -60
- package/dist/default/define/live-video/skin2.js +1 -1
- package/dist/default/define/ui/time-slider-markers.js +5 -0
- package/dist/default/define/video/compat-skin.css +150 -61
- package/dist/default/define/video/compat-skin2.js +1 -1
- package/dist/default/define/video/neutral-skin.css +322 -66
- package/dist/default/define/video/neutral-skin2.js +1 -1
- package/dist/default/define/video/scaffold-skin.css +168 -63
- package/dist/default/define/video/scaffold-skin2.js +1 -1
- package/dist/default/define/video/skin.css +348 -66
- package/dist/default/define/video/skin2.js +1 -1
- package/dist/default/index.js +3 -1
- package/dist/default/internal/skins/compat-audio/skin.css +91 -38
- package/dist/default/internal/skins/compat-live-audio/skin.css +91 -38
- package/dist/default/internal/skins/compat-live-video/skin.css +142 -61
- package/dist/default/internal/skins/compat-live-video/template.js +2 -0
- package/dist/default/internal/skins/compat-video/skin.css +150 -61
- package/dist/default/internal/skins/compat-video/template.js +2 -0
- package/dist/default/internal/skins/default-audio/skin.css +53 -31
- package/dist/default/internal/skins/default-live-audio/skin.css +51 -29
- package/dist/default/internal/skins/default-live-video/skin.css +245 -60
- 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 +348 -66
- package/dist/default/internal/skins/default-video/template.js +33 -5
- package/dist/default/internal/skins/neutral-audio/skin.css +52 -31
- package/dist/default/internal/skins/neutral-live-audio/skin.css +50 -29
- package/dist/default/internal/skins/neutral-live-video/skin.css +241 -55
- package/dist/default/internal/skins/neutral-live-video/template.js +14 -0
- package/dist/default/internal/skins/neutral-video/skin.css +322 -66
- package/dist/default/internal/skins/neutral-video/template.js +25 -11
- package/dist/default/internal/skins/scaffold-audio/skin.css +105 -40
- package/dist/default/internal/skins/scaffold-live-audio/skin.css +105 -40
- package/dist/default/internal/skins/scaffold-live-video/skin.css +159 -63
- package/dist/default/internal/skins/scaffold-live-video/template.js +2 -0
- package/dist/default/internal/skins/scaffold-video/skin.css +168 -63
- 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/hls-background-video/adapter.js +16 -35
- package/dist/default/ui/captions-radio-group/element.js +14 -1
- package/dist/default/ui/controls/element.js +6 -3
- 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 +91 -38
- 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 +52 -31
- 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 +105 -40
- 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 +53 -31
- package/dist/dev/define/audio/skin2.js +1 -1
- package/dist/dev/define/audio/skin2.js.map +1 -1
- package/dist/dev/define/live-audio/compat-skin.css +91 -38
- 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 +50 -29
- 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 +105 -40
- 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 +51 -29
- 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 +142 -61
- 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 +241 -55
- 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 +159 -63
- 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 +245 -60
- 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/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 +150 -61
- 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 +322 -66
- 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 +168 -63
- 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 +348 -66
- package/dist/dev/define/video/skin2.js +1 -1
- package/dist/dev/define/video/skin2.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 +91 -38
- package/dist/dev/internal/skins/compat-live-audio/skin.css +91 -38
- package/dist/dev/internal/skins/compat-live-video/skin.css +142 -61
- 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 +150 -61
- 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 +53 -31
- package/dist/dev/internal/skins/default-live-audio/skin.css +51 -29
- package/dist/dev/internal/skins/default-live-video/register.js.map +1 -1
- package/dist/dev/internal/skins/default-live-video/skin.css +245 -60
- 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 +348 -66
- 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 +52 -31
- package/dist/dev/internal/skins/neutral-live-audio/skin.css +50 -29
- package/dist/dev/internal/skins/neutral-live-video/register.js.map +1 -1
- package/dist/dev/internal/skins/neutral-live-video/skin.css +241 -55
- 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 +322 -66
- 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 +105 -40
- package/dist/dev/internal/skins/scaffold-live-audio/skin.css +105 -40
- package/dist/dev/internal/skins/scaffold-live-video/skin.css +159 -63
- 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 +168 -63
- 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/hls-background-video/adapter.d.ts +8 -18
- package/dist/dev/media/hls-background-video/adapter.js +16 -35
- package/dist/dev/media/hls-background-video/adapter.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/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 +1 -1
- package/docs/guides/background-video.md +2 -4
- package/docs/guides/browser-support.md +22 -16
- package/docs/guides/cdn.md +9 -9
- package/docs/guides/customize-skins.md +3 -0
- package/docs/guides/installation-cdn.md +2 -2
- package/docs/guides/installation-shadcn.md +1 -1
- package/docs/guides/installation-svelte.md +2 -2
- package/docs/guides/installation-vue.md +2 -2
- package/docs/guides/installation.md +2 -2
- package/docs/guides/internationalization.md +5 -5
- package/docs/guides/keyboard-shortcuts.md +10 -0
- package/docs/guides/llms.txt +2 -1
- package/docs/guides/migrate-from-media-chrome.md +4 -4
- package/docs/guides/migrate-from-mux-player.md +6 -6
- package/docs/guides/migrate-from-plyr.md +7 -7
- package/docs/guides/migrate-from-video-js-8.md +6 -6
- package/docs/guides/migrate-from-vidstack.md +4 -4
- package/docs/guides/presets.md +4 -4
- package/docs/guides/self-hosting.md +5 -5
- package/docs/guides/skins.md +8 -7
- package/docs/guides/timed-metadata.md +318 -0
- package/docs/llms.txt +16 -2
- package/docs/reference/api/chapters-track.md +71 -0
- package/docs/reference/api/define-text-track.md +113 -0
- 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 +9 -4
- package/docs/reference/api/preset-audio.md +3 -1
- package/docs/reference/api/preset-background.md +1 -1
- package/docs/reference/api/preset-live-audio.md +3 -1
- package/docs/reference/api/preset-live-video.md +2 -1
- package/docs/reference/api/preset-video.md +2 -1
- package/docs/reference/components/audio-compat-skin.md +1 -1
- package/docs/reference/components/audio-neutral-skin.md +1 -1
- package/docs/reference/components/audio-scaffold-skin.md +1 -1
- package/docs/reference/components/audio-skin.md +1 -1
- 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/captions-radio-group.md +1 -1
- package/docs/reference/components/cloudflare-video.md +1 -1
- package/docs/reference/components/controls.md +16 -3
- package/docs/reference/components/dailymotion-video.md +2 -2
- package/docs/reference/components/dash-video.md +20 -3
- package/docs/reference/components/google-analytics.md +1 -1
- 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 +22 -5
- package/docs/reference/components/hls-video.md +99 -7
- package/docs/reference/components/hlsjs-video.md +52 -13
- package/docs/reference/components/live-audio-compat-skin.md +1 -1
- package/docs/reference/components/live-audio-neutral-skin.md +1 -1
- package/docs/reference/components/live-audio-scaffold-skin.md +1 -1
- package/docs/reference/components/live-audio-skin.md +1 -1
- package/docs/reference/components/live-video-compat-skin.md +5 -1
- package/docs/reference/components/live-video-neutral-skin.md +5 -1
- package/docs/reference/components/live-video-scaffold-skin.md +5 -1
- package/docs/reference/components/live-video-skin.md +5 -1
- package/docs/reference/components/llms.txt +2 -1
- package/docs/reference/components/mixcloud-audio.md +2 -2
- package/docs/reference/components/mux-audio.md +34 -3
- package/docs/reference/components/mux-background-video.md +1 -1
- package/docs/reference/components/mux-data.md +1 -1
- package/docs/reference/components/mux-video.md +17 -3
- package/docs/reference/components/native-hls-video.md +32 -3
- package/docs/reference/components/playerjs-video.md +2 -2
- package/docs/reference/components/shaka-video.md +2 -3
- package/docs/reference/components/soundcloud-audio.md +2 -2
- package/docs/reference/components/spotify-audio.md +2 -2
- package/docs/reference/components/tiktok-video.md +2 -2
- 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 +1 -1
- package/docs/reference/components/video-compat-skin.md +5 -1
- package/docs/reference/components/video-neutral-skin.md +5 -1
- package/docs/reference/components/video-scaffold-skin.md +5 -1
- package/docs/reference/components/video-skin.md +5 -1
- package/docs/reference/components/video.md +19 -1
- package/docs/reference/components/vimeo-video.md +1 -2
- package/docs/reference/components/wistia-video.md +1 -1
- package/docs/reference/components/youtube-video.md +1 -2
- package/package.json +48 -48
|
@@ -13,7 +13,7 @@ import '@videojs/html/audio/compat-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/audio-compat.js"></script>
|
|
17
17
|
```
|
|
18
18
|
|
|
19
19
|
## Anatomy
|
|
@@ -13,7 +13,7 @@ import '@videojs/html/audio/neutral-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/audio-neutral.js"></script>
|
|
17
17
|
```
|
|
18
18
|
|
|
19
19
|
## Anatomy
|
|
@@ -13,7 +13,7 @@ import '@videojs/html/audio/scaffold-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/audio-scaffold.js"></script>
|
|
17
17
|
```
|
|
18
18
|
|
|
19
19
|
## Usage
|
|
@@ -13,7 +13,7 @@ import '@videojs/html/audio/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/audio.js"></script>
|
|
17
17
|
```
|
|
18
18
|
|
|
19
19
|
## Anatomy
|
|
@@ -70,4 +70,22 @@ This native audio element uses a child source and browser controls while providi
|
|
|
70
70
|
```ts
|
|
71
71
|
import '@videojs/html/audio/player';
|
|
72
72
|
import '@videojs/html/ui/container';
|
|
73
|
-
```
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## API Reference
|
|
76
|
+
|
|
77
|
+
### Attributes
|
|
78
|
+
|
|
79
|
+
Accepts the standard `<audio>` attributes. See the [MDN `<audio>` reference](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/audio): `autoplay`, `controls`, `controlslist`, `crossorigin`, `disableremoteplayback`, `loop`, `muted`, `preload`, `src`.
|
|
80
|
+
|
|
81
|
+
### Properties
|
|
82
|
+
|
|
83
|
+
Exposes the native media properties. See [`HTMLAudioElement`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLAudioElement) for details: `autoplay`, `buffered`, `controls`, `crossOrigin`, `currentSrc`, `currentTime`, `defaultMuted`, `defaultPlaybackRate`, `disableRemotePlayback`, `duration`, `ended`, `error`, `loop`, `mediaKeys`, `muted`, `networkState`, `paused`, `playbackRate`, `played`, `preload`, `preservesPitch`, `readyState`, `remote`, `seekable`, `seeking`, `sinkId`, `src`, `srcObject`, `textTracks`, `volume`.
|
|
84
|
+
|
|
85
|
+
### Methods
|
|
86
|
+
|
|
87
|
+
Supports the native media methods. See [`HTMLAudioElement`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLAudioElement) for details: `addTextTrack`, `canPlayType`, `fastSeek`, `load`, `pause`, `play`, `setMediaKeys`, `setSinkId`.
|
|
88
|
+
|
|
89
|
+
### Events
|
|
90
|
+
|
|
91
|
+
Fires the standard media events: `abort`, `canplay`, `canplaythrough`, `durationchange`, `emptied`, `encrypted`, `ended`, `error`, `loadeddata`, `loadedmetadata`, `loadstart`, `pause`, `play`, `playing`, `progress`, `ratechange`, `seeked`, `seeking`, `stalled`, `suspend`, `timeupdate`, `volumechange`, `waiting`, `waitingforkey`.
|
|
@@ -13,7 +13,7 @@ import '@videojs/html/background/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/background.js"></script>
|
|
17
17
|
```
|
|
18
18
|
|
|
19
19
|
## Anatomy
|
|
@@ -4,7 +4,7 @@ Decorative background video element with automatic muting and looping
|
|
|
4
4
|
|
|
5
5
|
Decorative background video for a source the browser can play natively. By default it’s muted, looped, and autoplaying.
|
|
6
6
|
|
|
7
|
-
`<background-video>` renders a `<video>` inside shadow DOM and fills the box you give the component. Use the opt-out attributes in the [API
|
|
7
|
+
`<background-video>` renders a `<video>` inside shadow DOM and fills the box you give the component. Use the opt-out attributes in the [API](#api) to change its playback defaults.
|
|
8
8
|
|
|
9
9
|
An HLS URL only works where the browser has native HLS playback. See [Add a background video](../../guides/background-video.md) to choose a cross-browser HLS or Mux path and set up layout, poster, and decorative semantics.
|
|
10
10
|
|
|
@@ -17,7 +17,7 @@ import '@videojs/html/media/background-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/background-video.js"></script>
|
|
21
21
|
```
|
|
22
22
|
|
|
23
23
|
## Examples
|
|
@@ -48,20 +48,35 @@ Or load it from the [CDN](../../guides/cdn.md):
|
|
|
48
48
|
import '@videojs/html/media/background-video';
|
|
49
49
|
```
|
|
50
50
|
|
|
51
|
-
## API
|
|
51
|
+
## API
|
|
52
52
|
|
|
53
53
|
### Attributes
|
|
54
54
|
|
|
55
55
|
| Attribute | Description |
|
|
56
56
|
| --- | --- |
|
|
57
|
-
| `src` | URL of a video the browser can play directly, such as an MP4 or WebM file
|
|
58
|
-
| `nomuted` |
|
|
59
|
-
| `noloop` |
|
|
60
|
-
| `noautoplay` |
|
|
57
|
+
| `src` | URL of a video the browser can play directly, such as an MP4 or WebM file |
|
|
58
|
+
| `nomuted` | Turns off muting |
|
|
59
|
+
| `noloop` | Turns off looping |
|
|
60
|
+
| `noautoplay` | Turns off autoplay |
|
|
61
|
+
| `crossorigin`, `preload`, `controls`, `controlslist` | Passed through to the inner video |
|
|
61
62
|
|
|
62
|
-
|
|
63
|
+
An explicit `muted`, `loop`, or `autoplay` attribute wins over its opt-out. Opt-outs and passed-through attributes also apply when set or changed after the element is created.
|
|
63
64
|
|
|
64
|
-
|
|
65
|
+
### Properties
|
|
66
|
+
|
|
67
|
+
| Property | Description |
|
|
68
|
+
| --- | --- |
|
|
69
|
+
| `src` | URL of the video. Assigning a new one restarts playback |
|
|
70
|
+
| `error` | The inner video’s `MediaError`, or `null` |
|
|
71
|
+
| `target` | Inner native `<video>` element. Call `play()` and `pause()` on it |
|
|
72
|
+
|
|
73
|
+
The element also fires an `error` event when the inner video does.
|
|
74
|
+
|
|
75
|
+
## Styling
|
|
76
|
+
|
|
77
|
+
| Custom property | Default | Description |
|
|
65
78
|
| --- | --- | --- |
|
|
66
|
-
| `--media-object-fit` | `inherit` |
|
|
67
|
-
| `--media-object-position` | `50% 50%` |
|
|
79
|
+
| `--media-object-fit` | `inherit` | How the video fits its box |
|
|
80
|
+
| `--media-object-position` | `50% 50%` | Position of the video within its box |
|
|
81
|
+
|
|
82
|
+
Set an explicit size on the custom element or an author-owned wrapper.
|
|
@@ -175,7 +175,7 @@ import '@videojs/html/ui/captions-radio-group';
|
|
|
175
175
|
|
|
176
176
|
### media-captions-radio-group
|
|
177
177
|
|
|
178
|
-
Menu radio group that generates an Off `<media-menu-radio-item>` plus one per captions and subtitles track, and shares the selected label and availability with an enclosing menu. An optional `<template>` holding one `<media-menu-radio-item>` customizes each generated item.
|
|
178
|
+
Menu radio group that generates an Off `<media-menu-radio-item>` plus one per captions and subtitles track, and shares the selected label and availability with an enclosing menu. An optional `<template>` holding one `<media-menu-radio-item>` customizes each generated item; its `data-part` `label` and `badge` descendants receive the track's text.
|
|
179
179
|
|
|
180
180
|
#### Props
|
|
181
181
|
|
|
@@ -17,7 +17,7 @@ import '@videojs/html/media/cloudflare-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/cloudflare-video.js"></script>
|
|
21
21
|
```
|
|
22
22
|
|
|
23
23
|
## Load a source
|
|
@@ -30,6 +30,8 @@ If the user is active, or if the video is paused, this component will show contr
|
|
|
30
30
|
|
|
31
31
|
User activity is tracked via pointer movement, keyboard input, and focus events on the player container. On touch devices, a quick tap toggles visibility. `mouseleave` immediately sets the user as inactive.
|
|
32
32
|
|
|
33
|
+
The controls also report whether playback has started, with `data-started`. A pending autoplay counts as started, matching the play button. Pausing does not clear it.
|
|
34
|
+
|
|
33
35
|
`visibility` selects between the two modes. The default, `auto`, follows the player’s controls visibility state as described above. `always` keeps the controls visible and reports the user as active regardless of playback or idle state, and works without the controls feature. The idle delay itself is not configurable.
|
|
34
36
|
|
|
35
37
|
```html
|
|
@@ -44,7 +46,7 @@ User activity is tracked via pointer movement, keyboard input, and focus events
|
|
|
44
46
|
|
|
45
47
|
`<media-controls-backdrop>` is an optional presentational sibling of `<media-controls-content>`. It receives the same controls state data attributes, allowing its styling and transitions to be authored independently from the controls surface.
|
|
46
48
|
|
|
47
|
-
The controls parts ship no styles. These example rules provide click-through and fade behavior:
|
|
49
|
+
The controls parts ship no styles. These example rules provide click-through and fade behavior, and keep the controls hidden until playback starts. Use `visibility` rather than `opacity` for that last rule, so the hidden controls can’t receive focus:
|
|
48
50
|
|
|
49
51
|
```css
|
|
50
52
|
/* Click-through: clicks pass through controls to video beneath */
|
|
@@ -74,6 +76,12 @@ media-controls-content:not([data-visible]) {
|
|
|
74
76
|
media-controls-backdrop:not([data-visible]) {
|
|
75
77
|
opacity: 0;
|
|
76
78
|
}
|
|
79
|
+
|
|
80
|
+
/* Hide the controls until playback starts */
|
|
81
|
+
media-controls-content:not([data-started]),
|
|
82
|
+
media-controls-backdrop:not([data-started]) {
|
|
83
|
+
visibility: hidden;
|
|
84
|
+
}
|
|
77
85
|
```
|
|
78
86
|
|
|
79
87
|
## Accessibility
|
|
@@ -208,7 +216,7 @@ import '@videojs/html/ui/time';
|
|
|
208
216
|
|
|
209
217
|
### media-controls
|
|
210
218
|
|
|
211
|
-
Tracks controls visibility, reflects
|
|
219
|
+
Tracks controls visibility and whether playback has started, reflects them as data attributes, and shares them with its descendant controls parts. Hiding the controls closes any popup open inside it.
|
|
212
220
|
|
|
213
221
|
#### Props
|
|
214
222
|
|
|
@@ -224,6 +232,7 @@ State is reflected as data attributes for CSS styling.
|
|
|
224
232
|
| --- | --- | --- |
|
|
225
233
|
| `visible` | `boolean` | Whether the controls are visible. |
|
|
226
234
|
| `userActive` | `boolean` | Whether the user has recently interacted with the player. |
|
|
235
|
+
| `started` | `boolean` | Whether playback has started or the media is trying to autoplay. |
|
|
227
236
|
|
|
228
237
|
#### Data attributes
|
|
229
238
|
|
|
@@ -231,6 +240,7 @@ State is reflected as data attributes for CSS styling.
|
|
|
231
240
|
| --- | --- |
|
|
232
241
|
| `data-visible` | Present when controls are visible. |
|
|
233
242
|
| `data-user-active` | Present when the user has recently interacted. |
|
|
243
|
+
| `data-started` | Present when playback has started or the media is trying to autoplay. |
|
|
234
244
|
|
|
235
245
|
### media-controls-backdrop
|
|
236
246
|
|
|
@@ -242,6 +252,7 @@ Presentational backdrop that reflects its owning controls surface's state.
|
|
|
242
252
|
| --- | --- |
|
|
243
253
|
| `data-visible` | Present when controls are visible. |
|
|
244
254
|
| `data-user-active` | Present when the user has recently interacted. |
|
|
255
|
+
| `data-started` | Present when playback has started or the media is trying to autoplay. |
|
|
245
256
|
|
|
246
257
|
### media-controls-content
|
|
247
258
|
|
|
@@ -253,6 +264,7 @@ Interactive surface that reflects its owning controls state.
|
|
|
253
264
|
| --- | --- |
|
|
254
265
|
| `data-visible` | Present when controls are visible. |
|
|
255
266
|
| `data-user-active` | Present when the user has recently interacted. |
|
|
267
|
+
| `data-started` | Present when playback has started or the media is trying to autoplay. |
|
|
256
268
|
|
|
257
269
|
### media-controls-group
|
|
258
270
|
|
|
@@ -263,4 +275,5 @@ Layout group for related controls; sets `role="group"` when labeled.
|
|
|
263
275
|
| Attribute | Description |
|
|
264
276
|
| --- | --- |
|
|
265
277
|
| `data-visible` | Present when controls are visible. |
|
|
266
|
-
| `data-user-active` | Present when the user has recently interacted. |
|
|
278
|
+
| `data-user-active` | Present when the user has recently interacted. |
|
|
279
|
+
| `data-started` | Present when playback has started or the media is trying to autoplay. |
|
|
@@ -21,7 +21,7 @@ import '@videojs/html/media/dailymotion-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/dailymotion-video.js"></script>
|
|
25
25
|
```
|
|
26
26
|
|
|
27
27
|
## Load a source
|
|
@@ -157,7 +157,7 @@ These attributes configure the embedded media adapter:
|
|
|
157
157
|
| `seeking` | `boolean` | — | Read-only. |
|
|
158
158
|
| `source` | `{ src?: string; engine?: DailymotionSourceEngineConfig } \| null` | `null` | Dailymotion video URL in `src`, player configuration and parameters under `engine.dailymotion`. |
|
|
159
159
|
| `src` | `string` | `''` | |
|
|
160
|
-
| `textTracks` | `TextTrackListLike` | — | Read-only.
|
|
160
|
+
| `textTracks` | `TextTrackListLike` | — | Read-only. Unsupported: the player draws its own subtitles and reports no cues to render elsewhere. |
|
|
161
161
|
| `volume` | `number` | — | |
|
|
162
162
|
|
|
163
163
|
### Engine options
|
|
@@ -21,7 +21,25 @@ import '@videojs/html/media/dash-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/dash-video.js"></script>
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Load a source
|
|
28
|
+
|
|
29
|
+
`src` takes a DASH manifest (MPD) URL.
|
|
30
|
+
|
|
31
|
+
```html
|
|
32
|
+
<dash-video src="https://example.com/manifest.mpd"></dash-video>
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
The structured `source` object pairs the URL with dash.js settings under `engine.dashJs`. Setting `source` derives `src`, and changing `engine.dashJs` applies the settings to the running player instead of recreating it.
|
|
36
|
+
|
|
37
|
+
```ts
|
|
38
|
+
const video = document.querySelector('dash-video')!;
|
|
39
|
+
video.source = {
|
|
40
|
+
src: 'https://example.com/manifest.mpd',
|
|
41
|
+
engine: { dashJs: { streaming: { buffer: { bufferTimeAtTopQuality: 30 } } } },
|
|
42
|
+
};
|
|
25
43
|
```
|
|
26
44
|
|
|
27
45
|
## Examples
|
|
@@ -75,7 +93,6 @@ These Video.js-specific attributes configure media behavior:
|
|
|
75
93
|
| `isFullscreen` | `boolean` | — | Read-only. |
|
|
76
94
|
| `isPictureInPicture` | `boolean` | — | Read-only. |
|
|
77
95
|
| `liveEdgeStart` | `number` | — | Read-only. |
|
|
78
|
-
| `playbackRateRange` | `{ min: number; max: number } \| undefined` | — | Read-only. The target's narrower rate range, when it reports one; native media accept the browser's range. |
|
|
79
96
|
| `source` | `{ src?: string; engine?: DashEngineConfig } \| null` | `null` | Structured source: the MPD URL in `src`, plus dash.js settings in `engine.dashJs`. Replacing it re-derives `src`. Dash.js takes settings on a live player, so changing `engine.dashJs` re-applies them in place instead of recreating the engine. |
|
|
80
97
|
| `src` | `string` | `''` | |
|
|
81
98
|
| `streamType` | `MediaStreamType` | — | Current stream type (`'on-demand'`, `'live'`, or `'unknown'`). Defaults to `'unknown'`; detecting hosts update it automatically, and consumers can set it to override detection. |
|
|
@@ -88,7 +105,7 @@ Also exposes these properties from the native media API. See [HTMLVideoElement](
|
|
|
88
105
|
|
|
89
106
|
### Methods
|
|
90
107
|
|
|
91
|
-
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`.
|
|
108
|
+
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`.
|
|
92
109
|
|
|
93
110
|
### Events
|
|
94
111
|
|
|
@@ -17,7 +17,7 @@ import '@videojs/html/extensions/google-analytics';
|
|
|
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/google-analytics.js"></script>
|
|
21
21
|
```
|
|
22
22
|
|
|
23
23
|
## Anatomy
|
|
@@ -17,7 +17,7 @@ import '@videojs/html/extensions/google-cast';
|
|
|
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/google-cast.js"></script>
|
|
21
21
|
```
|
|
22
22
|
|
|
23
23
|
## Anatomy
|
|
@@ -13,9 +13,19 @@ import '@videojs/html/media/hls-audio';
|
|
|
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/hls-audio.js"></script>
|
|
17
17
|
```
|
|
18
18
|
|
|
19
|
+
## Load a source
|
|
20
|
+
|
|
21
|
+
`src` takes an HLS manifest URL. A mixed audio/video manifest works too: the audio component loads only the audio rendition.
|
|
22
|
+
|
|
23
|
+
```html
|
|
24
|
+
<hls-audio src="https://example.com/playlist.m3u8"></hls-audio>
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
The structured `source` object takes the same shape as the [HLS video component](./hls-video.md)’s, so one object can serve either. `source.drm` is accepted but unused, because this component composes no EME.
|
|
28
|
+
|
|
19
29
|
## Examples
|
|
20
30
|
|
|
21
31
|
### Basic Usage
|
|
@@ -39,4 +49,48 @@ Or load it from the [CDN](../../guides/cdn.md):
|
|
|
39
49
|
|
|
40
50
|
```ts
|
|
41
51
|
import '@videojs/html/media/hls-audio';
|
|
42
|
-
```
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## API Reference
|
|
55
|
+
|
|
56
|
+
### Attributes
|
|
57
|
+
|
|
58
|
+
Forwards these standard media attributes to the internal `<audio>`. See the [MDN media element reference](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/audio): `autopictureinpicture`, `autoplay`, `controls`, `controlslist`, `crossorigin`, `disablepictureinpicture`, `disableremoteplayback`, `loading`, `loop`, `muted`, `playsinline`, `poster`, `preload`, `src`.
|
|
59
|
+
|
|
60
|
+
These Video.js-specific attributes configure media behavior:
|
|
61
|
+
|
|
62
|
+
| Attribute | Type | Default | Description |
|
|
63
|
+
| --- | --- | --- | --- |
|
|
64
|
+
| `stream-type` | `MediaStreamType` | — | Current stream type (`'on-demand'`, `'live'`, or `'unknown'`). Defaults to `'unknown'`; detecting hosts update it automatically, and consumers can set it to override detection. |
|
|
65
|
+
|
|
66
|
+
### Properties
|
|
67
|
+
|
|
68
|
+
| Property | Type | Default | Description |
|
|
69
|
+
| --- | --- | --- | --- |
|
|
70
|
+
| `contentData` | `MediaContentData \| undefined` | — | Read-only. |
|
|
71
|
+
| `crossOrigin` | `'anonymous' \| 'use-credentials' \| null` | `null` | |
|
|
72
|
+
| `disableRemotePlayback` | `boolean` | `false` | |
|
|
73
|
+
| `error` | `{ code: number; message: string; data?: unknown } \| null` | — | Read-only. The current fatal error, or `null`. Only *fatal* conditions appear here — the engine reports non-fatal ones too, which stay in `engine.state.errors`. Resets per source. Fires `'error'` when set. |
|
|
74
|
+
| `liveEdgeStart` | `number` | — | Read-only. |
|
|
75
|
+
| `preload` | `'' \| 'none' \| 'metadata' \| 'auto'` | `''` | Preload type (`'none'` / `'metadata'` / `'auto'`). |
|
|
76
|
+
| `source` | `{ src?: string; type?: string; drm?: Partial<Record<string, DrmSystemConfig>> } \| null` | `null` | Structured source, the same shape the video flavor takes so one object serves either. `drm` is accepted and inert: this engine composes no EME. It is kept in the shape rather than removed so a source can be handed to both flavors — and because Mux encrypts video renditions and leaves audio clear, so a protected playback ID plays here regardless. |
|
|
77
|
+
| `src` | `string` | `''` | |
|
|
78
|
+
| `streamType` | `MediaStreamType` | — | Current stream type (`'on-demand'`, `'live'`, or `'unknown'`). Defaults to `'unknown'`; detecting hosts update it automatically, and consumers can set it to override detection. |
|
|
79
|
+
| `targetLiveWindow` | `number` | — | Read-only. |
|
|
80
|
+
|
|
81
|
+
Also exposes these properties from the native media API. See [HTMLAudioElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLAudioElement) for details: `autoplay`, `buffered`, `controls`, `currentSrc`, `currentTime`, `defaultMuted`, `defaultPlaybackRate`, `duration`, `ended`, `loop`, `muted`, `paused`, `playbackRate`, `played`, `readyState`, `remote`, `seekable`, `seeking`, `textTracks`, `title`, `volume`.
|
|
82
|
+
|
|
83
|
+
### Methods
|
|
84
|
+
|
|
85
|
+
Supports these media methods. See [HTMLAudioElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLAudioElement) for details: `addTextTrack`, `canPlayType`, `load`, `pause`, `play`, `removeTextTrack`.
|
|
86
|
+
|
|
87
|
+
### Events
|
|
88
|
+
|
|
89
|
+
Re-dispatches these standard media events from the internal media element: `abort`, `addtrack`, `canplay`, `canplaythrough`, `change`, `contentdatachange`, `durationchange`, `emptied`, `ended`, `loadeddata`, `loadedmetadata`, `loadstart`, `pause`, `play`, `playing`, `progress`, `ratechange`, `removetrack`, `seeked`, `seeking`, `stalled`, `suspend`, `timeupdate`, `volumechange`, `waiting`.
|
|
90
|
+
|
|
91
|
+
Also emits these Video.js-specific events:
|
|
92
|
+
|
|
93
|
+
| Event | Description |
|
|
94
|
+
| --- | --- |
|
|
95
|
+
| `error` | Fired when a fatal condition is reported. Read `error` for it. |
|
|
96
|
+
| `sourcechange` | Fired when `source` changes. Read `source` for the new value. |
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
HLS background video without controls, audio, captions, or adaptive quality
|
|
4
4
|
|
|
5
|
-
`<hls-background-video>` plays an HLS source through the SPF background engine. It is fixed to muted,
|
|
5
|
+
`<hls-background-video>` plays an HLS source through the SPF background engine. It is fixed to muted, inline playback, loops and autoplays unless you set `noloop` or `noautoplay`, and omits controls, audio, text, DRM, and adaptive rendition switching.
|
|
6
6
|
|
|
7
7
|
See [Add a background video](../../guides/background-video.md) for layout, poster, accessibility, and source-choice guidance.
|
|
8
8
|
|
|
@@ -15,7 +15,7 @@ import '@videojs/html/media/hls-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/hls-background-video.js"></script>
|
|
19
19
|
```
|
|
20
20
|
|
|
21
21
|
## Source behavior
|
|
@@ -29,15 +29,32 @@ Or load it from the [CDN](../../guides/cdn.md):
|
|
|
29
29
|
></hls-background-video>
|
|
30
30
|
```
|
|
31
31
|
|
|
32
|
-
There is no `source` object, `preload` mode, or opt-out for muted
|
|
32
|
+
There is no `source` object, `preload` mode, or opt-out for muted. Assigning a new `src` restarts playback from scratch.
|
|
33
|
+
|
|
34
|
+
Set `noautoplay` to hold playback until your script calls `target.play()`, for example after checking `prefers-reduced-motion`, and `noloop` to play the video once. Without `noautoplay`, calling `pause()` before the stream attaches has no effect: autoplay starts the video once the stream loads.
|
|
33
35
|
|
|
34
36
|
## API
|
|
35
37
|
|
|
36
|
-
|
|
38
|
+
### Attributes
|
|
39
|
+
|
|
40
|
+
| Attribute | Description |
|
|
37
41
|
| --- | --- |
|
|
38
42
|
| `src` | HLS manifest URL |
|
|
43
|
+
| `noloop` | Turns off looping |
|
|
44
|
+
| `noautoplay` | Turns off autoplay |
|
|
45
|
+
| `crossorigin`, `controls`, `controlslist` | Passed through to the inner video |
|
|
46
|
+
| `keep-alive` | Keeps the engine running after the element is removed |
|
|
47
|
+
|
|
48
|
+
An explicit `loop` or `autoplay` attribute wins over its opt-out. Opt-outs and passed-through attributes also apply when set or changed after the element is created. Muted can’t be turned off, and `preload` isn’t passed through: the engine loads as soon as it has a source.
|
|
49
|
+
|
|
50
|
+
### Properties
|
|
51
|
+
|
|
52
|
+
| Property | Description |
|
|
53
|
+
| --- | --- |
|
|
54
|
+
| `src` | HLS manifest URL. Assigning a new one restarts playback from scratch |
|
|
39
55
|
| `error` | Fatal SPF media error for the current source, or `null` |
|
|
40
|
-
| `
|
|
56
|
+
| `target` | Inner native `<video>` element. Call `play()` and `pause()` on it |
|
|
57
|
+
| `video` | Same element as `target` |
|
|
41
58
|
| `adapter` | The `HlsBackgroundVideoAdapter` driving the inner video, including its SPF `engine` |
|
|
42
59
|
|
|
43
60
|
The element also fires an `error` event when `error` becomes fatal. The inner video’s own `error` can remain `null` because SPF, rather than the browser, rejected the source.
|
|
@@ -13,7 +13,47 @@ import '@videojs/html/media/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/hls-video.js"></script>
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Load a source
|
|
20
|
+
|
|
21
|
+
`src` takes an HLS manifest URL.
|
|
22
|
+
|
|
23
|
+
```html
|
|
24
|
+
<hls-video src="https://example.com/playlist.m3u8"></hls-video>
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
The structured `source` object carries what a URL can’t: `drm` for protected content. 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). Name every system you hold a license server for: which one gets negotiated is the browser’s choice.
|
|
32
|
+
|
|
33
|
+
```ts
|
|
34
|
+
const video = document.querySelector('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
|
+
FairPlay needs a `serverCertificateUrl` unless its CDM is pre-provisioned; Widevine and PlayReady ignore it. [Media sources](../../guides/media-sources.md#drm-protected-sources) covers DRM in more depth.
|
|
48
|
+
|
|
49
|
+
## Cookie-gated streams
|
|
50
|
+
|
|
51
|
+
A stream on another origin that is gated by cookies — CloudFront signed cookies, for example — needs those cookies on every manifest and segment request, or the CDN answers 403. Set the standard `crossorigin="use-credentials"` on the element and the engine sends them, the same way the browser does under native playback. Any other value, or no attribute, leaves requests at the platform default and sends no cross-origin cookies.
|
|
52
|
+
|
|
53
|
+
The CDN must answer with `Access-Control-Allow-Credentials: true` and a specific `Access-Control-Allow-Origin`, not `*`, or the browser refuses the credentialed response.
|
|
54
|
+
|
|
55
|
+
```html
|
|
56
|
+
<hls-video src="https://cdn.example.com/stream.m3u8" crossorigin="use-credentials"></hls-video>
|
|
17
57
|
```
|
|
18
58
|
|
|
19
59
|
## Examples
|
|
@@ -46,12 +86,64 @@ import '@videojs/html/ui/container';
|
|
|
46
86
|
import '@videojs/html/media/hls-video';
|
|
47
87
|
```
|
|
48
88
|
|
|
49
|
-
##
|
|
89
|
+
## API Reference
|
|
50
90
|
|
|
51
|
-
|
|
91
|
+
### Attributes
|
|
52
92
|
|
|
53
|
-
|
|
93
|
+
Forwards these standard media attributes to the internal `<video>`. See the [MDN media element reference](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/video): `autopictureinpicture`, `autoplay`, `controls`, `controlslist`, `crossorigin`, `disablepictureinpicture`, `disableremoteplayback`, `loading`, `loop`, `muted`, `playsinline`, `poster`, `preload`, `src`.
|
|
54
94
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
95
|
+
These Video.js-specific attributes configure media behavior:
|
|
96
|
+
|
|
97
|
+
| Attribute | Type | Default | Description |
|
|
98
|
+
| --- | --- | --- | --- |
|
|
99
|
+
| `stream-type` | `'on-demand' \| 'live' \| 'unknown'` | `'unknown'` | The source's stream type — `'live'`, `'on-demand'`, or `'unknown'` until a media playlist has been parsed. Setting a non-`'unknown'` value pins a user override (detection stops updating it); setting `'unknown'` reverts to the engine's detected value. |
|
|
100
|
+
|
|
101
|
+
### Properties
|
|
102
|
+
|
|
103
|
+
| Property | Type | Default | Description |
|
|
104
|
+
| --- | --- | --- | --- |
|
|
105
|
+
| `contentData` | `MediaContentData \| undefined` | — | Read-only. |
|
|
106
|
+
| `crossOrigin` | `'anonymous' \| 'use-credentials' \| null` | `null` | |
|
|
107
|
+
| `disableRemotePlayback` | `boolean` | `false` | |
|
|
108
|
+
| `error` | `{ code: number; message: string; data?: unknown } \| null` | — | Read-only. The current fatal error, or `null`. Only *fatal* conditions appear here — the engine reports non-fatal ones too (they stay in `engine.state.errors`), and promoting them would tell a consumer playback had failed when it hadn't. Resets per source. Fires `'error'` when set. |
|
|
109
|
+
| `isFullscreen` | `boolean` | — | Read-only. |
|
|
110
|
+
| `isPictureInPicture` | `boolean` | — | Read-only. |
|
|
111
|
+
| `liveEdgeStart` | `number` | — | Read-only. Presentation time marking the start of the live-edge window. Playback at `currentTime >= liveEdgeStart` counts as "at the live edge", and seeking to live lands here. `NaN` when the stream isn't live or nothing has loaded yet. No change event fires; re-read it on `timeupdate` or `progress`. |
|
|
112
|
+
| `preload` | `'' \| 'none' \| 'metadata' \| 'auto'` | `''` | Preload type (`'none'` / `'metadata'` / `'auto'`). |
|
|
113
|
+
| `source` | `{ src?: string; type?: string; drm?: Partial<Record<string, DrmSystemConfig>> } \| null` | `null` | Structured source: the manifest URL plus what a URL cannot carry, which today is the license servers for protected content. Setting it derives `src`. Assigning the same object back costs nothing — changing anything takes a new one. |
|
|
114
|
+
| `src` | `string` | `''` | |
|
|
115
|
+
| `streamType` | `'on-demand' \| 'live' \| 'unknown'` | `'unknown'` | The source's stream type — `'live'`, `'on-demand'`, or `'unknown'` until a media playlist has been parsed. Setting a non-`'unknown'` value pins a user override (detection stops updating it); setting `'unknown'` reverts to the engine's detected value. |
|
|
116
|
+
| `targetLiveWindow` | `number` | — | Read-only. The target live window: `NaN` for on-demand (or unknown), `0` for standard sliding-window live, `Infinity` for DVR (`#EXT-X-PLAYLIST-TYPE:EVENT`). Fires `targetlivewindowchange` on change. |
|
|
117
|
+
| `webkitCurrentPlaybackTargetIsWireless` | `boolean \| undefined` | — | Read-only. |
|
|
118
|
+
| `webkitPresentationMode` | `WebKitPresentationMode \| undefined` | — | Read-only. |
|
|
119
|
+
| `webkitSetPresentationMode` | `((mode: WebKitPresentationMode) => void) \| undefined` | — | Read-only. |
|
|
120
|
+
|
|
121
|
+
Also exposes these properties from the native media API. See [HTMLVideoElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLVideoElement) for details: `autoplay`, `buffered`, `controls`, `currentSrc`, `currentTime`, `defaultMuted`, `defaultPlaybackRate`, `disablePictureInPicture`, `duration`, `ended`, `loop`, `muted`, `paused`, `playbackRate`, `played`, `playsInline`, `poster`, `readyState`, `remote`, `seekable`, `seeking`, `textTracks`, `title`, `videoHeight`, `videoWidth`, `volume`.
|
|
122
|
+
|
|
123
|
+
### Methods
|
|
124
|
+
|
|
125
|
+
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`.
|
|
126
|
+
|
|
127
|
+
### Events
|
|
128
|
+
|
|
129
|
+
Re-dispatches these standard media events from the internal media element: `abort`, `addtrack`, `canplay`, `canplaythrough`, `change`, `contentdatachange`, `durationchange`, `emptied`, `ended`, `enterpictureinpicture`, `leavepictureinpicture`, `loadeddata`, `loadedmetadata`, `loadstart`, `pause`, `play`, `playing`, `progress`, `ratechange`, `removetrack`, `resize`, `seeked`, `seeking`, `stalled`, `suspend`, `timeupdate`, `volumechange`, `waiting`.
|
|
130
|
+
|
|
131
|
+
Also emits these Video.js-specific events:
|
|
132
|
+
|
|
133
|
+
| Event | Description |
|
|
134
|
+
| --- | --- |
|
|
135
|
+
| `error` | Fired when a fatal condition is reported. Read `error` for it. |
|
|
136
|
+
| `sourcechange` | Fired when `source` changes. Read `source` for the new value. |
|
|
137
|
+
| `streamtypechange` | Fired when the detected stream type changes. Read `streamType` for the new value. |
|
|
138
|
+
| `targetlivewindowchange` | Fired when the target live window changes. Read `targetLiveWindow` for the new value. |
|
|
139
|
+
|
|
140
|
+
### CSS custom properties
|
|
141
|
+
|
|
142
|
+
| Variable | Description |
|
|
143
|
+
| --- | --- |
|
|
144
|
+
| `--media-video-border-radius` | Border radius of the video element. |
|
|
145
|
+
| `--media-object-fit` | Object fit for the video. |
|
|
146
|
+
| `--media-object-position` | Object position for the video. |
|
|
147
|
+
| `--media-caption-track-duration` | Duration of the caption track transition. |
|
|
148
|
+
| `--media-caption-track-delay` | Delay before the caption track transition. |
|
|
149
|
+
| `--media-caption-track-y` | Vertical offset of the caption track. |
|