VideoView播放视频异常MediaPlayer: Error (1,-2147483648)

异常信息如下:

05-28 23:19:52.019 15284-15284/com.softpo.videodemo E/dalvikvm: Could not find class 'android.os.PersistableBundle', referenced from method com.softpo.videodemo.MainActivity.access$super
05-28 23:19:52.019 15284-15284/com.softpo.videodemo E/dalvikvm: Could not find class 'android.os.PersistableBundle', referenced from method com.softpo.videodemo.MainActivity.access$super
05-28 23:19:52.019 15284-15284/com.softpo.videodemo E/dalvikvm: Could not find class 'android.media.session.MediaController', referenced from method com.softpo.videodemo.MainActivity.access$super
05-28 23:19:52.019 15284-15284/com.softpo.videodemo E/dalvikvm: Could not find class 'android.widget.Toolbar', referenced from method com.softpo.videodemo.MainActivity.access$super
05-28 23:19:52.019 15284-15284/com.softpo.videodemo E/dalvikvm: Could not find class 'android.app.ActivityManager$TaskDescription', referenced from method com.softpo.videodemo.MainActivity.access$super
05-28 23:19:52.023 15284-15284/com.softpo.videodemo E/dalvikvm: Could not find class 'android.app.SharedElementCallback', referenced from method com.softpo.videodemo.MainActivity.access$super
05-28 23:19:52.023 15284-15284/com.softpo.videodemo E/dalvikvm: Could not find class 'android.os.PersistableBundle', referenced from method com.softpo.videodemo.MainActivity.access$super
05-28 23:19:52.023 15284-15284/com.softpo.videodemo E/dalvikvm: Could not find class 'android.app.SharedElementCallback', referenced from method com.softpo.videodemo.MainActivity.access$super
05-28 23:19:52.031 15284-15284/com.softpo.videodemo E/dalvikvm: Could not find class 'android.app.assist.AssistContent', referenced from method com.softpo.videodemo.MainActivity.access$super
05-28 23:19:52.031 15284-15284/com.softpo.videodemo E/dalvikvm: Could not find class 'android.view.SearchEvent', referenced from method com.softpo.videodemo.MainActivity.access$super
05-28 23:19:52.031 15284-15284/com.softpo.videodemo E/dalvikvm: Could not find class 'android.os.PersistableBundle', referenced from method com.softpo.videodemo.MainActivity.access$super
05-28 23:19:52.067 15284-15284/com.softpo.videodemo E/dalvikvm: Could not find class 'android.view.ViewOutlineProvider', referenced from method com.softpo.videodemo.widget.FullVideoView.access$super
05-28 23:19:52.067 15284-15284/com.softpo.videodemo E/dalvikvm: Could not find class 'android.animation.StateListAnimator', referenced from method com.softpo.videodemo.widget.FullVideoView.access$super
05-28 23:19:52.071 15284-15284/com.softpo.videodemo E/dalvikvm: Could not find class 'android.view.View$OnApplyWindowInsetsListener', referenced from method com.softpo.videodemo.widget.FullVideoView.access$super
05-28 23:19:52.071 15284-15284/com.softpo.videodemo E/dalvikvm: Could not find class 'android.view.ViewStructure', referenced from method com.softpo.videodemo.widget.FullVideoView.access$super
05-28 23:19:52.075 15284-15284/com.softpo.videodemo E/dalvikvm: Could not find class 'android.view.View$OnContextClickListener', referenced from method com.softpo.videodemo.widget.FullVideoView.access$super
05-28 23:19:52.079 15284-15284/com.softpo.videodemo E/dalvikvm: Could not find class 'android.view.WindowInsets', referenced from method com.softpo.videodemo.widget.FullVideoView.access$super
05-28 23:19:52.079 15284-15284/com.softpo.videodemo E/dalvikvm: Could not find class 'android.view.View$OnScrollChangeListener', referenced from method com.softpo.videodemo.widget.FullVideoView.access$super
05-28 23:19:52.083 15284-15284/com.softpo.videodemo E/dalvikvm: Could not find class 'android.view.ViewStructure', referenced from method com.softpo.videodemo.widget.FullVideoView.access$super
05-28 23:19:52.083 15284-15284/com.softpo.videodemo E/dalvikvm: Could not find class 'android.view.ViewStructure', referenced from method com.softpo.videodemo.widget.FullVideoView.access$super
05-28 23:19:52.083 15284-15284/com.softpo.videodemo E/dalvikvm: Could not find class 'android.view.WindowInsets', referenced from method com.softpo.videodemo.widget.FullVideoView.access$super
05-28 23:19:52.087 15284-15284/com.softpo.videodemo E/dalvikvm: Could not find class 'android.view.WindowInsets', referenced from method com.softpo.videodemo.widget.FullVideoView.access$super
05-28 23:19:52.447 15284-15284/com.softpo.videodemo E/OpenGLRenderer: Getting MAX_TEXTURE_SIZE from GradienCache
05-28 23:19:52.447 15284-15284/com.softpo.videodemo E/OpenGLRenderer: MAX_TEXTURE_SIZE: 16384
05-28 23:19:52.459 15284-15284/com.softpo.videodemo E/OpenGLRenderer: Getting MAX_TEXTURE_SIZE from Caches::initConstraints()
05-28 23:19:52.459 15284-15284/com.softpo.videodemo E/OpenGLRenderer: MAX_TEXTURE_SIZE: 16384
05-28 23:19:54.047 15284-15296/com.softpo.videodemo E/MediaPlayer: error (1, -2147483648)
05-28 23:19:54.047 15284-15284/com.softpo.videodemo E/MediaPlayer: Error (1,-2147483648)

