Question

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

Was it helpful?

Solution

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top