Fix embed doc title hierarchy
This commit is contained in:
parent
f1564be2ce
commit
6a160a0c9d
|
@ -49,131 +49,131 @@ player.seek(32)
|
||||||
player.pause()
|
player.pause()
|
||||||
```
|
```
|
||||||
|
|
||||||
# URL parameters
|
## Embed URL parameters
|
||||||
|
|
||||||
You can customize PeerTube player by specifying URL query parameters.
|
You can customize PeerTube player by specifying URL query parameters.
|
||||||
For example `https://my-instance.example.com/videos/embed/52a10666-3a18-4e73-93da-e8d3c12c305a??start=1s&stop=18s&loop=1&autoplay=1&muted=1&warningTitle=0&controlBar=0&peertubeLink=0&p2p=0`
|
For example `https://my-instance.example.com/videos/embed/52a10666-3a18-4e73-93da-e8d3c12c305a??start=1s&stop=18s&loop=1&autoplay=1&muted=1&warningTitle=0&controlBar=0&peertubeLink=0&p2p=0`
|
||||||
|
|
||||||
## start
|
### start
|
||||||
|
|
||||||
Start the video at a specific time.
|
Start the video at a specific time.
|
||||||
Value must be raw seconds or a duration (`3m4s`)
|
Value must be raw seconds or a duration (`3m4s`)
|
||||||
|
|
||||||
## stop
|
### stop
|
||||||
|
|
||||||
Stop the video at a specific time.
|
Stop the video at a specific time.
|
||||||
Value must be raw seconds or a duration (`54s`)
|
Value must be raw seconds or a duration (`54s`)
|
||||||
|
|
||||||
## controls
|
### controls
|
||||||
|
|
||||||
Mimics video HTML element `controls` attribute, meaning that all controls (including big play button, control bar, etc.) will be removed.
|
Mimics video HTML element `controls` attribute, meaning that all controls (including big play button, control bar, etc.) will be removed.
|
||||||
It can be useful if you want to have a full control of the PeerTube player.
|
It can be useful if you want to have a full control of the PeerTube player.
|
||||||
|
|
||||||
Value must be `0` or `1`.
|
Value must be `0` or `1`.
|
||||||
|
|
||||||
## controlBar
|
### controlBar
|
||||||
|
|
||||||
Hide control bar when the video is played.
|
Hide control bar when the video is played.
|
||||||
|
|
||||||
Value must be `0` or `1`.
|
Value must be `0` or `1`.
|
||||||
|
|
||||||
## peertubeLink
|
### peertubeLink
|
||||||
|
|
||||||
Hide PeerTube instance link in control bar.
|
Hide PeerTube instance link in control bar.
|
||||||
|
|
||||||
Value must be `0` or `1`.
|
Value must be `0` or `1`.
|
||||||
|
|
||||||
## muted
|
### muted
|
||||||
|
|
||||||
Mute the video by default.
|
Mute the video by default.
|
||||||
|
|
||||||
Value must be `0` or `1`.
|
Value must be `0` or `1`.
|
||||||
|
|
||||||
## loop
|
### loop
|
||||||
|
|
||||||
Automatically start again the video when it ends.
|
Automatically start again the video when it ends.
|
||||||
|
|
||||||
Value must be `0` or `1`.
|
Value must be `0` or `1`.
|
||||||
|
|
||||||
## subtitle
|
### subtitle
|
||||||
|
|
||||||
Auto select a subtitle by default.
|
Auto select a subtitle by default.
|
||||||
|
|
||||||
Value must be a valid subtitle ISO code (`fr`, `en`, etc.).
|
Value must be a valid subtitle ISO code (`fr`, `en`, etc.).
|
||||||
|
|
||||||
## autoplay
|
### autoplay
|
||||||
|
|
||||||
Try to automatically play the video.
|
Try to automatically play the video.
|
||||||
Most web browsers disable video autoplay if the user did not interact with the video. You can try to bypass this limitation by muting the video
|
Most web browsers disable video autoplay if the user did not interact with the video. You can try to bypass this limitation by muting the video
|
||||||
|
|
||||||
Value must be `0` or `1`.
|
Value must be `0` or `1`.
|
||||||
|
|
||||||
## title
|
### title
|
||||||
|
|
||||||
Hide embed title.
|
Hide embed title.
|
||||||
|
|
||||||
Value must be `0` or `1`.
|
Value must be `0` or `1`.
|
||||||
|
|
||||||
## warningTitle
|
### warningTitle
|
||||||
|
|
||||||
Hide P2P warning title.
|
Hide P2P warning title.
|
||||||
|
|
||||||
Value must be `0` or `1`.
|
Value must be `0` or `1`.
|
||||||
|
|
||||||
## p2p
|
### p2p
|
||||||
|
|
||||||
Disable P2P.
|
Disable P2P.
|
||||||
|
|
||||||
Value must be `0` or `1`.
|
Value must be `0` or `1`.
|
||||||
|
|
||||||
## bigPlayBackgroundColor
|
### bigPlayBackgroundColor
|
||||||
|
|
||||||
Customize big play button background color.
|
Customize big play button background color.
|
||||||
|
|
||||||
Value must be a valid color (`red` or `rgba(100, 100, 100, 0.5)`).
|
Value must be a valid color (`red` or `rgba(100, 100, 100, 0.5)`).
|
||||||
|
|
||||||
## foregroundColor
|
### foregroundColor
|
||||||
|
|
||||||
Customize embed font color.
|
Customize embed font color.
|
||||||
|
|
||||||
Value must be a valid color (`red` or `rgba(100, 100, 100, 0.5)`).
|
Value must be a valid color (`red` or `rgba(100, 100, 100, 0.5)`).
|
||||||
|
|
||||||
## mode
|
### mode
|
||||||
|
|
||||||
Force a specific player engine.
|
Force a specific player engine.
|
||||||
|
|
||||||
Value must be a valid mode (`webtorrent` or `p2p-media-loader`).
|
Value must be a valid mode (`webtorrent` or `p2p-media-loader`).
|
||||||
|
|
||||||
## api
|
### api
|
||||||
|
|
||||||
Enable embed JavaScript API (see methods below).
|
Enable embed JavaScript API (see methods below).
|
||||||
|
|
||||||
Value must be `0` or `1`.
|
Value must be `0` or `1`.
|
||||||
|
|
||||||
|
|
||||||
# Methods
|
## Embed methods
|
||||||
|
|
||||||
## `play() : Promise<void>`
|
### `play() : Promise<void>`
|
||||||
|
|
||||||
Starts playback, or resumes playback if it is paused.
|
Starts playback, or resumes playback if it is paused.
|
||||||
|
|
||||||
## `pause() : Promise<void>`
|
### `pause() : Promise<void>`
|
||||||
|
|
||||||
Pauses playback.
|
Pauses playback.
|
||||||
|
|
||||||
## `seek(positionInSeconds : number)`
|
### `seek(positionInSeconds : number)`
|
||||||
|
|
||||||
Seek to the given position, as specified in seconds into the video.
|
Seek to the given position, as specified in seconds into the video.
|
||||||
|
|
||||||
## `addEventListener(eventName : string, handler : Function)`
|
### `addEventListener(eventName : string, handler : Function)`
|
||||||
|
|
||||||
Add a listener for a specific event. See below for the available events.
|
Add a listener for a specific event. See below for the available events.
|
||||||
|
|
||||||
## `removeEventListener(eventName : string, handler : Function)`
|
### `removeEventListener(eventName : string, handler : Function)`
|
||||||
|
|
||||||
Remove a listener.
|
Remove a listener.
|
||||||
|
|
||||||
## `getResolutions() : Promise<PeerTubeResolution[]>`
|
### `getResolutions() : Promise<PeerTubeResolution[]>`
|
||||||
|
|
||||||
Get the available resolutions. A `PeerTubeResolution` looks like:
|
Get the available resolutions. A `PeerTubeResolution` looks like:
|
||||||
|
|
||||||
|
@ -188,56 +188,56 @@ Get the available resolutions. A `PeerTubeResolution` looks like:
|
||||||
|
|
||||||
`active` is true if the resolution is the currently selected resolution.
|
`active` is true if the resolution is the currently selected resolution.
|
||||||
|
|
||||||
## `setResolution(resolutionId : number): Promise<void>`
|
### `setResolution(resolutionId : number): Promise<void>`
|
||||||
|
|
||||||
Change the current resolution. Pass `-1` for automatic resolution (when available).
|
Change the current resolution. Pass `-1` for automatic resolution (when available).
|
||||||
Otherwise, `resolutionId` should be the ID of an object returned by `getResolutions()`
|
Otherwise, `resolutionId` should be the ID of an object returned by `getResolutions()`
|
||||||
|
|
||||||
## `getPlaybackRates() : Promise<number[]>`
|
### `getPlaybackRates() : Promise<number[]>`
|
||||||
|
|
||||||
Get the available playback rates, where `1` represents normal speed, `0.5` is half speed, `2` is double speed, etc.
|
Get the available playback rates, where `1` represents normal speed, `0.5` is half speed, `2` is double speed, etc.
|
||||||
|
|
||||||
## `getPlaybackRates() : Promise<number>`
|
### `getPlaybackRates() : Promise<number>`
|
||||||
|
|
||||||
Get the current playback rate. See `getPlaybackRates()` for more information.
|
Get the current playback rate. See `getPlaybackRates()` for more information.
|
||||||
|
|
||||||
## `setPlaybackRate(rate: number) : Promise<void>`
|
### `setPlaybackRate(rate: number) : Promise<void>`
|
||||||
|
|
||||||
Set the current playback rate. The passed rate should be a value as returned by `getPlaybackRates()`.
|
Set the current playback rate. The passed rate should be a value as returned by `getPlaybackRates()`.
|
||||||
|
|
||||||
## `setVolume(factor: number) : Promise<void>`
|
### `setVolume(factor: number) : Promise<void>`
|
||||||
|
|
||||||
Set the playback volume. Value should be between `0` and `1`.
|
Set the playback volume. Value should be between `0` and `1`.
|
||||||
|
|
||||||
## `getVolume(): Promise<number>`
|
### `getVolume(): Promise<number>`
|
||||||
|
|
||||||
Get the playback volume. Returns a value between `0` and `1`.
|
Get the playback volume. Returns a value between `0` and `1`.
|
||||||
|
|
||||||
## `setCaption(id: string) : Promise<void>`
|
### `setCaption(id: string) : Promise<void>`
|
||||||
|
|
||||||
Update current caption using the caption id.
|
Update current caption using the caption id.
|
||||||
|
|
||||||
## `getCaptions(): Promise<{ id: string, label: string, src: string, mode: 'disabled' | 'showing' }>`
|
### `getCaptions(): Promise<{ id: string, label: string, src: string, mode: 'disabled' | 'showing' }>`
|
||||||
|
|
||||||
Get video captions.
|
Get video captions.
|
||||||
|
|
||||||
## `playNextVideo(): Promise<void>`
|
### `playNextVideo(): Promise<void>`
|
||||||
|
|
||||||
Play next video in playlist.
|
Play next video in playlist.
|
||||||
|
|
||||||
## `playPreviousVideo(): Promise<void>`
|
### `playPreviousVideo(): Promise<void>`
|
||||||
|
|
||||||
Play previous video in playlist.
|
Play previous video in playlist.
|
||||||
|
|
||||||
## `getCurrentPosition(): Promise<void>`
|
### `getCurrentPosition(): Promise<void>`
|
||||||
|
|
||||||
Get current position in playlist (starts from 1).
|
Get current position in playlist (starts from 1).
|
||||||
|
|
||||||
# Events
|
## Embed events
|
||||||
|
|
||||||
You can subscribe to events by using `addEventListener()`. See above for details.
|
You can subscribe to events by using `addEventListener()`. See above for details.
|
||||||
|
|
||||||
## Event `playbackStatusUpdate`
|
### Event `playbackStatusUpdate`
|
||||||
|
|
||||||
Fired every half second to provide the current status of playback.
|
Fired every half second to provide the current status of playback.
|
||||||
The parameter of the callback will resemble:
|
The parameter of the callback will resemble:
|
||||||
|
@ -256,14 +256,14 @@ The parameter of the callback will resemble:
|
||||||
The `volume` field contains the volume from `0` (silent) to `1` (full volume).
|
The `volume` field contains the volume from `0` (silent) to `1` (full volume).
|
||||||
The `playbackState` can be `unstarted`, `playing`, `paused` or `ended`. More states may be added later.
|
The `playbackState` can be `unstarted`, `playing`, `paused` or `ended`. More states may be added later.
|
||||||
|
|
||||||
## Event `playbackStatusChange`
|
### Event `playbackStatusChange`
|
||||||
|
|
||||||
Fired when playback transitions between states, such as `paused` and `playing`. More states may be added later.
|
Fired when playback transitions between states, such as `paused` and `playing`. More states may be added later.
|
||||||
|
|
||||||
## Event `resolutionUpdate`
|
### Event `resolutionUpdate`
|
||||||
|
|
||||||
Fired when the available resolutions have changed, or when the currently selected resolution has changed. Listener should call `getResolutions()` to get the updated information.
|
Fired when the available resolutions have changed, or when the currently selected resolution has changed. Listener should call `getResolutions()` to get the updated information.
|
||||||
|
|
||||||
## Event `volumeChange`
|
### Event `volumeChange`
|
||||||
|
|
||||||
Fired when the player volume changed.
|
Fired when the player volume changed.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user