diff options
author | Chocobozzz <me@florianbigard.com> | 2020-05-06 11:54:33 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2020-05-06 11:54:33 +0200 |
commit | 1151f5210c0e7665ec6714e73261f299e6fe757b (patch) | |
tree | 4d43e548a7d9ce7e7c4ecf6a257e9c8e395c3f95 /support/doc | |
parent | fc8aabd0bf38441c0591f21b9b435b52e99ffc23 (diff) | |
download | PeerTube-1151f5210c0e7665ec6714e73261f299e6fe757b.tar.gz PeerTube-1151f5210c0e7665ec6714e73261f299e6fe757b.tar.zst PeerTube-1151f5210c0e7665ec6714e73261f299e6fe757b.zip |
Add ability to update embed captions
Diffstat (limited to 'support/doc')
-rw-r--r-- | support/doc/api/embeds.md | 18 |
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 | ||
7 | Any PeerTube embed URL (ie `https://my-instance.example.com/videos/embed/52a10666-3a18-4e73-93da-e8d3c12c305a`) can be viewed as an embedding playground which | 7 | Any PeerTube embed URL (ie `https://my-instance.example.com/videos/embed/52a10666-3a18-4e73-93da-e8d3c12c305a`) can be viewed as an embedding playground which |
8 | allows you to test various aspects of PeerTube embeds. Simply replace `/embed` with `/test-embed` and visit the URL in a browser. | 8 | allows you to test various aspects of PeerTube embeds. Simply replace `/embed` with `/test-embed` and visit the URL in a browser. |
9 | For instance, the playground URL for the above embed URL is `https://my-instance.example.com/videos/test-embed/52a10666-3a18-4e73-93da-e8d3c12c305a`. | 9 | For 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 | ||
96 | Get the current playback rate. See `getPlaybackRates()` for more information. | 96 | Get 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 | ||
100 | Set the current playback rate. The passed rate should be a value as returned by `getPlaybackRates()`. | 100 | Set 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 | ||
104 | Set the playback volume. Value should be between `0` and `1`. | 104 | Set 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 | ||
108 | Get the playback volume. Returns a value between `0` and `1`. | 108 | Get the playback volume. Returns a value between `0` and `1`. |
109 | 109 | ||
110 | ## `setCaption(id: string) : Promise<void>` | ||
111 | |||
112 | Update current caption using the caption id. | ||
113 | |||
114 | ## `getCaptions(): Promise<{ id: string, label: string, src: string, mode: 'disabled' | 'showing' }>` | ||
115 | |||
116 | Get video captions. | ||
117 | |||
110 | # Events | 118 | # Events |
111 | 119 | ||
112 | You can subscribe to events by using `addEventListener()`. See above for details. | 120 | You can subscribe to events by using `addEventListener()`. See above for details. |
113 | 121 | ||
114 | ## Event `playbackStatusUpdate` | 122 | ## Event `playbackStatusUpdate` |
115 | 123 | ||
116 | Fired every half second to provide the current status of playback. | 124 | Fired every half second to provide the current status of playback. |
117 | The parameter of the callback will resemble: | 125 | The parameter of the callback will resemble: |
118 | 126 | ||
119 | ```json | 127 | ```json |