Commit 95c3773f by 李伟康

修复BUG

1 parent b2596f3f
......@@ -8,10 +8,11 @@ export function Audio (url, callBack) {
if (this.isPlayingBGM || off) {
this.sourceNode.stop()
this.isPlayingBGM = false
console.log('暂停——————————————', this.sourceNode)
} else this._playSourceNode()
}
}
this.stopVideo = function(){
this.stopVideo = function () {
if (typeof this.sourceNode == 'object') {
if (this.isPlayingBGM) {
this.sourceNode.stop()
......@@ -28,6 +29,7 @@ export function Audio (url, callBack) {
_sourceNode.connect(audioContext.destination)
_sourceNode.start(0)
this.sourceNode = _sourceNode
console.log('播放——————————————', this.sourceNode)
this.isPlayingBGM = true
}
let loadAndAutoPlay = (audioUrl) => {
......
......@@ -345,6 +345,13 @@ export default {
return `${days}天${hours}:${minutes}:${second}`
}
this.detail.activityVideos[index].duration = date_format(srcElement.duration)
srcElement.controls = false
srcElement.addEventListener('webkitendfullscreen', () => {
let { audioFlag } = this
if (audioFlag) this.audioAutoPlay()
srcElement.pause()
// video.removeEventListener('webkitendfullscreen')
})
},
authLocation (data) {
if (data.distance) this.openLocation()
......@@ -386,22 +393,14 @@ export default {
window.$AUDIO.toggleBGM()
},
playVideo (index) {
let _this = this,
{ audioFlag } = this
let{ audioFlag } = this
this.currentVideoIndex = index
let video = this.$refs[`video-${index}`][0]
video.controls = false
video.addEventListener('webkitendfullscreen', () => {
if (audioFlag) this.audioAutoPlay()
video.pause()
// video.removeEventListener('webkitendfullscreen')
})
if (audioFlag) this.audioAutoPlay(true)
setTimeout(() => {
video.play()
if (video.webkitRequestFullScreen) video.webkitRequestFullScreen()
}, 500)
},
openLocation () {
let { sponsorName, activityAddressDetailName, activityAddressLat, activityAddressLng } = this.detail
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!