title: Play a youtube video in a videoView
body: <p>I am trying to play a youtube video in a videoView.</p>
  
  <p>I found here a sample example that do the job:
  <a href="http://code.google.com/p/android-youtube-player/" rel="nofollow">http://code.google.com/p/android-youtube-player/</a></p>
  
  <p>for some videos id, it work fine, for some other videos i am getting a dialog:</p>
  
  <p>Communications Error: An error eccured during the retrieval of the video. This could be due to network issues or Youtube protocols. Please try again later. </p>
  
  <p>I try again and again for those videos ids, it doesn't work.</p>
  
  <p>Here the exception i get in my logcat:</p>
  
  <pre><code>12-01 01:24:20.871: E/QueryYouTubeTask(21326): Error occurred while retrieving information from YouTube.
  12-01 01:24:20.871: E/QueryYouTubeTask(21326): java.lang.NullPointerException
  12-01 01:24:20.871: E/QueryYouTubeTask(21326):  at libcore.net.UriCodec.decode(UriCodec.java:153)
  12-01 01:24:20.871: E/QueryYouTubeTask(21326):  at java.net.URLDecoder.decode(URLDecoder.java:45)
  12-01 01:24:20.871: E/QueryYouTubeTask(21326):  at com.keyes.youtube.YouTubeUtility.calculateYouTubeUrl(YouTubeUtility.java:137)
  12-01 01:24:20.871: E/QueryYouTubeTask(21326):  at com.keyes.youtube.OpenYouTubePlayerActivity$QueryYouTubeTask.doInBackground(OpenYouTubePlayerActivity.java:385)
  12-01 01:24:20.871: E/QueryYouTubeTask(21326):  at com.keyes.youtube.OpenYouTubePlayerActivity$QueryYouTubeTask.doInBackground(OpenYouTubePlayerActivity.java:1)
  12-01 01:24:20.871: E/QueryYouTubeTask(21326):  at android.os.AsyncTask$2.call(AsyncTask.java:287)
  12-01 01:24:20.871: E/QueryYouTubeTask(21326):  at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
  12-01 01:24:20.871: E/QueryYouTubeTask(21326):  at java.util.concurrent.FutureTask.run(FutureTask.java:137)
  12-01 01:24:20.871: E/QueryYouTubeTask(21326):  at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:230)
  12-01 01:24:20.871: E/QueryYouTubeTask(21326):  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
  12-01 01:24:20.871: E/QueryYouTubeTask(21326):  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
  12-01 01:24:20.871: E/QueryYouTubeTask(21326):  at java.lang.Thread.run(Thread.java:856)
  12-01 01:24:20.902: E/QueryYouTubeTask(21326): Error playing video!
  12-01 01:24:20.902: E/QueryYouTubeTask(21326): java.lang.RuntimeException: Invalid NULL Url.
  12-01 01:24:20.902: E/QueryYouTubeTask(21326):  at com.keyes.youtube.OpenYouTubePlayerActivity$QueryYouTubeTask.onPostExecute(OpenYouTubePlayerActivity.java:418)
  12-01 01:24:20.902: E/QueryYouTubeTask(21326):  at com.keyes.youtube.OpenYouTubePlayerActivity$QueryYouTubeTask.onPostExecute(OpenYouTubePlayerActivity.java:1)
  12-01 01:24:20.902: E/QueryYouTubeTask(21326):  at android.os.AsyncTask.finish(AsyncTask.java:631)
  12-01 01:24:20.902: E/QueryYouTubeTask(21326):  at android.os.AsyncTask.access$600(AsyncTask.java:177)
  12-01 01:24:20.902: E/QueryYouTubeTask(21326):  at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:644)
  12-01 01:24:20.902: E/QueryYouTubeTask(21326):  at android.os.Handler.dispatchMessage(Handler.java:99)
  12-01 01:24:20.902: E/QueryYouTubeTask(21326):  at android.os.Looper.loop(Looper.java:137)
  12-01 01:24:20.902: E/QueryYouTubeTask(21326):  at android.app.ActivityThread.main(ActivityThread.java:4745)
  12-01 01:24:20.902: E/QueryYouTubeTask(21326):  at java.lang.reflect.Method.invokeNative(Native Method)
  12-01 01:24:20.902: E/QueryYouTubeTask(21326):  at java.lang.reflect.Method.invoke(Method.java:511)
  12-01 01:24:20.902: E/QueryYouTubeTask(21326):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
  12-01 01:24:20.902: E/QueryYouTubeTask(21326):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
  12-01 01:24:20.902: E/QueryYouTubeTask(21326):  at dalvik.system.NativeStart.main(Native Method)
  </code></pre>
  
  <p>Any one have an idea, what is the problem here?
  do you have an explanation, why some video work fine and other don't work? May be there are video private and video public?</p>
  
  <p>Finally i get the solution: some video are not working because the video owner didn't put the video disponible to mobiles :)</p>