ijkplayer 视频播放

ijkPlayer

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

依赖
implementation ‘com.dou361.ijkplayer:jjdxm-ijkplayer:1.0.5’

布局


权限

	
    
    
    

MainActivity
package com.example.day20rk;

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

import com.dou361.ijkplayer.widget.PlayStateParams;
import com.dou361.ijkplayer.widget.PlayerView;

public class MainActivity extends AppCompatActivity {

private PlayerView play;

@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";
    play = new PlayerView(this)
            .setTitle("视频播放")
            .setScaleType(PlayStateParams.fitparent)
            .hideMenu(true)
            .forbidTouch(false)
            .setPlaySource(url)
            .startPlay();
}

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

}

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