|
@@ -1,5 +1,6 @@
|
|
|
import {
|
|
|
- getreadInfo
|
|
|
+ getreadInfo,
|
|
|
+ submitPlayLog
|
|
|
} from '~/api/video'
|
|
|
import {
|
|
|
publishWorks,
|
|
@@ -35,6 +36,7 @@ let recorderManager = wx.getRecorderManager();
|
|
|
Page({
|
|
|
data: {
|
|
|
videoInfo: {},
|
|
|
+ videoPath: '',
|
|
|
currentRow: null,
|
|
|
state: false,
|
|
|
// 示例播放状态
|
|
@@ -122,6 +124,7 @@ Page({
|
|
|
// 获取阅读内容
|
|
|
async getreadInfo(videoId, reset = false) {
|
|
|
let videoInfo = await getreadInfo(videoId)
|
|
|
+ console.log(videoInfo);
|
|
|
wx.setNavigationBarTitle({
|
|
|
title: videoInfo.userRead.title
|
|
|
})
|
|
@@ -132,6 +135,7 @@ Page({
|
|
|
return item
|
|
|
})
|
|
|
this.setData({
|
|
|
+ videoPath: videoInfo.userRead.originVideo,
|
|
|
article: data,
|
|
|
videoInfo
|
|
|
})
|
|
@@ -149,7 +153,7 @@ Page({
|
|
|
})
|
|
|
this.innerAudioContext.onStop((res) => {
|
|
|
console.log("143innerAudioContext触发的");
|
|
|
- // this.resetReading()
|
|
|
+
|
|
|
});
|
|
|
}
|
|
|
|
|
@@ -391,7 +395,6 @@ Page({
|
|
|
this.resetReading()
|
|
|
},
|
|
|
videoPlay() {
|
|
|
- console.log("触发");
|
|
|
if (this.data.state) {
|
|
|
return
|
|
|
}
|
|
@@ -409,7 +412,6 @@ Page({
|
|
|
})
|
|
|
} else {
|
|
|
if (this.data.readingReset) {
|
|
|
- console.log('是我播放了');
|
|
|
this.resultAudioContext.src = this.data.readDetail.tempFilePath;
|
|
|
this.resultAudioContext.play();
|
|
|
this.setData({
|
|
@@ -422,8 +424,17 @@ Page({
|
|
|
exampleState: true
|
|
|
})
|
|
|
}
|
|
|
- this.videoContext.play()
|
|
|
+ this.setData({
|
|
|
+ videoPath: this.data.videoInfo.userRead.videoPath
|
|
|
+ })
|
|
|
+ wx.nextTick(() => {
|
|
|
+ this.videoContext.play()
|
|
|
+ })
|
|
|
}
|
|
|
+ submitPlayLog({
|
|
|
+ userReadId: this.data.videoInfo.userRead.exampleId,
|
|
|
+ playStopTime: 1000
|
|
|
+ })
|
|
|
},
|
|
|
// 控制视频或音频的播放状态
|
|
|
async playMediaState() {
|
|
@@ -432,7 +443,12 @@ Page({
|
|
|
muted: false
|
|
|
})
|
|
|
if (this.data.videoInfo.userReadExtend.resourcesType == 0) {
|
|
|
- this.videoContext.play()
|
|
|
+ this.setData({
|
|
|
+ videoPath: this.data.videoInfo.userRead.originVideo
|
|
|
+ })
|
|
|
+ wx.nextTick(() => {
|
|
|
+ this.videoContext.play()
|
|
|
+ })
|
|
|
} else {
|
|
|
this.innerAudioContext.play();
|
|
|
}
|
|
@@ -445,7 +461,6 @@ Page({
|
|
|
resetReading() {
|
|
|
clearTimeout(this.setTimeoutObj)
|
|
|
clearInterval(this.stl)
|
|
|
- console.log(this.data.exampleState, this.data.state, 'vvvvvvvvvvvvvvvvvvvvvvv');
|
|
|
// 重置视频
|
|
|
if (this.data.videoInfo.userReadExtend.resourcesType == 0) {
|
|
|
this.videoContext.stop()
|
|
@@ -488,6 +503,7 @@ Page({
|
|
|
},
|
|
|
onUnload() {
|
|
|
this.resetReading()
|
|
|
+ this.storeBindings.destroyStoreBindings()
|
|
|
},
|
|
|
creatShare() {
|
|
|
return new Promise((resolve, reject) => {
|