0

I have some mp4 files on a server and I need to play with the app. here is my code :

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.watch);  
    VideoView videoView = (VideoView) findViewById(R.id.videoView1);
    MediaController mediaController = new MediaController(this);
    mediaController.setAnchorView(videoView);
    Uri video = Uri.parse("http://php page that return the mp4");
    videoView.setMediaController(mediaController);
    videoView.setVideoURI(video);
    videoView.start();
}

I tried the code on a real phone 2.3.5 LogCat:

07-10 19:33:26.409: D/MediaPlayer(1432): Couldn't open file on client side, trying server side
07-10 19:33:26.479: D/VideoView(1432): onMeasure()
07-10 19:33:26.479: I/VideoView(1432):     Setting size: 320x202
07-10 19:33:33.379: D/VideoView(1432): onMeasure()
07-10 19:33:33.379: I/VideoView(1432):     Setting size: 320x180
07-10 19:33:33.419: I/VideoView(1432): start()
07-10 19:33:33.469: E/MediaPlayer(1432): error (1, -2147483648)
07-10 19:33:33.479: E/MediaPlayer(1432): Error (1,-2147483648)
07-10 19:33:33.489: D/VideoView(1432): Error: 1,-2147483648
07-10 19:34:12.809: W/KeyCharacterMap(1432): No keyboard for id 0
07-10 19:34:12.809: W/KeyCharacterMap(1432): Using default keymap: /system/usr/keychars/qwerty.kcm.bin
t0mm13b
  • 34,087
  • 8
  • 78
  • 110
Issam Zoli
  • 2,724
  • 1
  • 21
  • 35
  • A similar but related [question](http://stackoverflow.com/questions/11333939/error-codes-media-player-syntax-and-definition/11334871#comment14995853_11334871) appeared a few days ago – t0mm13b Jul 10 '12 at 18:58
  • Might be relevant: http://stackoverflow.com/questions/11419882/mediaplayer-play-mp4-from-server – Bryan Denny Jul 10 '12 at 19:01
  • I think that the Mediaplayer doesn't support mp4 !! – Issam Zoli Jul 10 '12 at 19:03
  • 1
    @BryanDenny Did you *recursively* link itself in your comment? :D :P – t0mm13b Jul 10 '12 at 19:22
  • @tomm13b Wow, I failed hard there. I meant this one: http://stackoverflow.com/questions/6380765/mediaplayer-error-2147483648-when-playing-file-on-internal-storage – Bryan Denny Jul 10 '12 at 20:42

0 Answers0