We’re encountering an issue with the video element when using an uploaded MP4 or WebM asset. The video autoplay feature is not working correctly in iOS Safari and Chrome.
The generated code when adding a video in the visual editor looks like this:
However, when we use a direct src="" attribute in the video tag without the <source /> element, the autoplay works correctly. There seems to be a dependency on the order of attributes, specifically with muted needing to be placed before autoplay to ensure proper functionality. We’re not entirely sure if this would fix the issue, though.
Ensuring autoplay functionality on iOS Safari and Chrome is critical. Please investigate this issue.
Would you be able to share with me the Public URL Of the page where you are experiencing the issue? I may be able to provide better guidance if I’m able to work with the video block.
Just for clarification, I’d like to understand the workflow:
You used the Visual Copilot to generate code, that code contained a video, but the generated code output did not work.You manually had to insert a Builder media component to render the video. Is this correct?
All the video elements on the page URL I provided were generated using the Visual Editor (Media → Video), except for the last one. Unfortunately, autoplay is not working on iOS Safari and Chrome.
To test the autoplay functionality, I added another video using the code element (which is the last one on the page). In my custom code, I didn’t include a <source> element, but instead used a direct src="https://remote_file.mp4". This approach demonstrated that autoplay works correctly on iOS for both Safari and Chrome.
Yes, I thought about it but there is no way to create a custom html code that uses builder.io assets mp4/webm. I tried copy pasting the src file and I got an error.
I have to upload my assets in another service and create the video src elements via custom code. That’s quite incovininent for video background code.
Apologies for the delay in response. Are you still experiencing issues with the video in Safari? Would you mind letting me know if this is just in the Visual Editor or also on the Draft Preview/Live Site? Also, is this on Mobile or Desktop?