|
@@ -58,7 +58,6 @@ Page({
|
|
|
onLoad(options) {
|
|
|
let videoId = options.videoId
|
|
|
this.getreadInfo(videoId, options.reset)
|
|
|
- console.log(options, 'options');
|
|
|
this.setData({
|
|
|
readingReset: options.reset || false,
|
|
|
readingType: options.readingType || 'public',
|
|
@@ -136,9 +135,11 @@ Page({
|
|
|
} else {
|
|
|
this.innerAudioContext.src = videoInfo.userRead.originVideo
|
|
|
this.innerAudioContext.onEnded(res => {
|
|
|
+ console.log("138innerAudioContext触发的");
|
|
|
this.finishRecord()
|
|
|
})
|
|
|
this.innerAudioContext.onStop((res) => {
|
|
|
+ console.log("143innerAudioContext触发的");
|
|
|
this.finishRecord()
|
|
|
});
|
|
|
}
|
|
@@ -156,7 +157,7 @@ Page({
|
|
|
this.finishRecord()
|
|
|
return
|
|
|
}
|
|
|
- if (this.data.readingReset) {
|
|
|
+ if (!this.data.readingReset) {
|
|
|
this.getHeight()
|
|
|
}
|
|
|
this.stopMediaState()
|
|
@@ -234,6 +235,9 @@ Page({
|
|
|
console.log("fail============= " + res);
|
|
|
},
|
|
|
});
|
|
|
+ recorderManager.onError(res => {
|
|
|
+ console.log(res, 'rrrrrsse');
|
|
|
+ })
|
|
|
//监听录音开始事件
|
|
|
recorderManager.onStart(() => {});
|
|
|
//监听录音结束事件
|
|
@@ -417,7 +421,9 @@ Page({
|
|
|
}
|
|
|
this.videoContext.play()
|
|
|
}
|
|
|
- this.startRecording()
|
|
|
+ /* if (!this.data.readingReset) {
|
|
|
+ this.startRecording()
|
|
|
+ } */
|
|
|
},
|
|
|
// 控制视频或音频的播放状态
|
|
|
async playMediaState() {
|
|
@@ -455,17 +461,19 @@ Page({
|
|
|
this.rowH = rect.height
|
|
|
}).exec()
|
|
|
},
|
|
|
- /**
|
|
|
- * 生命周期函数--监听页面卸载
|
|
|
- */
|
|
|
+ onHide() {
|
|
|
+ wsEngine.reset()
|
|
|
+ if (this.innerAudioContext) {
|
|
|
+ this.innerAudioContext.stop()
|
|
|
+ }
|
|
|
+ this.finishRecord()
|
|
|
+ },
|
|
|
onUnload() {
|
|
|
wsEngine.reset()
|
|
|
- recorderManager.stop();
|
|
|
if (this.innerAudioContext) {
|
|
|
this.innerAudioContext.stop()
|
|
|
}
|
|
|
- clearTimeout(this.setTimeoutObj)
|
|
|
- clearInterval(this.stl)
|
|
|
+ this.finishRecord()
|
|
|
},
|
|
|
creatShare() {
|
|
|
return new Promise((resolve, reject) => {
|
|
@@ -547,7 +555,6 @@ Page({
|
|
|
wx.canvasToTempFilePath({
|
|
|
canvas: canvas,
|
|
|
success(res) {
|
|
|
- console.log(wx.getStorageSync('shareVideoId'));
|
|
|
resolve({
|
|
|
title: '我的新作品发布啦,快来捧场点赞!',
|
|
|
path: `/pages/pkPage/index?videoId=${wx.getStorageSync('shareVideoId')}&uid=${wx.getStorageSync('uid')}`,
|