title: YouTubeAndroidPlayerAPI can't play some videos
body: <p>-- Update 09/05/2016 17:10 --
  The problem seems related to the date of publication of the video... In the last week of April I posted many videos on YouTube, those published up to 19:00 of April 27 work properly, while those charged by 21:15 on the same day have the issue discussed, as if between 19 and 21 of April 27 had been introduced a few updates or changes to the videos by YouTube. I tried to load a new video now and this also has the same problem.</p>
  
  <hr>
  
  <p>I have a strange problem with YouTubeAndroidPlayerAPI.. I use YouTubePlayerSupportFragment (but I have the same problem with YouTubePlayerFragment) to play videos in my app, some video play perfectly, other show the error "There was a problem while playing. Tap to retry.".</p>
  
  <p>When this happen in the Android Monitor I see the YouTube API error:</p>
  
  <pre><code>05-08 11:25:22.145 20521-20521/? E/YouTubeAndroidPlayerAPI: fmt.noneavailable
  oae: Video not supported/available
  at oab.a(SourceFile:212)
  at nvl.a(SourceFile:383)
  at nvl.a(SourceFile:706)
  at nvr.a(SourceFile:1144
  at nsn.onPostExecute(SourceFile:2102)
  at android.os.AsyncTask.finish(AsyncTask.java:651)
  at android.os.AsyncTask.-wrap1(AsyncTask.java)
  at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:668)
  at android.os.Handler.dispatchMessage(Handler.java:102)
  at android.os.Looper.loop(Looper.java:148)
  at android.app.ActivityThread.main(ActivityThread.java:5443)
  at java.lang.reflect.Method.invoke(Native Method)
  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:728)
  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
  </code></pre>
  
  <p>If I tap the YouTube icon in the video to play it in the YouTube app, the video is played correctly in the official app.</p>
  
  <p>If the video has monetization active, the ad video is showed normally, at the end the error is showed.</p>
  
  <p>I tried:</p>
  
  <ul>
  <li>Use YouTubePlayerFragment instead of YouTubePlayerSupportFragment </li>
  <li>Use Activity instead of AppCompatActivity</li>
  <li>Embed the video in an HTML page, it works correctly</li>
  <li>Deactive monetization, nothing changes</li>
  <li>Different keys, one for debugging and one for the release</li>
  </ul>
  
  <p>Thank you very much for helping!</p>
  
  <hr>
  
  <p><strong>Update 11/05/2016</strong> It seems to be a YouTube bug; the only passable workaround at this time appears to be open the video in the YouTube official app with an intent or replace the player fragment with a WebView. The standard WebView is very limited and will not show the button to bring the video fullscreen.
  You need to create a class that extend WebChromeClient:</p>
  
  <pre><code>public class MyWebChromeClient extends WebChromeClient {
  
      FrameLayout.LayoutParams LayoutParameters = new FrameLayout.LayoutParams(FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.MATCH_PARENT);
  
      @Override
      public void onShowCustomView(View view, CustomViewCallback callback) {
          if (mCustomView != null) {
              callback.onCustomViewHidden();
              return;
          }
          mContentView = (LinearLayout) findViewById(R.id.scheda_video_activity);
          mContentView.setVisibility(View.GONE);
          mCustomViewContainer = new FrameLayout(SchedaVideoActivity.this);
          mCustomViewContainer.setLayoutParams(LayoutParameters);
          mCustomViewContainer.setBackgroundResource(android.R.color.black);
          view.setLayoutParams(LayoutParameters);
          mCustomViewContainer.addView(view);
          mCustomView = view;
          mCustomViewCallback = callback;
          mCustomViewContainer.setVisibility(View.VISIBLE);
          setContentView(mCustomViewContainer);
      }
  
      @Override
      public void onHideCustomView() {
          if (mCustomView == null) {
              return;
          } else {
              mCustomView.setVisibility(View.GONE);
              mCustomViewContainer.removeView(mCustomView);
              mCustomView = null;
              mCustomViewContainer.setVisibility(View.GONE);
              mCustomViewCallback.onCustomViewHidden();
              mContentView.setVisibility(View.VISIBLE);
              setContentView(mContentView);
          }
      }
  }
  </code></pre>
  
  <p>and then initialize the WebView:</p>
  
  <pre><code>WebView myWebView = (WebView)findViewById(R.id.webview);
  MyWebChromeClient mWebChromeClient = new MyWebChromeClient();
  myWebView.setWebChromeClient(mWebChromeClient);
  myWebView.setWebViewClient(new WebViewClient(){
      @Override
      public boolean shouldOverrideUrlLoading(WebView view, String url) {
          return false;
      }
  });
  WebSettings webSettings = myWebView.getSettings();
  webSettings.setJavaScriptEnabled(true);
  </code></pre>
  
  <p>Finally, load the video in the WebView:</p>
  
  <pre><code>myWebView.loadUrl("https://www.youtube.com/embed/"+youtube_id);
  </code></pre>
  
  <hr>
  
  <p>If you want to adapt the WebView dimensions to the YouTube player you can do this:</p>
  
  <pre><code>Point size = new Point();
  getWindowManager().getDefaultDisplay().getSize(size);
  myWebView.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, (int)Math.round(size.x/1.77)));
  </code></pre>