From 03d641a0d7f996de44ec898ad739bc4050514ba1 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 17 Dec 2019 16:17:22 +0100 Subject: Add embed api build --- support/doc/api/embeds.md | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'support') diff --git a/support/doc/api/embeds.md b/support/doc/api/embeds.md index c2317a030..ca480006d 100644 --- a/support/doc/api/embeds.md +++ b/support/doc/api/embeds.md @@ -21,6 +21,24 @@ Now just use the `PeerTubePlayer` class exported by the module: ```typescript import { PeerTubePlayer } from '@peertube/embed-api' +... +``` + +Or use the minified build from NPM CDN in your HTML file: + +``` + + + +``` + +Then you can instantiate the player: + +```typescript let player = new PeerTubePlayer(document.querySelector('iframe')) await player.ready // wait for the player to be ready @@ -56,7 +74,7 @@ Get the available resolutions. A `PeerTubeResolution` looks like: { "id": 3, "label": "720p", - "src": "//src-url-here", + "height": "720", "active": true } ``` @@ -87,6 +105,7 @@ Set the playback volume. Value should be between `0` and `1`. ## `getVolume(): Promise` Get the playback volume. Returns a value between `0` and `1`. + # Events You can subscribe to events by using `addEventListener()`. See above for details. -- cgit v1.2.3