How to unmute html5 video with a muted prop

后端 未结 4 2061
小鲜肉
小鲜肉 2021-02-08 18:50

I\'ve created a simple video block with muted (for mobile autostart) but now i can not change the mute state...

I used that repository , fiddle link would be great.

4条回答
  •  再見小時候
    2021-02-08 19:31

    You could simply mute/unmute with

    document.getElementById("theIdOfYourVideoGoesHere").volume=0;
    

    and

    document.getElementById("theIdOfYourVideoGoesHere").volume=1;
    

    (This thread appears to be two years old but today it was the number one top result in my google search)


    Bilgisayar ne bilgiden anlar ne saygıdan. Çünkü o cansız bir düzenektir. O kadar.

提交回复
热议问题