Android 4.4
及以上花费太多时间在启动画面上呈现视频。
这是播放视频的方法。
private void playVideo() {
mVideoView.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {
@Override
public void onPrepared(MediaPlayer mp) {
mVideoView.requestFocus();
mVideoView.start();
}
});
mVideoView.setOnCompletionListener(new MediaPlayer.OnCompletionListener() {
@Override
public void onCompletion(MediaPlayer vmp) {
}
});
String uriPath = "android.resource://" + getPackageName() + "/" + R.raw.animation_converted;
Uri uri = Uri.parse(uriPath);
mVideoView.setVideoURI(uri);
if (mStopPosition != 0)
mVideoView.seekTo(mStopPosition);
}
}
告诉我我的错误或给我任何建议。