title: Android - Youtube 3gp file not found
body: <p>I'm trying to play a youtube video on my Android app, but I can't reach the 3gp url returned me from Youtube Api.
  I tried to open it also in VLC player and QuickTime player, but response is always that the player cannot receive data.
  Here is VLC Player log:</p>
  
  <blockquote>
    <p>main debug: <code>rtsp://v5.cache2.c.youtube.com/CiILENy73wIaGQmyk7Qe6Z5HyRMYDSANFEgGUgZ2aWRlb3MM/0/0/0/video.3gp' successfully opened
    live555 warning: no data received in 10s. Switching to TCP
    avcodec debug: ffmpeg codec (H263) stopped
    main debug: removing module "avcodec"
    main debug: killing decoder fourcc</code>h263', 0 PES in FIFO
    avcodec debug: ffmpeg codec (AMR narrow band) stopped
    main debug: removing module "avcodec"
    main debug: killing decoder fourcc <code>samr', 0 PES in FIFO
    main debug: Program doesn't contain anymore ES
    live555 debug: RTP subsession 'video/H263-2000'
    main debug: looking for decoder module: 32 candidates
    avcodec debug: libavcodec already initialized
    avcodec debug: trying to use direct rendering
    avcodec debug: ffmpeg codec (H263) started
    main debug: using decoder module "avcodec"
    main debug: TIMER module_need() : 0.758 ms - Total 0.758 ms / 1 intvls (Avg 0.758 ms)
    main debug: thread (decoder) created at priority 0 (../../src/input/decoder.c:301)
    main debug: thread started
    live555 debug: RTP subsession 'audio/AMR'
    main debug: looking for decoder module: 32 candidates
    avcodec debug: libavcodec already initialized
    avcodec debug: ffmpeg codec (AMR narrow band) started
    avcodec debug: Using 192000 bytes output buffer
    main debug: using decoder module "avcodec"
    main debug: TIMER module_need() : 391.931 ms - Total 391.931 ms / 1 intvls (Avg 391.931 ms)
    main debug: thread (decoder) created at priority 22 (../../src/input/decoder.c:301)
    main debug: thread started
    live555 debug: setup start: 0.000000 stop:28.666000
    live555 debug: play start: 0.000000 stop:28.666000
    live555 error: no data received in 10s, aborting
    main debug: EOF reached
    main debug: finished input
    avcodec debug: ffmpeg codec (H263) stopped
    main debug: removing module "avcodec"
    main debug: killing decoder fourcc</code>h263', 0 PES in FIFO
    avcodec debug: ffmpeg codec (AMR narrow band) stopped
    main debug: removing module "avcodec"
    main debug: killing decoder fourcc `samr', 0 PES in FIFO
    main debug: removing module "live555"
    main debug: Program doesn't contain anymore ES
    main debug: thread ended
    main debug: dead input
    main debug: changing item without a request (current 0/1)
    main debug: nothing to play
    macosx debug: input has stopped, refreshing interface
    main debug: TIMER input launching for 'rtsp://v5.cache2.c.youtube.com/CiILENy73wIaGQmyk7Qe6Z5HyRMYDSANFEgGUgZ2aWRlb3MM/0/0/0/video.3gp' : 449.262 ms - Total 449.262 ms / 1 intvls (Avg 449.262 ms)</p>
  </blockquote>
  
  <p>And this is Android log:</p>
  
  <blockquote>
    <p>05-18 14:51:42.008: D/MediaPlayer(2152): Couldn't open file on client side, trying server side
    05-18 14:51:42.258: D/MediaPlayer(2152): getMetadata
    05-18 14:51:53.823: E/MediaPlayer(2152): error (1, -2147483648)
    05-18 14:51:53.823: E/MediaPlayer(2152): Error (1,-2147483648)
    05-18 14:51:53.823: D/VideoView(2152): Error: 1,-2147483648
    05-18 14:51:54.060: D/AndroidRuntime(2152): Shutting down VM
    05-18 14:51:54.060: W/dalvikvm(2152): threadid=1: thread exiting with uncaught exception (group=0x409c01f8)
    05-18 14:51:54.088: E/AndroidRuntime(2152): FATAL EXCEPTION: main
    05-18 14:51:54.088: E/AndroidRuntime(2152): android.view.WindowManager$BadTokenException: Unable to add window -- token android.app.LocalActivityManager$LocalActivityRecord@418c8408 is not valid; is your activity running?
    05-18 14:51:54.088: E/AndroidRuntime(2152):     at android.view.ViewRootImpl.setView(ViewRootImpl.java:513)
    05-18 14:51:54.088: E/AndroidRuntime(2152):     at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:301)
    05-18 14:51:54.088: E/AndroidRuntime(2152):     at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:215)
    05-18 14:51:54.088: E/AndroidRuntime(2152):     at android.view.WindowManagerImpl$CompatModeWrapper.addView(WindowManagerImpl.java:140)
    05-18 14:51:54.088: E/AndroidRuntime(2152):     at android.view.Window$LocalWindowManager.addView(Window.java:537)
    05-18 14:51:54.088: E/AndroidRuntime(2152):     at android.app.Dialog.show(Dialog.java:278)
    05-18 14:51:54.088: E/AndroidRuntime(2152):     at android.app.AlertDialog$Builder.show(AlertDialog.java:932)
    05-18 14:51:54.088: E/AndroidRuntime(2152):     at android.widget.VideoView$4.onError(VideoView.java:382)
    05-18 14:51:54.088: E/AndroidRuntime(2152):     at android.media.MediaPlayer$EventHandler.handleMessage(MediaPlayer.java:1553)
    05-18 14:51:54.088: E/AndroidRuntime(2152):     at android.os.Handler.dispatchMessage(Handler.java:99)
    05-18 14:51:54.088: E/AndroidRuntime(2152):     at android.os.Looper.loop(Looper.java:137)
    05-18 14:51:54.088: E/AndroidRuntime(2152):     at android.app.ActivityThread.main(ActivityThread.java:4424)
    05-18 14:51:54.088: E/AndroidRuntime(2152):     at java.lang.reflect.Method.invokeNative(Native Method)
    05-18 14:51:54.088: E/AndroidRuntime(2152):     at java.lang.reflect.Method.invoke(Method.java:511)
    05-18 14:51:54.088: E/AndroidRuntime(2152):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
    05-18 14:51:54.088: E/AndroidRuntime(2152):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
    05-18 14:51:54.088: E/AndroidRuntime(2152):     at dalvik.system.NativeStart.main(Native Method)</p>
  </blockquote>
  
  <p>And my VideoActivity class to play the video:</p>
  
  <pre><code>
  
      public class VideoActivity extends Activity{
  
          public void onCreate(Bundle savedInstanceState) {
              super.onCreate(savedInstanceState);
              setContentView(R.layout.video);
  
              VideoView videoView = new VideoView(this);
              String urlRtsp = "rtsp://v5.cache2.c.youtube.com/CiILENy73wIaGQmyk7Qe6Z5HyRMYDSANFEgGUgZ2aWRlb3MM/0/0/0/video.3gp";
              videoView.setVideoURI(Uri.parse(urlRtsp));
              videoView.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT,LayoutParams.WRAP_CONTENT));
  
              videoView.setMediaController(new MediaController(this));
              videoView.requestFocus();
              videoView.start();
              LinearLayout main = (LinearLayout) findViewById(R.id.video_layout);
              main.addView(videoView);        
         }
  
  
      }
  
  </code>
  </pre>
  
  <p>What I'm trying to understand is if it's a Youtube problem or if there's something wrong in my code.
  I've tried with many videos, the one in the code is just my last attempt.
  I'm using Android SDK Version 15.</p>