安卓videoview错误1,-2147483648 [英] android videoview error 1, -2147483648

查看:2220
本文介绍了安卓videoview错误1,-2147483648的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我收到错误,而从资产的文件夹和原始文件夹播放视频。
MediaPlayer的错误(1,-2147483648) VideoView错误1,-2147483648。

I am getting error while playing video from asset folder and raw folder.
MediaPlayer error (1, -2147483648) VideoView error 1, -2147483648.

我试图从资产的文件夹中。

I tried from asset folder as.

private String SrcPath = "file:///android_asset/aaa.mp4"; //also tried aaaa.mp3
VideoView vv = (VideoView)findViewById(R.id.videoView1);
vv.setVideoPath(SrcPath);
MediaController controller = new MediaController(this);
controller.setAnchorView(vv);
vv.setMediaController(controller);
vv.requestFocus();
vv.start();

和对原材料的文件夹,我用的URI:

and for raw folder i used URI as :

Uri video = Uri.parse("android.resource://com.usecontentprovider/raw/aaa.mp4");
vv.setVideoURI(video);

我在两种情况下得到了同样的错误消息。

I got the same error message in both cases.

推荐答案

我找到了解决办法,因为我能够播放视频的虚拟设备。

我更换了行

I found the solution as I am able to play video on virtual device.

I replaced the line

Uri video = Uri.parse("android.resource://com.usecontentprovider/raw/aaa.mp4");

Uri video = Uri.parse("android.resource://com.usecontentprovider/raw/"+R.raw.aaa);

和它的工作

这篇关于安卓videoview错误1,-2147483648的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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