Android - Playing Mp4

风流意气都作罢 提交于 2019-12-06 12:20:40

问题


I am trying to play video files from http urls in my app. Why is that my app plays only certain mp4 files (I tried 512k mp4 and it worked), and doesn't play some others?

Here's the snippet of my code:

    mVideoView.setVideoPath(myVideoURL);
    mVideoView.setMediaController(new MediaController(this));
    mVideoView.seekTo(currentPosition);
    mVideoView.requestFocus(); 

Thanks Chris


回答1:


Make sure your mp4's aren't DRM'd, and that they're not wider than 320 pixels (videoView will not scale them for you). Are you getting any useful errors in LogCat?



来源:https://stackoverflow.com/questions/2910292/android-playing-mp4

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!