Copy link to clipboard
Copied
I'm making a simple webpage for a project using a trial of Dreamweaver 2017.1; here's the audio and video code:
<video autoplay loop muted>
<source src="SkyLetterVideo.mp4" type="video/mp4">
</video>
<audio autoplay loop>
<source src="background.mp3" type="audio/mpeg">
<source src="background.ogg" type="audio/ogg">
</audio>
Audio and video work fine in live view and in browser previews (Chrome 8 and Safari 10) but I can't hear audio in mobile previews on a Google Pixel 2 (Android 8 Chrome v62) or an iPhone 5 (Webkit v602). Video however does work on both mobile devices.
Can anyone help explain why I can't get audio to work in mobile? Thanks to anyone who looks at this!
For starters, mobile devices don't respect autoplay because it eats up bandwidth and costs more money for people on limited data plans. Let people decide for themselves if they want to accept the bandwidth.
Unless I'm missing something, you're trying to invoke both files at the same time???
A better approach is to put audio into your video file so it syncs correctly.
Copy link to clipboard
Copied
For starters, mobile devices don't respect autoplay because it eats up bandwidth and costs more money for people on limited data plans. Let people decide for themselves if they want to accept the bandwidth.
Unless I'm missing something, you're trying to invoke both files at the same time???
A better approach is to put audio into your video file so it syncs correctly.
Copy link to clipboard
Copied
Thank you for the response.
I'm invoking both files because the audio loop is longer than the video. I'll try using a shorter audio file to see if it works though.
And I know that autoplay is data taxing. Like I said, this is just a project and if I did make it into a site, it would be an artistic site that few people would ever use.
What I wanted to know was is this a problem with Dreamweaver or it's preview. Since I used two different mobile devices, iOS and Android, I didn't think there was a problem with the code. Unless audio autoplay just isn't supported at all on mobile?
Copy link to clipboard
Copied
Autoplay is not going to work on mobiles.
Try it without and see if it works.