... | ... | @@ -343,9 +343,65 @@ VideoCompress.compressVideoLow(filePath, compressOutPut, new VideoCompress.Compr |
|
|
});
|
|
|
```
|
|
|
|
|
|
## 4.12 错误处理
|
|
|
## 4.12 课堂练习功能
|
|
|
|
|
|
支持用户自定义课堂练习功能的回调,可以通过调用player的setOnExercisesMsgListener(OnExercisesMsgListener onExercisesMsgListener)方法,当视频有课堂练习信息时,在该接口中回调课堂练习信息。
|
|
|
|
|
|
```
|
|
|
//获得视频课堂练习信息
|
|
|
player.setOnExercisesMsgListener(new OnExercisesMsgListener() {
|
|
|
@Override
|
|
|
public void onExercisesMessage(JSONArray exArray) {
|
|
|
|
|
|
}
|
|
|
});
|
|
|
```
|
|
|
|
|
|
课堂练习回调的格式为JSONArray,单条课堂练习的内容如下,请用户自行解析。
|
|
|
|
|
|
```
|
|
|
{
|
|
|
"id": 86,
|
|
|
"questions": [
|
|
|
|
|
|
{
|
|
|
"answers": [
|
|
|
{
|
|
|
"content": "A、答案A",
|
|
|
"id": 608,
|
|
|
"right": true
|
|
|
},
|
|
|
{
|
|
|
"content": "B、答案B",
|
|
|
"id": 609,
|
|
|
"right": true
|
|
|
},
|
|
|
{
|
|
|
"content": "C、答案C",
|
|
|
"id": 610,
|
|
|
"right": true
|
|
|
},
|
|
|
{
|
|
|
"content": "D、答案D",
|
|
|
"id": 615,
|
|
|
"right": false
|
|
|
}
|
|
|
],
|
|
|
"content": "题目",
|
|
|
"explainInfo": "试题详解",
|
|
|
"id": 414,
|
|
|
"type": 1
|
|
|
}
|
|
|
|
|
|
],
|
|
|
"showTime": 20,
|
|
|
"title": "课堂练习"
|
|
|
}
|
|
|
```
|
|
|
|
|
|
## 4.13 错误处理
|
|
|
错误信息有两种,一种是播放器触发的错误,另一种是获得场景视频自定义的错误。
|
|
|
### 4.12.1 监听播放器的错误事件
|
|
|
### 4.13.1 监听播放器的错误事件
|
|
|
DWMediaPlayer重载了MediaPlayer的setOnErrorListener()方法,如果需要在应用中提示错误信息,可调用此方法设置OnErrorListener。具体实现方式如下:
|
|
|
|
|
|
```
|
... | ... | @@ -357,7 +413,7 @@ player.setOnErrorListener(new MediaPlayer.OnErrorListener() { |
|
|
}
|
|
|
});
|
|
|
```
|
|
|
### 4.12.2 监听获得场景视频自定义的错误事件
|
|
|
### 4.13.2 监听获得场景视频自定义的错误事件
|
|
|
|
|
|
```
|
|
|
player.setOnDreamWinErrorListener(new OnDreamWinErrorListener() {
|
... | ... | @@ -369,9 +425,9 @@ player.setOnDreamWinErrorListener(new OnDreamWinErrorListener() { |
|
|
```
|
|
|
|
|
|
|
|
|
## 4.13 错误码
|
|
|
## 4.14 错误码
|
|
|
|
|
|
### 4.13.1 HuodeException自定义的错误码
|
|
|
### 4.14.1 HuodeException自定义的错误码
|
|
|
|
|
|
```
|
|
|
101:无播放节点
|
... | ... | @@ -441,7 +497,7 @@ player.setOnDreamWinErrorListener(new OnDreamWinErrorListener() { |
|
|
505:加载数据失败
|
|
|
```
|
|
|
|
|
|
### 4.13.2 ijkplayer错误码
|
|
|
### 4.14.2 ijkplayer错误码
|
|
|
|
|
|
```
|
|
|
int MEDIA_INFO_UNKNOWN = 1;//未知信息
|
... | ... | |