Skip to content

Safari does not allow video elements without renderer to autoplay#58284

Open
youennf wants to merge 3 commits intoweb-platform-tests:masterfrom
youennf:fix-autoplay-in-RTCRtpSender-replaceTrack-test
Open

Safari does not allow video elements without renderer to autoplay#58284
youennf wants to merge 3 commits intoweb-platform-tests:masterfrom
youennf:fix-autoplay-in-RTCRtpSender-replaceTrack-test

Conversation

@youennf
Copy link
Contributor

@youennf youennf commented Mar 5, 2026

To workaround this difference, we make the test explictly call play on the video element.
We keep waiting for loadedmetadata to make sure the video element size is as expected.

To workaround this difference, we make the test explictly call play on the video element.
@youennf
Copy link
Contributor Author

youennf commented Mar 5, 2026

@jan-ivar, @guidou, can you take a look?
Given this is a difference of behaviour of how autoplay works, I think it is fine to workaround the issue here.

@alvestrand
Copy link
Contributor

If this now passes in all browsers, I don't see a problem with it. The difference in behavior is out of scope for WebRTC testing.

Copy link
Contributor

@alvestrand alvestrand left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving.
Reason for adding comments is to ensure that nobody comes around later and says "this is not required, let's delete it".

v.addEventListener('loadedmetadata', () => {
const metadataToBeLoadedAndPlaying = new Promise((resolve) => {
v.addEventListener('loadedmetadata', async () => {
await v.play();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and here.

Co-authored-by: Harald Alvestrand <hta+github@alvestrand.no>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants