如何发挥的MP4视频videoview android系统中? [英] How to play .mp4 video in videoview in android?

查看:300
本文介绍了如何发挥的MP4视频videoview android系统中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的工作视频播放器应用程序,我想在本地videoview播放的 .MP4 视频。我的无法播放 视频使用的网址。我收到错误的对不起,该视频无法播放,然后还我的无法播放下载的视频本机videoview。

I am working on video player application, I want to play .mp4 video in native videoview. I am not able to play video using url. I am getting error Sorry this video cannot be played and also I am not able to play downloaded video in native videoview.

我的code在videoview播放视频:

My code for playing video in videoview:

String mUrl = "http://www.servername.com/projects/projectname/videos/1361439400.mp4";

VideoView mVideoView  = (VideoView)findViewById(R.id.videoview)
videoMediaController = new MediaController(this);
mVideoView.setVideoPath(mUrl);
videoMediaController.setMediaPlayer(mVideoView);
mVideoView.setMediaController(videoMediaController);
mVideoView.requestFocus();
mVideoView.start();

请分享你的想法是一样的。

Kindly share your ideas for the same.

感谢。

推荐答案

MP4仅仅是一个容器 - 视频和音频流里面都将是连接codeD不同格式

MP4 is just a container - the video and audio stream inside it will both be encoded in different formats.

Android的原生只支持某些类型的格式。有一个列表在这里:

Android natively only supports certain types of formats. There is a list here:

<一个href="http://developer.android.com/guide/appendix/media-formats.html">http://developer.android.com/guide/appendix/media-formats.html

请确保视频和音频编码类型的支持。仅仅因为它说:MP4并不意味着它应该是可玩的。

Make sure the video and audio encoding type is supported. Just because it says "mp4" doesn't automatically mean it should be playable.

这篇关于如何发挥的MP4视频videoview android系统中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