silvermine / videojs-chromecast

MIT License
148 stars 75 forks source link

How to lower the volume when in chrome cast mode #74

Closed nathanrodrigues2111 closed 4 years ago

nathanrodrigues2111 commented 4 years ago

I figured out how to set it up, it was due to another function in my code

The cast works fine now. But i still have an issue

Now by default the volume of videos js is 100% and when i cast it does to distinguish between system volume and player volume and makes it the same. So what happens is that when the cast starts the volume is peaked at 100% which is really bad

So id there like a if statement or can i configure/set the volume while in casting mode Thanks

And also is it possible to uncast with a function ?

UPDATE : solved the issue

    _onChromecastConnected: function() {
            this._isChromecastConnected = true;
            this._reloadCSSClasses();
            this.player().volume(0.1);    //change
            this.player().play();    
        },
        _onChromecastDisconnected: function() {
            this._isChromecastConnected = false;
            this._reloadCSSClasses();
            this.player().volume(1);   //change
        },

make this change here. This solves the issue

Also you can add autoplay by adding this.player().play();