Below is the code i try to play video from the url , but  am getting
an error canot stream this video

XML
<?xml version="1.0" encoding="utf-8"?>
<AbsoluteLayout
android:id="@+id/media"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#000000"
xmlns:android="http://schemas.android.com/apk/res/android";>

<VideoView android:id="@+id/media_video"
android:layout_width="fill_parent" android:layout_height="240px"
/>
<Button
android:id="@+id/media_home"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#000000"
android:text="Home"
android:textColor="#FFFFFF"
android:layout_x="10px"
android:layout_y="410px">



</Button>
</AbsoluteLayout>


JAVA Code
package com.app1;


import android.app.Activity;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.MediaController;
import android.widget.VideoView;


public class Media extends Activity {


        private VideoView video;


        public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);


        setContentView(R.layout.main);


        Button bottoneHome = (Button) findViewById(R.id.media_home);
        bottoneHome.setOnClickListener(mHomeListener);


        video = (VideoView) findViewById(R.id.media_video);


        //video.setVideoURI(Uri.parse("http://www.jsharkey.org/
downloads/dailytest.3gp"));
        video.setVideoPath("http://www.jsharkey.org/downloads/
dailytest.3gp");
        //video.setVideoURI(Uri.parse("android.resource://com.app1/"
+R.raw.v));


        video.setMediaController(new MediaController(this));
        video.requestFocus();


    }


         private OnClickListener mHomeListener = new OnClickListener
()
         {
                public void onClick(View v)
                {
                    finish();
                }
         };



}

am getting sorry this video is not valid for streaming

-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to