Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ This project is a demonstration of integrating the popular [video.js](https://vi
```
2. [Create a Dolby.io account](https://streaming.dolby.io/signup) and create a publish token from the "Live Broadcast" menu.
3. Set the environment variable `VITE_WHEP_URL` to a WHEP URL from the [Dolby.io Real-time streaming dashboard](https://streaming.dolby.io/#/tokens). Find this in the "API" tab once you have selected your publish token.
4. OPTIONAL: Set the environment variable `VITE_WHEP_TOKEN` if your WHEP server requires bearer token. If this env is unset, no bearer token is transfered in WHEP communication.

## Run the example
1. Ensure you are in the `examples` folder.
Expand Down
4 changes: 3 additions & 1 deletion example/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ const params = new Proxy(new URLSearchParams(window.location.search), {
})

const whepUrl = params.whepUrl ? params.whepUrl : import.meta.env.VITE_WHEP_URL
const whepTokenInput = params.whepToken ? params.whepToken : import.meta.env.VITE_WHEP_TOKEN
const whepToken = whepTokenInput ? whepTokenInput : null;

videojs.registerPlugin('MillicastWhepPlugin', MillicastWhepPlugin)

Expand All @@ -19,5 +21,5 @@ const options = {
// Initialize Video.js player
videojs('my-video', options, function onPlayerReady () {
videojs.log('Your player is ready!')
this.MillicastWhepPlugin({ url: whepUrl })
this.MillicastWhepPlugin({ url: whepUrl, token: whepToken })
})
2 changes: 1 addition & 1 deletion videojs-whep-viewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export default class MillicastWhepPlugin extends Plugin {
direction: 'recvonly'
})

await this.whep.view(this.pc, options.url)
await this.whep.view(this.pc, options.url, options.token)
this.modal.close()

// Add tracks transceiver receiver tracks to our Media Stream object
Expand Down