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

How to set playback quality youtube api

$
0
0

I have 2 youtube players on my site. Everything works fine but I cannot set playback quality. What am I doing wrong?

var playerInfoList = [{  id: 'player',  height: '390',  width: '640',  videoId: 'jU1_0T79Lew',  playerVars: {'autoplay': 1,'autohide': 1,'showinfo': 0,  },  events: {'onReady': onPlayerReady  }}, {  id: 'player1',  height: '390',  width: '640',  videoId: 'u-OxxLMvOXg',  playerVars: {'autoplay': 0,'autohide': 1,'showinfo': 0,  }}];function onYouTubeIframeAPIReady() {  if (typeof playerInfoList === 'undefined')  return;  for (var i = 0; i < playerInfoList.length; i++) {    var curplayer = createPlayer(playerInfoList[i]);  }}function createPlayer(playerInfo) {  return new YT.Player(playerInfo.id, {    height: playerInfo.height,    width: playerInfo.width,    videoId: playerInfo.videoId,    playerVars: playerInfo.playerVars,    events: playerInfo.events  });}// The API will call this function when the video player is ready.function onPlayerReady(event) {  playerInfo.id.setPlaybackQuality('hd1080'); // Here we set the quality (yay!)}

Viewing all articles
Browse latest Browse all 3718

Latest Images

Trending Articles



Latest Images

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