xThereon
xThereon

Reputation: 21

How do you set the volume of an embedded youtube video from HTML and/or JavaScript?

Current code

I'm currently creating a "start page" of sorts for myself, and want to put music in the background. I've chosen a youtube livestream that I quite like, and cannot figure out how to change the volume using code, because I do not want it to be at the maximum volume constantly.

Any help would be appreciated. Thanks.

Upvotes: 0

Views: 4328

Answers (1)

Maarti
Maarti

Reputation: 3719

According to the API, you can use the function:

player.setVolume(volume:Number):Void

That will set the volume between 0 and 100.


PS: you should do the getting started part to get the reference to the player variable.

Upvotes: 2

Related Questions