Commit 5e826c18 authored by sujie@126.com's avatar sujie@126.com

dd

parent 9d47a89d
......@@ -139,7 +139,7 @@ Page({
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
this.videoContext = wx.createVideoContext('video');
this.videoContextOnline = wx.createVideoContext('video');
},
/**
......@@ -156,6 +156,9 @@ Page({
if (this.videoContext) {
this.videoContext.stop();
}
if (this.videoContextOnline) {
this.videoContextOnline.stop();
}
this.innerAudioContext.pause();
this.resetAudiosPlayStatus()
clearInterval(this.data.voiceInterval);
......@@ -168,6 +171,9 @@ Page({
if (this.videoContext) {
this.videoContext.stop();
}
if (this.videoContextOnline) {
this.videoContextOnline.stop();
}
this.innerAudioContext.pause();
this.setData({
audioStorage: {
......@@ -329,6 +335,9 @@ Page({
if (this.videoContext) {
this.videoContext.stop();
}
if (this.videoContextOnline) {
this.videoContextOnline.stop();
}
this.innerAudioContext.pause();
this.setData({
audioStorage: {
......@@ -339,9 +348,9 @@ Page({
},
clickVideo(){
if(this.data.videoStatus.isPlay){
this.videoContext.pause();
this.videoContextOnline.pause();
}else{
this.videoContext.play()
this.videoContextOnline.play()
if(this.curAudioValue){
let audioStorage = this.data.audioStorage;
audioStorage[this.curAudioValue].play = false;
......@@ -369,19 +378,19 @@ Page({
const { index } = e.currentTarget.dataset;
switch (index) {
case 0:
this.videoContext.playbackRate(0.8)
this.videoContextOnline.playbackRate(0.8)
break;
case 1:
this.videoContext.playbackRate(1)
this.videoContextOnline.playbackRate(1)
break;
case 2:
this.videoContext.playbackRate(1.25)
this.videoContextOnline.playbackRate(1.25)
break;
case 3:
this.videoContext.playbackRate(1.5)
this.videoContextOnline.playbackRate(1.5)
break;
case 4:
this.videoContext.playbackRate(2)
this.videoContextOnline.playbackRate(2)
break;
default:
break;
......@@ -546,8 +555,8 @@ Page({
value,
duration
} = e.currentTarget.dataset;
if(this.videoContext){
this.videoContext.stop();
if(this.videoContextOnline){
this.videoContextOnline.stop();
}
this.innerAudioContext.src = audioorigin(value);
this.curAudioValue = value;
......@@ -782,6 +791,9 @@ Page({
mode
} = e.currentTarget.dataset;
this.innerAudioContext.pause();
if (this.videoContextOnline) {
this.videoContextOnline.stop();
}
this.setData({
'videostatus.videoId': src,
'videostatus.videoShow': true,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment