6

how can i start video on load with volume in chrome. I try this code for notification its work fine but I want sound to allow. Using Javascript how can I do this?

navigator.mediaDevices.getUserMedia({ audio: true })
            .then(function(stream) {
                console.log('You let me use your mic!')
            })
            .catch(function(err) {
                console.log('No mic for you!')
        });

HTML code ( I want to run like this )

<video width="100%" height="100%" id="y2mate_play_auto" controls="controls" autoplay>
                    <source src="../img/y2mate.com.mp4" type="video/mp4" />
</video>

allow using code

allow using code how can i ? please help me for the above.

thanks

dev_ramiz_1707
  • 671
  • 4
  • 20

2 Answers2

1

It is not possible to play volume in the chrome as the auto play sound is the property of chrome settings . Using javascript you can access the dom panel but as far as chrome is concern we are not able to access the settings of thr chrome with javascript or any other programming in HTML.

Pratik bhatt
  • 488
  • 8
  • 23
1

As per the new chrome policy videos with autoplay must be muted in order to "reduce data consumption on expensive and/or constrained networks".

Here is the link from Autoplay policy changes on video autoplay with muted attribute present.

https://developers.google.com/web/updates/2017/09/autoplay-policy-changes

Hope this helps!