Android 播放视频问题:设备特定
我使用以下代码来播放视频。它工作正常。
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();
但有时一些特定文件开始播放并且几乎在视频结束时,它会给出以下消息的错误。
Cannot play video
Sorry, this video cannot be played
仅当我尝试 Motorola Droid 时才会发生这种情况。
在日志中它给出以下错误。
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 exiting 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
但同一个文件在其他设备上播放没有任何问题。可能是什么问题?
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 exiting 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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论