Android 播放视频问题:设备特定

发布于 2024-10-31 08:21:05 字数 1569 浏览 1 评论 0原文

我使用以下代码来播放视频。它工作正常。

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文