安卓没有播放视频的MP4 [英] Android not playing Video .mp4

查看:84
本文介绍了安卓没有播放视频的MP4的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,我有prepared一个code只是从我的资源文件夹中扮演一个简单的MP4文件... 编码是这样的...

hi guys i have prepared a code to just play a simple mp4 file from my res folder... The coding is something like this...

    public class VideoPlayer extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.video);
        VideoView video = (VideoView)findViewById(R.id.VideoView);
        Uri uri = Uri.parse("android.resource://company.software.myapp/"
                + R.raw.myvideo);
        MediaController mc = new MediaController(this);
        video.setMediaController(mc);
        video.setVideoURI(uri);
        //video.requestFocus();
        video.start();
    }
}

现在虽然有玩不误......该活动会自动生成一个对话框,说:对不起,该视频无法播放...但我能听到的声音,并发挥到年底...我无法弄清楚笏问题是...

now though there is no error in playing... The activity automatically generates a dialog saying "sorry this video cannot be played"... but i can hear the Audio and it plays till end... i cant figure out wat the problem is...

推荐答案

感谢名单了很多commonsware.com ...但我找到了解决问题的办法......而令人惊讶的个人电脑处理器,是罪魁祸首?我查娜更高的配置和猜测笏......它的工作完全正常......虽然有时候,如果我们做一些处理在后台的对话框不来了,但在单击确定启动一段时间后播放的视频...

Thanx a lot commonsware.com... but i found the solution to the problem... And astonishingly its the PC processor which is the culprit... I checked n a higher configuration and guess wat... it worked perfectly fine... though sometimes if we do some processing in the background the dialog box does come up but on clicking ok it starts playing the video after some time...

但我可以证实,从资源播放的文件这种技术是好的,据我知道...

But i confirm that this technique of playing file from resource is ok as far as i know...

抱歉浪费乌尔precious时间在一个平凡的硬件问题...但希望它会是谁得到这个问题的其他人有用的...

sorry to waste ur precious time in a mundane hardware problem... but hope it'll be useful for other people who get this problem...

这篇关于安卓没有播放视频的MP4的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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