... | ... | @@ -241,13 +241,14 @@ player.setOnAuthMsgListener(new OnAuthMsgListener() { |
|
|
* @param enable 视频是否可以完整播放 0:不允许完整播放 1:允许完整播放
|
|
|
* @param freetime 视频试看时间,单位:秒
|
|
|
* @param messaage 不允许播放,或者试看结束时播放器显示的提示内容
|
|
|
* @param marqueeInfo 跑马灯信息,具体使用方法请参考4.18章节
|
|
|
*/
|
|
|
@Override
|
|
|
public void onAuthMsg(int enable, int freetime, String messaage) {
|
|
|
public void onAuthMsg(int enable, int freetime, String messaage, MarqueeInfo marqueeInfo) {
|
|
|
|
|
|
}
|
|
|
});
|
|
|
```
|
|
|
```
|
|
|
|
|
|
## 4.11 视频压缩功能
|
|
|
|
... | ... | @@ -281,7 +282,7 @@ VideoCompress.compressVideoHigh(filePath, compressOutPut, new VideoCompress.Comp |
|
|
|
|
|
}
|
|
|
});
|
|
|
```
|
|
|
```
|
|
|
|
|
|
```
|
|
|
/**
|
... | ... | @@ -311,7 +312,7 @@ VideoCompress.compressVideoMedium(filePath, compressOutPut, new VideoCompress.Co |
|
|
|
|
|
}
|
|
|
});
|
|
|
```
|
|
|
```
|
|
|
|
|
|
```
|
|
|
/**
|
... | ... | @@ -341,7 +342,7 @@ VideoCompress.compressVideoLow(filePath, compressOutPut, new VideoCompress.Compr |
|
|
|
|
|
}
|
|
|
});
|
|
|
```
|
|
|
```
|
|
|
|
|
|
## 4.12 课堂练习功能
|
|
|
|
... | ... | @@ -517,6 +518,45 @@ player.resetPlayedAndPausedTime(); |
|
|
android:layout_height="match_parent"
|
|
|
/>
|
|
|
```
|
|
|
获取跑马灯数据。
|
|
|
```
|
|
|
player.setOnAuthMsgListener(new OnAuthMsgListener() {
|
|
|
//marqueeInfo:跑马灯信息
|
|
|
@Override
|
|
|
public void onAuthMsg(int enable, int freetime, String messaage, MarqueeInfo marqueeInfo) {
|
|
|
//获得跑马灯类型,text:文字,image:图片
|
|
|
String type = marqueeInfo.getType();
|
|
|
//获得循环次数
|
|
|
int loop = marqueeInfo.getLoop();
|
|
|
//获得文字信息
|
|
|
MarqueeInfo.TextBean textBean = marqueeInfo.getTextBean();
|
|
|
//获得文字内容
|
|
|
String content = textBean.getContent();
|
|
|
//获得字体大小
|
|
|
int font_size = textBean.getFont_size();
|
|
|
//获得文字颜色
|
|
|
String color = textBean.getColor();
|
|
|
if (!TextUtils.isEmpty(color) && color.length() == 8) {
|
|
|
String textColor = "#" + color.substring(2, 8);
|
|
|
if (textColor.length() == 7) {
|
|
|
//textColor:文字颜色,格式如:#ffffff
|
|
|
mv_video.setTextColor(textColor);
|
|
|
}
|
|
|
}
|
|
|
//获得图片信息
|
|
|
MarqueeInfo.ImageBean imageBean = marqueeInfo.getImageBean();
|
|
|
//获得图片url
|
|
|
String image_url= imageBean.getImage_url();
|
|
|
//获得图片宽度
|
|
|
int width= imageBean.getWidth();
|
|
|
//获得图片高度
|
|
|
int width = imageBean.getHeight();
|
|
|
//获得动作节点
|
|
|
ArrayList<MarqueeAction> action = marqueeInfo.getAction();
|
|
|
}
|
|
|
});
|
|
|
```
|
|
|
|
|
|
设置跑马灯类型。
|
|
|
```
|
|
|
//MarqueeView.TEXT:文字 MarqueeView.IMAGE:图片
|
... | ... | @@ -705,7 +745,7 @@ player.setOnDreamWinErrorListener(new OnDreamWinErrorListener() { |
|
|
503:DRM加密版本错误
|
|
|
504:源文件不存在
|
|
|
505:加载数据失败
|
|
|
```
|
|
|
```
|
|
|
|
|
|
### 4.20.2 ijkplayer错误码
|
|
|
|
... | ... | @@ -729,4 +769,5 @@ int MEDIA_ERROR_IO = -1004;//IO 错误 |
|
|
int MEDIA_ERROR_MALFORMED = -1007;比特流不符合相关的编码标准和文件规范
|
|
|
int MEDIA_ERROR_UNSUPPORTED = -1010;//数据不支持
|
|
|
int MEDIA_ERROR_TIMED_OUT = -110;//数据超时
|
|
|
``` |
|
|
```
|
|
|
|