Answer the question
In order to leave comments, you need to log in
Why doesn't player.setPlaybackQuality() work?
Hello everyone, here is the js code:
function onYouTubeIframeAPIReady() {
player = new YT.Player("video", {
width: "640",
height: "360",
videoId: "",
playerVars: {
"controls": 0,
"rel": 0,
"disablekb": 0,
"html5": 1,
"iv_load_policy": 3,
"showinfo": 0,
"fs": 0
},
events: {
onReady: onPlayerReady,
onStateChange: onPlayerStateChange,
onPlaybackQualityChange: onPlayerPlaybackQualityChange
}
});
}
function onPlayerStateChange(e) {
if ( e.data == YT.PlayerState.PLAYING || e.data == YT.PlayerState.PAUSED ) {
// Выбор качества видео
$(document).find(".youtube-player").find(".form-settings-quality").on("change", "input", function() {
e.target.setPlaybackQuality($(this).val());
console.log(player.getPlaybackQuality());
})
}
}
e.setPlaybackQuality($(this).val()); // Альтернатива player.setPlaybackQuality($(this).val());
does not change the quality of the video being played ( <div class="wrapper-radio">
<input type="radio" id="quality-01" name="radio-quality" value="small">
<label for="quality-01"><span></span>240p</label>
</div>
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