|
@@ -40,6 +40,7 @@ Component({
|
|
|
isStartAudioPlay1: false,
|
|
|
isStartPlay2: false,
|
|
|
isStartPlay3: false,
|
|
|
+ animator1Name: 'dd4'
|
|
|
},
|
|
|
|
|
|
/**
|
|
@@ -55,7 +56,7 @@ Component({
|
|
|
this.triggerEvent('ready')
|
|
|
if (!this.innerAudioContext1) {
|
|
|
this.innerAudioContext1 = wx.createInnerAudioContext({
|
|
|
- useWebAudioImplement: false // 是否使用 WebAudio 作为底层音频驱动,默认关闭。对于短音频、播放频繁的音频建议开启此选项,开启后将获得更优的性能表现。由于开启此选项后也会带来一定的内存增长,因此对于长音频建议关闭此选项
|
|
|
+ useWebAudioImplement: true // 是否使用 WebAudio 作为底层音频驱动,默认关闭。对于短音频、播放频繁的音频建议开启此选项,开启后将获得更优的性能表现。由于开启此选项后也会带来一定的内存增长,因此对于长音频建议关闭此选项
|
|
|
})
|
|
|
this.innerAudioContext1.src = 'https://houseoss.4dkankan.com/mini-ar-test/AR/01/audio1.MP3'
|
|
|
this.innerAudioContext1.onPlay(() => {
|
|
@@ -71,9 +72,17 @@ Component({
|
|
|
})
|
|
|
})
|
|
|
this.innerAudioContext1.onEnded(() => {
|
|
|
+
|
|
|
+ if (this.animator1) {
|
|
|
+ console.log('animator1重置', this.data.animator1Name)
|
|
|
+ this.animator1.stop(this.data.animator1Name);
|
|
|
+
|
|
|
+ }
|
|
|
console.log('log:audio:ended')
|
|
|
this.setData({
|
|
|
isStartAudioPlay1: false,
|
|
|
+ isVideoEnd1: false,
|
|
|
+ isStartPlay1: false
|
|
|
})
|
|
|
})
|
|
|
console.log('this.innerAudioContext1', this.innerAudioContext1)
|
|
@@ -203,7 +212,7 @@ Component({
|
|
|
!this.data.isStartAudioPlay1 && this.innerAudioContext1.play();
|
|
|
}
|
|
|
if (this.animator1) {
|
|
|
- this.data.isStartPlay1 ? this.animator1.resume('dd4') : this.animator1.play('dd4')
|
|
|
+ this.data.isStartPlay1 ? this.animator1.resume(this.data.animator1Name) : this.animator1.play(this.data.animator1Name)
|
|
|
}
|
|
|
this.setData({
|
|
|
isStartPlay1: true
|
|
@@ -253,7 +262,10 @@ Component({
|
|
|
this.innerAudioContext1.pause()
|
|
|
}
|
|
|
if (this.animator1) {
|
|
|
- this.animator1.pause('dd4')
|
|
|
+ this.animator1.pause(this.data.animator1Name)
|
|
|
+ }
|
|
|
+ if (this.video1) {
|
|
|
+ this.video1.pause()
|
|
|
}
|
|
|
}
|
|
|
if (type === 2) {
|