VideoView播放视频异常MediaPlayer: Error (1,-2147483648)
程序员文章站
2022-06-15 16:02:56
...
异常信息如下:
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)
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
原因如下:
原因在于,MP4有多种编码格式,例如H.264,H.263等,而Android版本较低的机器只支持部分编码; 我的测试是这样的:华为荣耀6,4.4.4系统可以运行程序播放视频,Genymotion4.4.4以及5.0.0都不易运行程序播放视频,Genymotion6.0.0可以运行程序播放视频
推荐阅读