1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-03 01:39:37 +02:00

Add ability to set password from embed API

This commit is contained in:
Chocobozzz 2023-11-23 08:14:54 +01:00
parent 4c07200d64
commit b13460a10a
No known key found for this signature in database
GPG key ID: 583A612D890159BE
8 changed files with 127 additions and 45 deletions

View file

@ -154,6 +154,21 @@ Enable embed JavaScript API (see methods below).
Value must be `0` or `1`.
### waitPasswordFromEmbedAPI
**PeerTube >= 6.0**
If the video requires a password, PeerTube will wait a password provided by `setVideoPassword` method before loading the video.
Until you provide a password, `player.ready` is not resolved.
## Embed attributes
### `ready: Promise<void>`
This promise is resolved when the video is loaded an the player is ready.
## Embed methods
@ -237,6 +252,15 @@ Play previous video in playlist.
Get current position in playlist (starts from 1).
### `setVideoPassword(): Promise<void>`
**PeerTube >= 6.0**
Set the video password so the user doesn't have to manually fill it.
`waitPasswordFromEmbedAPI=1` is required in embed URL.
## Embed events
You can subscribe to events by using `addEventListener()`. See above for details.