问题
I am trying to keep playing background music like Spotify playing with playing a inline video with attributs: "autoplay muted playsinline".
<video id="video" muted="muted" autoplay loop muted playsinline >
<source src="video.mp4" type="video/mp4">
</video>
<script>
window.onload = function () {
var element = document.getElementById('video');
element.muted = "muted";
}
</script>
But when I run this the video is plays inline and autoplaying. But as soon as the video start the background music app is pausing.
回答1:
Simple answer. You can't.
One solution: is if you remove the sound track from the video. The background music like Spotify DO NOT stop playing.
来源:https://stackoverflow.com/questions/42417047/ios-10-video-tag-with-autoplay-muted-playsinline-stops-background-music-spoti