0

I try to stream video with this link with code below :

VideoView mVideoView;
MediaController mMediaController = new MediaController(this);
mVideoView = (VideoView)findViewById(R.id.videoView1);
mVideoView.setMediaController(mMediaController);        
mVideoView.setVideoURI(Uri.parse("http://ref10.vn.aditmedia.net:8080/video?channel=1004&token=6436488"));
mVideoView.start();

But i can't stream this video althought i try this link on Windows Media Player and it can stream this video. Anyone help me!

Thanks

David Snabel-Caunt
  • 57,804
  • 13
  • 114
  • 132
  • What format is the video? Android can only handle [certain formats](http://developer.android.com/guide/appendix/media-formats.html). – David Snabel-Caunt Jan 15 '13 at 13:51
  • are the spaces in the URL on purpose? – koljaTM Jan 15 '13 at 13:53
  • @koljaTM Apologies, I think that was my edit – David Snabel-Caunt Jan 15 '13 at 13:53
  • This URL run good in another app in android, i just test but with my code it doesn't @_@ – user1467949 Jan 15 '13 at 14:00
  • Perhaps, but **what** format is the video? What logcat output do you see? Does the device display a dialog saying 'Sorry this video cannot be played' or something else? – David Snabel-Caunt Jan 15 '13 at 14:04
  • Yup! It show "Sorry this video cannot be played". Log cat show this :01-15 21:07:49.101: V/MediaPlayer(16066): message received msg=100, ext1=1, ext2=-2147483648 01-15 21:07:49.101: E/MediaPlayer(16066): error (1, -2147483648) 01-15 21:07:49.101: V/MediaPlayer(16066): callback application 01-15 21:07:49.101: V/MediaPlayer(16066): back from callback 01-15 21:07:49.101: E/MediaPlayer(16066): Error (1,-2147483648) 01-15 21:07:49.101: D/VideoView(16066): Error: 1,-2147483648 – user1467949 Jan 15 '13 at 14:11
  • Thanks i've fixed this bug, this video type is in support by android 4.1 or above – user1467949 Jan 16 '13 at 02:23

1 Answers1

0

Look at your URL,remove spaces between http://ref10.vn.aditmedia.net:8080/video? and channel=1004&token=6436488

EvZ
  • 11,889
  • 4
  • 38
  • 76
  • I determine my URL but there is no space! I dont understand what you mean – user1467949 Jan 15 '13 at 13:59
  • Can you try mVideoView.setVideoPath("http://ref10.vn.aditmedia.net:8080/video?channel=1004&token=6436488") instead of mVideoView.setVideoURI("") and provide a cat log please. – EvZ Jan 15 '13 at 14:04
  • Here is my log cat:01-15 21:07:49.101: V/MediaPlayer(16066): message received msg=100, ext1=1, ext2=-2147483648 01-15 21:07:49.101: E/MediaPlayer(16066): error (1, -2147483648) 01-15 21:07:49.101: V/MediaPlayer(16066): callback application 01-15 21:07:49.101: V/MediaPlayer(16066): back from callback 01-15 21:07:49.101: E/MediaPlayer(16066): Error (1,-2147483648) 01-15 21:07:49.101: D/VideoView(16066): Error: 1,-2147483648 – user1467949 Jan 15 '13 at 14:08
  • Possible duplicate : http://stackoverflow.com/questions/5711081/error-1-2147483648-on-android – EvZ Jan 15 '13 at 14:11