|
@@ -22,34 +22,35 @@ export default defineComponent({
|
|
|
});
|
|
|
|
|
|
const communicateCb = (res: any) => {
|
|
|
- console.log('h5消息',JSON.stringify(res))
|
|
|
+ console.log('h5消息',res)
|
|
|
+ const resInfo = res.data ? res.data : res;
|
|
|
// 开始播放
|
|
|
- if (res?.data?.api === "api_play") {
|
|
|
+ if (resInfo?.api === "api_play") {
|
|
|
console.log('h5开始播放')
|
|
|
state.playState = 'play';
|
|
|
setStep();
|
|
|
}
|
|
|
// 暂停播放
|
|
|
- if (res?.data?.api === "api_paused") {
|
|
|
+ if (resInfo?.api === "api_paused") {
|
|
|
console.log('暂停播放')
|
|
|
state.playState = 'paused';
|
|
|
}
|
|
|
// 暂停状态下,拖动进度
|
|
|
- if (res?.data?.api === "api_updateProgress") {
|
|
|
+ if (resInfo?.api === "api_updateProgress") {
|
|
|
console.log('拖动的进度')
|
|
|
if (state.playState === 'paused') {
|
|
|
- detailData.currentTime = res?.data?.content?.currentTime ? res?.data?.content?.currentTime : detailData.currentTime;
|
|
|
+ detailData.currentTime = resInfo?.content?.currentTime ? resInfo?.content?.currentTime : detailData.currentTime;
|
|
|
handlePlaying();
|
|
|
}
|
|
|
}
|
|
|
// 播放进度
|
|
|
- if (res?.data?.api === "api_playProgress") {
|
|
|
+ if (resInfo?.api === "api_playProgress") {
|
|
|
console.log('播放进度',res)
|
|
|
- if (res?.data?.content?.currentTime) {
|
|
|
- if (res?.data?.content?.currentTime < detailData.currentTime) {
|
|
|
+ if (resInfo?.content?.currentTime) {
|
|
|
+ if (resInfo?.content?.currentTime < detailData.currentTime) {
|
|
|
state.activeNoteIndex = 0
|
|
|
}
|
|
|
- detailData.currentTime = res?.data?.content?.currentTime
|
|
|
+ detailData.currentTime = resInfo?.content?.currentTime
|
|
|
}
|
|
|
}
|
|
|
};
|