title: Youtube iFrame API setPlaybackQuality ignored on mobile device
body: <p>I'm trying to setup YouTube iframe API to play a FullHD video with a lower quality. My goal is to save bandwidth on mobile devices and reduce loading time. My HTML structure is the classical player div, plus a debug div for messages.</p>
  
  <p><strong>HTML</strong></p>
  
  <pre><code>&lt;div id="debug"&gt;&lt;/div&gt;
  
  &lt;div id="your_video_id"&gt;
    &lt;div id="player"&gt;&lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>I've tried to invoke <code>setPlaybackQuality</code> as soon as the player is ready, to avoid mobile users wasting time in buffering (as suggested in this <a href="https://stackoverflow.com/questions/8802498/youtube-iframe-api-setplaybackquality-or-suggestedquality-not-working">post</a>). I've also invoked it in both "BUFFERING" and "PLAYING" states. When quality changes, debug content is updated with actual playback quality.</p>
  
  <p><strong>JAVASCRIPT</strong></p>
  
  <pre><code>/* Trigger player ready */
  function onPlayerReady(event) 
  {
      player.setPlaybackQuality("small");
  }
  
  /* Detect playback quality changes */
  function onQualityChange(event) 
  {
      document.getElementById("debug").innerHTML = event.data;
  }
  
  /* Trigger player events */
  function onPlayerStateChange(event) 
  {
      if (event.data == YT.PlayerState.BUFFERING) 
      {
          player.setPlaybackQuality("small");
      }
  
      if (event.data == YT.PlayerState.PLAYING) 
      {
          player.setPlaybackQuality("small");
      }
  }
  </code></pre>
  
  <p>The code seems to work on desktop (debug is correctly set to "small"), but it's ignored on mobile (debug set to "large", tested with Android 4.2.2). Is there a solution for this?</p>