How to unmute html5 video with a muted prop

后端 未结 4 1038
抹茶落季
抹茶落季 2021-02-08 18:28

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条回答
  •  Happy的楠姐
    2021-02-08 19:16

    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.

提交回复
热议问题