@Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        getSupportActionBar().setDisplayHomeAsUpEnabled(true);
        getSupportActionBar().setDisplayShowHomeEnabled(true);
        getSupportActionBar().setDisplayShowTitleEnabled(true);
        getSupportActionBar().setDisplayUseLogoEnabled(false);
        getSupportActionBar().setTitle("CustomMediaPlayer");
        setContentView(R.layout.activity_api_custom_mediaplayer);

        jzvdStd = findViewById(R.id.videoplayer);

        JZDataSource jzDataSource = null;
        try {
            jzDataSource = new JZDataSource(getAssets().openFd("local_video.mp4"));
            jzDataSource.title = "饺子快长大";
        } catch (IOException e) {
            e.printStackTrace();
        }
        jzvdStd.setUp(jzDataSource, JzvdStd.SCREEN_NORMAL, JZMediaSystemAssertFolder.class);


//        jzvdStd.setUp("http://jzvd.nathen.cn/342a5f7ef6124a4a8faf00e738b8bee4/cf6d9db0bd4d41f59d09ea0a81e918fd-5287d2089db37e62345123a1be272f8b.mp4"
//                , "饺子快长大", JzvdStd.SCREEN_NORMAL, new JZMediaIjk(jzvdStd));

        Glide.with(this)
                .load("http://jzvd-pic.nathen.cn/jzvd-pic/1bb2ebbe-140d-4e2e-abd2-9e7e564f71ac.png")
                .into(jzvdStd.thumbImageView);

    }
@ Override protected void onCreate ( @ Nullable Bundle savedInstanceState ) { super . onCreate ( savedInstanceState ) ; getSupportActionBar ( ) . setDisplayHomeAsUpEnabled ( true ) ; getSupportActionBar ( ) . setDisplayShowHomeEnabled ( true ) ; getSupportActionBar ( ) . setDisplayShowTitleEnabled ( true ) ; getSupportActionBar ( ) . setDisplayUseLogoEnabled ( false ) ; getSupportActionBar ( ) . setTitle ( "CustomMediaPlayer" ) ; setContentView ( R . layout . activity_api_custom_mediaplayer ) ; jzvdStd = findViewById ( R . id . videoplayer ) ; JZDataSource jzDataSource = null ; try { jzDataSource = new JZDataSource ( getAssets ( ) . openFd ( "local_video.mp4" ) ) ; jzDataSource . title = "饺子快长大" ; } catch ( IOException e ) { e . printStackTrace ( ) ; } jzvdStd . setUp ( jzDataSource , JzvdStd . SCREEN_NORMAL , JZMediaSystemAssertFolder . class ) ; Glide . with ( this ) . load ( "http://jzvd-pic.nathen.cn/jzvd-pic/1bb2ebbe-140d-4e2e-abd2-9e7e564f71ac.png" ) . into ( jzvdStd . thumbImageView ) ; }
这里其实并不需要handler，为了防止播放中切换播放器引擎导致的崩溃，实际使用时一般不会遇到，可以随时调用JZVideoPlayer.setMediaInterface();