... | @@ -18,7 +18,7 @@ allprojects { |
... | @@ -18,7 +18,7 @@ allprojects { |
|
```
|
|
```
|
|
dependencies {
|
|
dependencies {
|
|
//获得场景视频SDK,必须引入
|
|
//获得场景视频SDK,必须引入
|
|
implementation 'com.bokecc:vod:3.3.3'
|
|
implementation 'com.bokecc:vod:3.4.0'
|
|
//播放加密视频必须引用http和drmv6
|
|
//播放加密视频必须引用http和drmv6
|
|
implementation 'com.bokecc:http:1.2.0'
|
|
implementation 'com.bokecc:http:1.2.0'
|
|
implementation 'com.bokecc:drmv6:2.19.0'
|
|
implementation 'com.bokecc:drmv6:2.19.0'
|
... | @@ -189,6 +189,10 @@ public class MainActivity extends AppCompatActivity implements TextureView.Surfa |
... | @@ -189,6 +189,10 @@ public class MainActivity extends AppCompatActivity implements TextureView.Surfa |
|
private String USERID = "在此配置账户ID";
|
|
private String USERID = "在此配置账户ID";
|
|
private String API_KEY = "在此配置API_KEY";
|
|
private String API_KEY = "在此配置API_KEY";
|
|
private String videoId = "在此配置视频ID";
|
|
private String videoId = "在此配置视频ID";
|
|
|
|
//开通授权验证播放功能的需要配置授权验证码,
|
|
|
|
//没有开通授权播放功能的,verificationCode 填null
|
|
|
|
private String verificationCode = "在此配置视频授权验证码";
|
|
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
protected void onCreate(Bundle savedInstanceState) {
|
|
protected void onCreate(Bundle savedInstanceState) {
|
... | @@ -201,7 +205,7 @@ public class MainActivity extends AppCompatActivity implements TextureView.Surfa |
... | @@ -201,7 +205,7 @@ public class MainActivity extends AppCompatActivity implements TextureView.Surfa |
|
// 播放DRM加密视频需要这行代码,播放非加密视频不需要
|
|
// 播放DRM加密视频需要这行代码,播放非加密视频不需要
|
|
player.setDRMServerPort(HuodeApplication.getDrmServerPort());
|
|
player.setDRMServerPort(HuodeApplication.getDrmServerPort());
|
|
// 设置视频播放信息
|
|
// 设置视频播放信息
|
|
player.setVideoPlayInfo(videoId, USERID, API_KEY,null, context);
|
|
player.setVideoPlayInfo(videoId, USERID, API_KEY,verificationCode , context);
|
|
// 重置DRMServer(),播放非加密视频不需要
|
|
// 重置DRMServer(),播放非加密视频不需要
|
|
HuodeApplication.getDRMServer().reset();
|
|
HuodeApplication.getDRMServer().reset();
|
|
mTexture = tv_paly_video.getSurfaceTexture();
|
|
mTexture = tv_paly_video.getSurfaceTexture();
|
... | | ... | |