adnroid饺子播放器jiaozivideoplayer

1、在这里插入图片描述

implementation 'cn.jzvd:jiaozivideoplayer:6.4.1'//饺子播放器
implementation 'com.github.bumptech.glide:glide:3.7.0'//图片加载

2、Layout XML添加控件
adnroid饺子播放器jiaozivideoplayer_第1张图片
3、Activity 使用

package com.example.administrator.myads;

import android.net.Uri;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;

import com.bumptech.glide.Glide;

import cn.jzvd.Jzvd;
import cn.jzvd.JzvdStd;

public class JiaoziActivity extends AppCompatActivity {

    private JzvdStd mVideoplayer;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.jiaozilayout);
        initView();
        JzvdStd jzvdStd = (JzvdStd) findViewById(R.id.videoplayer);
        jzvdStd.setUp("http://jzvd.nathen.cn/c6e3dc12a1154626b3476d9bf3bd7266/6b56c5f0dc31428083757a45764763b0-5287d2089db37e62345123a1be272f8b.mp4"
                , "饺子闭眼睛" , Jzvd.SCREEN_WINDOW_NORMAL);
        //jzvdStd.thumbImageView.setImageURI(Uri.parse("http://p.qpic.cn/videoyun/0/2449_43b6f696980311e59ed467f22794e792_1/640"));
        Glide.with(this).load("http://jzvd-pic.nathen.cn/jzvd-pic/1bb2ebbe-140d-4e2e-abd2-9e7e564f71ac.png").into(jzvdStd.thumbImageView);
    }

    private void initView() {
        mVideoplayer = (JzvdStd) findViewById(R.id.videoplayer);
    }
    @Override
    public void onBackPressed() {
        if (Jzvd.backPress()) {
            return;
        }
        super.onBackPressed();
    }
    @Override
    protected void onPause() {
        super.onPause();
        Jzvd.releaseAllVideos();
    }
}

你可能感兴趣的:(android)