android - RTSP Url of video not working in VideoView -
i creating video playing app youtube. have extracted video data using gdata api , got 3gp url format 1,6. got extracted media:group --> media:content element. device info android 4.0.3 , model micromax p350.
these video working in vlc player not in videoview
enter code here in app. here code:
<linearlayout android:id="@+id/linearlayout01" android:layout_height="fill_parent" android:paddingleft="2px" android:paddingright="2px" xmlns:android="http://schemas.android.com/apk/res/android" android:paddi`enter code here`ngtop="2px" android:paddingbottom="2px" android:layout_width="fill_parent" android:orientation="vertical"> <videoview android:layout_height="fill_parent" android:layout_width="fill_parent" android:id="@+id/videoview" /> </linearlayout>
mainactivity.java
package com.example.firstapp; import android.app.activity; import android.os.bundle; import android.widget.mediacontroller; import android.widget.videoview; public class mainactivity extends activity { @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); videoview videoview = (videoview)findviewbyid(r.id.videoview); //mediacontroller mediacontroller = new mediacontroller(this); // mediacontroller.setanchorview(videoview); //videoview.setmediacontroller(mediacontroller); videoview.setvideopath("rtsp://v1.cache8.c.youtube.com/ciileny73wiagqneb1sj_pgnormydsanfeggugz2awrlb3mm/0/0/0/video.3gp"); videoview.start(); } }
must video not in 1 of supported formats:
http://developer.android.com/guide/appendix/media-formats.html
Comments
Post a Comment