Reputation: 21
Good morning, I have a rather particular question. I'm managing the website of a radio station with a web tv service. Who bought the service did it from a provider that provided the link below to be inserted in the html code ... So unfortunately this is all I have available to modify. Under "autoplay muted fluid="false" I set false as a value, but still the audio does not start when you access the site. I have read that the settings of the various search engines have changed and that could be the cause of this block. Are there any ways to bypass these restrictions? How can I include them in the code? Thank you very much!
<!-- Paste the following into the <head> -->
<link href="https://unpkg.com/video.js@7/dist/video-js.min.css" rel="stylesheet">
<link href="https://unpkg.com/[email protected]/dist/css/quality-selector.css" rel="stylesheet">
<!-- Paste the following into the <body> -->
<video id="videojs" class="video-js vjs-fluid vjs-default-skin vjs-big-play-centered" controls preload="auto" autoplay muted fluid="false" >
<source src="https://585b674743bbb.streamlock.net:443/9076/9076/playlist.m3u8" type="application/x-mpegURL">
<p class="vjs-no-js">
To view this video please enable JavaScript, and consider upgrading to a web browser that
<a href="https://videojs.com/html5-video-support/" target="_blank">supports HTML5 video</a>
</p>
</video>
<script src="https://unpkg.com/video.js@7/dist/video.min.js"></script>
<script type="text/javascript">
var player = videojs('videojs');
</script>
Upvotes: 2
Views: 3073
Reputation: 2151
you have to put some popup/button/alert which requests user to interact with it thus fulfilling the interacting with document/webpage condition and allowing you to play the sound.
Autoplay availability
As a general rule, you can assume that media will be allowed to autoplay only if at least one of the following is true:
The audio is muted or its volume is set to 0
The user has interacted with the site (by clicking, tapping, pressing keys, etc.)
If the site has been whitelisted; this may happen either automatically if the browser determines that the user engages with media frequently, or manually through preferences or other user interface features
If the autoplay feature policy is used to grant autoplay support to an and its document.
Otherwise, the playback will likely be blocked. The exact situations that result in blocking, and the specifics of how sites become whitelisted vary from browser to browser, but the above are good guidelines to go by.
Put another way, playback of any media that includes audio is generally blocked if the playback is programmatically initiated in a tab which has not yet had any user interaction. Browsers may additionally choose to block under other circumstances.
for more detail visit documentation
Upvotes: 2