0

This my play video app It works fine in 3G but it forces close via WIFI this is the code:

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

public class Video extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_video);

        String path="http://commonsware.com/misc/test2.3gp";


        Uri uri=Uri.parse(path);
        MediaController mc = new MediaController(this);

        VideoView video=(VideoView)findViewById(R.id.videoView);
        mc.setAnchorView(video);
        mc.setMediaPlayer(video);
        video.setMediaController(mc);
        video.setVideoURI(uri);
        video.start();
    }

}

and this is the manifest

<uses-permission android:name="android.permission.INTERNET"/>

This is the logCat

03-25 09:25:27.019: W/IInputConnectionWrapper(20221): showStatusIcon on inactive InputConnection
03-25 09:25:32.359: I/MediaPlayer(20221): uri is:http://commonsware.com/misc/test2.3gp
03-25 09:25:32.359: I/MediaPlayer(20221): path is null
03-25 09:25:32.359: D/MediaPlayer(20221): Couldn't open file on client side, trying server side
03-25 09:25:32.489: D/VideoView(20221): onMeasure()
03-25 09:25:32.489: I/VideoView(20221):     Setting size: 320x240
03-25 09:25:32.569: D/VideoView(20221): onMeasure()
03-25 09:25:32.569: I/VideoView(20221):     Setting size: 320x240
03-25 09:25:32.699: E/MediaPlayer(20221): error (1, -2147483648)
03-25 09:25:32.699: E/MediaPlayer(20221): Error (1,-2147483648)
03-25 09:25:32.699: D/VideoView(20221): Error: 1,-2147483648

In the screen apperas: "this video can´t be played" Any clue??

Thank you very much

Ivan
  • 215
  • 3
  • 17
  • 1
    post your logcat output. – Anup Cowkur Mar 25 '13 at 08:18
  • Sorry Anup,I´ve already added it – Ivan Mar 25 '13 at 08:28
  • @Ivan : Are you sure your wifi network is able to route the request to the commonsware server? Have you tried just using your device browser to connect to `http://commonsware.com/`? – Squonk Mar 25 '13 at 08:35
  • I don't see any problem with the code. Check if your wifi is able to access the internet and connect to the path you have mentioned. Just connect to wifi and open the url in your browser and see if it works. – Anup Cowkur Mar 25 '13 at 08:39
  • I´m sorry I didn´t pass the firewall. It works now. Thank you very much – Ivan Mar 25 '13 at 09:12

1 Answers1

0

I had a mistake, via wifi I have to pass a firewall and I forgot to do it in that device, it was my fail.

Thanks to everybody

Ivan
  • 215
  • 3
  • 17