Answer the question
In order to leave comments, you need to log in
How to change the default quality of Youtube video transmission in VideoJS player?
I installed a VideoJS
player on my site . Installed streamer from youtube . Everything works fine, but by default the YouTube video comes in SD quality, i.e. 360. How can I change it to HD? Apparently, the desired parameter is stored somewhere in the vjs.youtube.js file. Here is an excerpt from this file;
videojs.Youtube.prototype.onPlaybackQualityChange = function (a) {
switch (a) {
case "medium":
this.player_.videoWidth = 480;
this.player_.videoHeight = 360;
break;
case "large":
this.player_.videoWidth = 640;
this.player_.videoHeight = 480;
break;
case "hd720":
this.player_.videoWidth = 960;
this.player_.videoHeight = 720;
break;
case "hd1080":
this.player_.videoWidth = 1440;
this.player_.videoHeight = 1080;
break;
case "highres":
this.player_.videoWidth = 1920;
this.player_.videoHeight = 1080;
break;
case "small":
this.player_.videoWidth = 320;
this.player_.videoHeight = 240;
break;
default:
this.player_.videoWidth = 0, this.player_.videoHeight = 0
}
this.player_.trigger("ratechange")
};
this.player_.videoWidth = 0, this.player_.videoHeight = 0
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question