Article From:https://segmentfault.com/q/1010000010787651
Question:

For example, a Android phone can be played, pause, open, and shut down on a Android phone, but on the apple cell phone, the sound is invalid and passed.setAttributeNo effect, please help to see, online urgent.

The example code is as follows

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>video</title>
    <style>
    html{
        font-size: 100px;
    }
        button{
            line-height: 40px;
            font-size: 30px;
        }
    </style>
</head>
<body>    
    <div>
        <button id="start">Start playing < /button>< button id= "sound" > mute < /button>< video id= "MyVideo"Src=" http://media.w3.org/2010/05/sintel/trailer.mp4 "width=" 100% "height=" 90% "type=" video/mp4 "X5"-video-player-type= "H5" x5-video-player-fullscreen= "true" x5-video-orientation= "landscape" webkit-plAysinline='true'style= "object-fit: fill;" > < /video>< /div>< scriPt>Var video = document.getElementById ('myvideo');Document.getElementById ('starT').AddEventListener ('Click', function ()) {If (video.paused) {Video.play ();This.innerText = "pause";}else{Video.pause ();This.innerText = "start playback";}})Var flag = false;Document.gEtElementById ('sound').AddEventListener ('Click', function () {Flag =! Flag;VIDeo.muted = flag;If (flag) {This.innerText = "open sound";}else{This.innerText = "mute";}})< /script>< /body>&lT; /html>

Answer 0:

iOS safariMuted properties are not supported, and MDN can be consulted

Answer 1:

But now that IOS version is more than 10, it seems to support mute properties.

Similar Posts:

Leave a Reply

Your email address will not be published. Required fields are marked *