Auto play is not working without muted attribute, when I try to open url in mobile device. How to play video without using muted attribute ? I need to volume without click on muted button and one more important thing is that all thing will be working without JS and Jquery.
Muted autoplay for video is supported by Chrome for Android as of version 53. Playback will start automatically for a video element once it comes into view if both autoplay and muted are set, and playback of muted videos can be initiated progamatically with play().
Mobile device settings can block autoplay Most mobile devices, including Apple iPhones, Apple iPads and many Android and Microsoft devices do not support the video autoplay feature so your video will not play automatically if a visitor is on one of these devices.
Muted autoplay is always allowed. Autoplay with sound is allowed if: User has interacted with the domain (click, tap, etc.). On desktop, the user's Media Engagement Index threshold has been crossed, meaning the user has previously played video with sound.
The autoplay attribute is a boolean attribute. When present, the video will automatically start playing. Note: Chromium browsers do not allow autoplay in most cases. However, muted autoplay is always allowed.
You wont be able to achieve this in iOS without hacks. From the official Apple WebKit documentation:
Starting in iOS 10, WebKit relaxes its inline and autoplay policies to make these presentations possible, but still keeps in mind sites’ bandwidth and users’ batteries.
By default, WebKit will have the following policies:
- video elements will be allowed to autoplay without a user gesture if their source media contains no audio tracks.
- video muted elements will also be allowed to autoplay without a user gesture. If a element gains an audio track or becomes un-muted without a user gesture, playback will pause.
https://webkit.org/blog/6784/new-video-policies-for-ios/
As for Mobile Chrome (Android):
Muted autoplay for video is supported by Chrome for Android as of version 53. Playback will start automatically for a video element once it comes into view if both autoplay and muted are set, and playback of muted videos can be initiated progamatically with play(). Previously, playback on mobile had to be initiated by a user gesture, regardless of the muted state.
https://developers.google.com/web/updates/2016/07/autoplay
<video autoplay="autoplay" loop="loop" muted defaultMuted playsinline oncontextmenu="return false;" preload="auto" id="myVideo">
<source src="assets/video/1.mp4" type="video/mp4">
</video>
This code worked for me on Ios and Android phone
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With