视频播放器(饺子播放器)

要求:SDK最小版本为16;

defaultConfig {
        applicationId "com.example.training"
        minSdkVersion 16 //此处修改
        targetSdkVersion 30
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

依赖:

//饺子播放器
    implementation 'cn.jzvd:jiaozivideoplayer:6.2.9'

布局


代码:

public void jiaoziPlayer(){


            String mp4path = Environment.getExternalStorageDirectory() + File.separator + "xxx.mp4";

            JZVideoPlayerStandard jzVideoPlayerStandard = (JZVideoPlayerStandard) findViewById(R.id.videoplayer);


            jzVideoPlayerStandard.setUp(mp4path
                    , JZVideoPlayerStandard.SCREEN_WINDOW_NORMAL, "饺子闭眼睛");


            jzVideoPlayerStandard.thumbImageView.setImageResource(R.drawable.ic_launcher_background);
        }

你可能感兴趣的:(视频播放器(饺子播放器))