Android video playback issue: device

I used the following code to play the video. It is working correctly.

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 some specific files start playing and almose at the end of the video, it gives an error with the following msg.

 Cannot play video Sorry, this video cannot be played 

This only happens when I try to use the Motorola Droid.

In logcate, it reports the 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 plays without problems on another device. What is the problem?

+4
source share

Source: https://habr.com/ru/post/1347251/


All Articles