原因如下:

原因在于,MP4有多种编码格式,例如H.264,H.263等,而Android版本较低的机器只支持部分编码; 我的测试是这样的:华为荣耀6,4.4.4系统可以运行程序播放视频,Genymotion4.4.4以及5.0.0都不易运行程序播放视频,Genymotion6.0.0可以运行程序播放视频

发布了44 篇原创文章 · 获赞 22 · 访问量 7万+
展开阅读全文

android VedioView不能播放此视频

07-14

做一个调用摄像头录像的demo,录像之后发送出去。期望的效果是录像结束,显示视频中的一个图片或者播放视频,然后确定发送将视频发出去,不需要有Controller那么高级的东西,只显示一下就行。但是我用VideoView播放说不能播放此视频,然后是黑屏,为什么呀?代码如下: protected void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); setContentView(R.layout.activity_take_video); initialize(); fileUri = Uri.fromFile(new File(Environment.getExternalStorageDirectory().getAbsolutePath()+ "/" + getTime() + ".3pg")); btnSend.setOnClickListener(this); btnCancle.setOnClickListener(this); startVideoCapture(); } private void startVideoCapture() { // TODO Auto-generated method stub Intent intent = new Intent(MediaStore.ACTION_VIDEO_CAPTURE); // intent.putExtra(MediaStore.EXTRA_OUTPUT, fileUri); intent.putExtra(MediaStore.EXTRA_VIDEO_QUALITY, 1); startActivityForResult(intent, 1); } @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { // TODO Auto-generated method stub // super.onActivityResult(arg0, arg1, arg2); if (resultCode == RESULT_OK) { Toast.makeText(this, "Image saved to :\n" + fileUri.toString(), Toast.LENGTH_LONG).show(); v_video.setVideoURI(fileUri); v_video.start(); } else if (resultCode == RESULT_CANCELED) { } else { } } 我在文件存放的目录下可以找到视频文件,并且可以正常播放,视频文件没有问题。LogCat: 07-14 15:39:01.641: D/MediaPlayer(25119): Message: MEDIA_ERROR(100), ext1=MEDIA_ERROR_UNKNOWN(1), ext2=0x80000000 07-14 15:39:01.642: E/MediaPlayer(25119): error (1, -2147483648) 07-14 15:39:01.642: D/MediaPlayer(25119): [virtual void android::MediaPlayer::notify(int, int, int, const android::Parcel *)] : [1107] callback app listenerNotNull=1, send=1 07-14 15:39:01.642: D/MediaPlayer(25119): [virtual void android::MediaPlayer::notify(int, int, int, const android::Parcel *)] : [1111] callback application 07-14 15:39:01.775: E/MediaPlayer(25119): Error (1,-2147483648) 07-14 15:39:01.776: D/VideoView(25119): Error: 1,-2147483648 问答

没有更多推荐了,返回首页

©️2019 CSDN 皮肤主题: 编程工作室 设计师: CSDN官方博客

分享到微信朋友圈

×

扫一扫,手机浏览