Skip to content
Open
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
5 changes: 5 additions & 0 deletions demo/demo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,11 @@ window.addEventListener('DOMContentLoaded', async () => {
: undefined;

if (video) {
if (player) {
await player.unload();
player.destroy();
}

// Pre-create srcObject and call play() NOW while we're inside the user gesture.
// The browser's autoplay policy ties play() permission to the gesture context;
// by the time tracks arrive asynchronously, the gesture is long gone.
Expand Down