hi,

be sure that whether emulator can play video or not...............



On Jan 4, 9:39 pm, ikalbeniz <[email protected]> wrote:
> hi,
>
> i have been following some messages on the mail list and I have found
> a way to play streaming video, but it seems that don’t work with mp4.
> The code is like this:
>
> main.xml
> *************
> <?xml version="1.0" encoding="utf-8"?>
> <LinearLayout
>     xmlns:android="http://schemas.android.com/apk/res/android";
>     android:orientation="vertical"
>     android:layout_width="fill_parent"
>     android:layout_height="fill_parent">
>     <TextView
>         android:layout_width="fill_parent"
>         android:layout_height="wrap_content"
>         android:text="Video Playback JOC" />
>     <RelativeLayout
>         android:layout_width="fill_parent"
>         android:layout_height="wrap_content"
>         android:id="@+id/frame">
>         <VideoView
>             android:id="@+id/video"
>             android:layout_width="226px"
>             android:layout_height="194px"
>             android:keepScreenOn="true" />
>     </RelativeLayout>
> </LinearLayout>
>
> MainActivity.java
> *******************
> /*
>  * To change this template, choose Tools | Templates
>  * and open the template in the editor.
>  */
>
> package org.me.videoplayer;
>
> import android.app.Activity;
> import android.os.Bundle;
> import android.widget.VideoView;
> import android.widget.MediaController;
> import android.net.Uri;
>
> /**
>  *
>  * @author iker.perez
>  */
> public class MainActivity extends Activity {
>
>     /** Called when the activity is first created. */
>     @Override
>     public void onCreate(Bundle icicle) {
>               super.onCreate(icicle);
>               setContentView(R.layout.main);
>                //getWindow().setFormat(PixelFormat.TRANSLUCENT);
>
>                 //videoHolder = new VideoView(this);
>               VideoView videoView = (VideoView) findViewById
> (R.id.video);
>               MediaController mc = new MediaController(this);
>               mc.setAnchorView(videoView);
>               Uri video = Uri.parse("http://www.eitb.com/multimedia/
> videos/2010/01/04/224025/KIR_caparros_20100104_094955.mp4");
>               videoView.setMediaController(mc);
>               videoView.setVideoURI(video);
>               videoView.start();
>     }
>
> }
>
> I have an error saying that this video cannot be transmitted to my
> device? Anyone knows what happens?
-- 
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

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