ijkplayer 视频播放

效果图
ijkplayer 视频播放_第1张图片

ijkPlayer
https://blog.csdn.net/thw_m/article/details/78851414

依赖

implementation 'com.dou361.ijkplayer:jjdxm-ijkplayer:1.0.5'

权限


    
    
    

布局

 

在activity中

public class MainActivity extends AppCompatActivity {

    private IjkVideoView ijkVideoView;
    private PlayerView playerView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        //视频播放路径
        String url = "http://ips.ifeng.com/video19.ifeng.com/video09/2014/06/16/1989823-102-086-0009.mp4";
        playerView = new PlayerView(this)
                .setTitle("视频播放")
                .setScaleType(PlayStateParams.fitparent)
                .hideMenu(false)
                .setPlaySource(url)
                .startPlay();

    }

    @Override
    protected void onStop() {
        super.onStop();
        playerView.stopPlay();
    }
}

你可能感兴趣的:(ijkplayer 视频播放)