Quantcast
Channel: Active questions tagged youtube-api - Stack Overflow
Viewing all articles
Browse latest Browse all 3720

change volume of a youtube video while playing

$
0
0

When i play a Youtube video like this:

https://www.youtube.com/tv?#/watch/video/control?v=d1-VK12FZhs&resume&t=0m4s

i need to change the volume injecting javascript.

I know the API has the function

player.setVolume(volume:Number):Void

as i use this for get the currentTime:

document.querySelector('.video-stream').getCurrentTime();

i have tried with

document.querySelector('.video-stream').setVolume(20);

but i got an error telling "setVolume is not a function"

How to use it for change the volume with the video playing?


Viewing all articles
Browse latest Browse all 3720

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>