Hi All
i have tried mixing and matching code from several listed sources on
the development page. but cannot stream video from youtube using the
emulator.

package info.shouraig.com;

import java.io.IOException;

import android.app.Activity;
import android.media.MediaPlayer;
import android.os.Bundle;
import android.util.Log;
import android.widget.TextView;
import android.widget.VideoView;

public class Video2 extends Activity {
        private static final String HTTP = "http://www.youtube.com/watch?
v=6ej-imJWuno";
    VideoView ViewVideo2;
    TextView textVideo2;
        /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle icicle) {
        super.onCreate(icicle);
        setContentView(R.layout.main);
        Log.d("Video2", "***Video to Play::" + HTTP);

        //***VideoView to video
        ViewVideo2 =(VideoView)findViewById(R.id.ViewVideo2);
        MediaPlayer mp = new MediaPlayer();
        try {
                        mp.setDataSource(HTTP);
                } catch (IllegalArgumentException e) {
                        // TODO Auto-generated catch block
                        e.printStackTrace();
                } catch (IllegalStateException e) {
                        // TODO Auto-generated catch block
                        e.printStackTrace();
                } catch (IOException e) {
                        // TODO Auto-generated catch block
                        e.printStackTrace();
                }
        try {
                        mp.prepare();
                } catch (IllegalStateException e) {
                        // TODO Auto-generated catch block
                        e.printStackTrace();
                } catch (IOException e) {
                        // TODO Auto-generated catch block
                        e.printStackTrace();
                }
        mp.start();
    }
}

-- 
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en

Reply via email to