Skip to content

Commit 8e14337

Browse files
authored
Add video autoplay attributes to PublishVideoCheck (#1648)
1 parent e381f29 commit 8e14337

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

.changeset/chilly-llamas-grow.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'livekit-client': patch
3+
---
4+
5+
Add video autoplay attributes to PublishVideoCheck

src/connectionHelper/checks/publishVideo.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,11 @@ export class PublishVideoCheck extends Checker {
4646
const video = document.createElement('video');
4747
video.srcObject = stream;
4848
video.muted = true;
49+
video.autoplay = true;
50+
video.playsInline = true;
51+
// For iOS Safari
52+
video.setAttribute('playsinline', 'true');
53+
document.body.appendChild(video);
4954

5055
await new Promise<void>((resolve) => {
5156
video.onplay = () => {

0 commit comments

Comments
 (0)