Friday, August 24, 2012

[android-developers] hi

hi friends i would like to play video from url (you tube video) in my app,t tried it but it cant play,any one help me.
this is my code



package com.aiss;

import android.app.Activity;
import android.net.Uri;
import android.os.Bundle;
import android.widget.MediaController;
import android.widget.VideoView;

public class KakadAarathiActivity extends Activity {
    /** Called when the activity is first created. */
    String srcPath="http://youtu.be/dhCdd9RKMcw";
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
       
        VideoView vv=(VideoView)findViewById(R.id.kakadvideo);
        vv.setMediaController(new MediaController(this));
        vv.setVideoURI(Uri.parse(srcPath));
        vv.start();
    }
}

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

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate