]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - support/doc/api/embeds.md
Add videos list filters param in api doc
[github/Chocobozzz/PeerTube.git] / support / doc / api / embeds.md
index 6ee7deeab4708c69a656a7e4cce11bc0b50391eb..7085b4b0ad569e2592eafd143a433fb350ac7712 100644 (file)
@@ -28,7 +28,7 @@ import { PeerTubePlayer } from '@peertube/embed-api'
 Or use the minified build from NPM CDN in your HTML file:
 
 ```
-<script src="https://unpkg.com/@peertube/embed-api@0.0.1/build/player.min.js"></script>
+<script src="https://unpkg.com/@peertube/embed-api/build/player.min.js"></script>
 
 <script>
   const PeerTubePlayer = window['PeerTubePlayer']
@@ -46,7 +46,7 @@ await player.ready // wait for the player to be ready
 // now you can use it!
 player.play()
 player.seek(32)
-player.stop()
+player.pause()
 ```
 
 # Methods
@@ -113,17 +113,22 @@ You can subscribe to events by using `addEventListener()`. See above for details
 
 ## Event `playbackStatusUpdate`
 
-Fired every half second to provide the current status of playback. The parameter of the callback will resemble:
+Fired every half second to provide the current status of playback. 
+The parameter of the callback will resemble:
 
 ```json
 {
   "position": 22.3,
   "volume": 0.9,
+  "duration": "171.37499",
   "playbackState": "playing"
 }
 ```
 
-The `volume` field contains the volume from `0` (silent) to `1` (full volume). The `playbackState` can be `playing` or `paused`. More states may be added later.
+`duration` field and `ended` `playbackState` are available in PeerTube >= 2.2.
+
+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.
 
 ## Event `playbackStatusChange`