HTML embed autoplay=“false”, but still plays automatically

后端 未结 8 1501
情深已故
情深已故 2020-11-30 11:25

On the front page of this website, there is a sticky post titled \"National Radio Advertising Campaign ForACURE\" which contains the following HTML:



        
相关标签:
8条回答
  • 2020-11-30 11:47

    The problem is your plugin. To solve this is to only enter this address:

    chrome://flags/#enable-NPAPI

    Click activate NPAPI, and finally restart at the bottom of the page.

    0 讨论(0)
  • 2020-11-30 11:48

    Just change the mime type to: type="audio/mpeg", this way chrome will honor the autostart="false" parameter.

    0 讨论(0)
  • Chrome doesn't seem to understand true and false. Use autostart="1" and autostart="0" instead.


    Source: (Google Groups: https://productforums.google.com/forum/#!topic/chrome/LkA8FoBoleU)

    0 讨论(0)
  • 2020-11-30 11:57

    the below codes helped me with the same problem. Let me know if it helped.

    <!DOCTYPE html>
    <html>
    <body>
    
    
    <audio controls>
    
    <source src="YOUR AUDIO FILE" type="audio/mpeg">
    Your browser does not support the audio element.
    </audio>
    
    
    
    </body>
    </html>
    
    0 讨论(0)
  • 2020-11-30 12:00

    <embed ... autostart="0">

    Replace false with 0

    0 讨论(0)
  • 2020-11-30 12:04

    This will prevent browser from auto playing audio.

    HTML

    <audio type="audio/wav" id="audio" autoplay="false" autostart="false"></audio>
    

    jQuery

    $('#audio').attr("src","path_to_audio.wav");
    $('#audio').play();
    
    0 讨论(0)
提交回复
热议问题