```typescript
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>
+ const PeerTubePlayer = window['PeerTubePlayer']
+
+ ...
+</script>
+```
+
+Then you can instantiate the player:
+
+```typescript
let player = new PeerTubePlayer(document.querySelector('iframe'))
await player.ready // wait for the player to be ready
{
"id": 3,
"label": "720p",
- "src": "//src-url-here",
+ "height": "720",
"active": true
}
```
## `getVolume(): Promise<number>`
Get the playback volume. Returns a value between `0` and `1`.
+
# Events
You can subscribe to events by using `addEventListener()`. See above for details.
## Event `resolutionUpdate`
-Fired when the available resolutions have changed, or when the currently selected resolution has changed. Listener should call `getResolutions()` to get the updated information.
\ No newline at end of file
+Fired when the available resolutions have changed, or when the currently selected resolution has changed. Listener should call `getResolutions()` to get the updated information.
+
+## Event `volumeChange`
+
+Fired when the player volume changed.