Android play video problem : Device Specific
I used the following code to play the video. It is working properly.
videoView = (VideoView) findViewById(R.id.VideoView);
File f=new File(Environment.getExternalStorageDirectory(), "words/"+videoname);
Uri video = Uri.parse(f.getAbsolutePath());
videoView.setVideoURI(video);
videoView.start();
But sometimes a few specific files starts to play and almose at the end of the video, it is giving error with following msg.
Cannot play video
Sorry, this video cannot be played
This is happening only when I am trying it Motorola Droid.
In the logcate it is giving following error.
04-16 11:46:12.244: WARN/MediaPlayer(7541): info/warning (1, 44)
04-16 11:46:12.244: INFO/MediaPlayer(7541): Info (1,44)
04-16 11:46:12.244: DEBUG/MediaPlayer(7541): getMetadata
04-16 11:46:12.268: DEBUG/AudioHardwareMot(7788): AudioMgr:Output 0xb538 exitin开发者_StackOverflow社区g standby
04-16 11:46:14.018: WARN/AudioSystem(7112): AudioFlinger server died!
04-16 11:46:14.018: WARN/AudioSystem(7112): AudioPolicyService server died!
04-16 11:46:14.018: INFO/ServiceManager(1040): service 'media.audio_flinger' died
04-16 11:46:14.018: INFO/ServiceManager(1040): service 'media.player' died
04-16 11:46:14.018: INFO/ServiceManager(1040): service 'media.camera' died
04-16 11:46:14.018: INFO/ServiceManager(1040): service 'media.audio_policy' died
04-16 11:46:14.018: WARN/MediaPlayer(7541): MediaPlayer server died!
04-16 11:46:14.018: ERROR/MediaPlayer(7541): error (100, 0)
04-16 11:46:14.018: ERROR/MediaPlayer(7541): Error (100,0)
04-16 11:46:14.018: DEBUG/VideoView(7541): Error: 100,0
04-16 11:46:14.557: INFO/(7802): ServiceManager: 0xad80
But the same file is playing without any problem in other device. What may the problem?
精彩评论