aboutsummaryrefslogtreecommitdiffhomepage
path: root/support
diff options
context:
space:
mode:
Diffstat (limited to 'support')
-rw-r--r--support/doc/api/embeds.md18
1 files changed, 13 insertions, 5 deletions
diff --git a/support/doc/api/embeds.md b/support/doc/api/embeds.md
index 7085b4b0a..e3df35efc 100644
--- a/support/doc/api/embeds.md
+++ b/support/doc/api/embeds.md
@@ -4,8 +4,8 @@ PeerTube lets you embed videos and programmatically control their playback. This
4 4
5## Playground 5## Playground
6 6
7Any PeerTube embed URL (ie `https://my-instance.example.com/videos/embed/52a10666-3a18-4e73-93da-e8d3c12c305a`) can be viewed as an embedding playground which 7Any PeerTube embed URL (ie `https://my-instance.example.com/videos/embed/52a10666-3a18-4e73-93da-e8d3c12c305a`) can be viewed as an embedding playground which
8allows you to test various aspects of PeerTube embeds. Simply replace `/embed` with `/test-embed` and visit the URL in a browser. 8allows you to test various aspects of PeerTube embeds. Simply replace `/embed` with `/test-embed` and visit the URL in a browser.
9For instance, the playground URL for the above embed URL is `https://my-instance.example.com/videos/test-embed/52a10666-3a18-4e73-93da-e8d3c12c305a`. 9For instance, the playground URL for the above embed URL is `https://my-instance.example.com/videos/test-embed/52a10666-3a18-4e73-93da-e8d3c12c305a`.
10 10
11## Quick Start 11## Quick Start
@@ -95,11 +95,11 @@ Get the available playback rates, where `1` represents normal speed, `0.5` is ha
95 95
96Get the current playback rate. See `getPlaybackRates()` for more information. 96Get the current playback rate. See `getPlaybackRates()` for more information.
97 97
98## `setPlaybackRate(rate : number) : Promise<void>` 98## `setPlaybackRate(rate: number) : Promise<void>`
99 99
100Set the current playback rate. The passed rate should be a value as returned by `getPlaybackRates()`. 100Set the current playback rate. The passed rate should be a value as returned by `getPlaybackRates()`.
101 101
102## `setVolume(factor : number) : Promise<void>` 102## `setVolume(factor: number) : Promise<void>`
103 103
104Set the playback volume. Value should be between `0` and `1`. 104Set the playback volume. Value should be between `0` and `1`.
105 105
@@ -107,13 +107,21 @@ Set the playback volume. Value should be between `0` and `1`.
107 107
108Get the playback volume. Returns a value between `0` and `1`. 108Get the playback volume. Returns a value between `0` and `1`.
109 109
110## `setCaption(id: string) : Promise<void>`
111
112Update current caption using the caption id.
113
114## `getCaptions(): Promise<{ id: string, label: string, src: string, mode: 'disabled' | 'showing' }>`
115
116Get video captions.
117
110# Events 118# Events
111 119
112You can subscribe to events by using `addEventListener()`. See above for details. 120You can subscribe to events by using `addEventListener()`. See above for details.
113 121
114## Event `playbackStatusUpdate` 122## Event `playbackStatusUpdate`
115 123
116Fired every half second to provide the current status of playback. 124Fired every half second to provide the current status of playback.
117The parameter of the callback will resemble: 125The parameter of the callback will resemble:
118 126
119```json 127```json