Commit 95c3773f by 李伟康

修复BUG

1 parent b2596f3f
...@@ -8,10 +8,11 @@ export function Audio (url, callBack) { ...@@ -8,10 +8,11 @@ export function Audio (url, callBack) {
if (this.isPlayingBGM || off) { if (this.isPlayingBGM || off) {
this.sourceNode.stop() this.sourceNode.stop()
this.isPlayingBGM = false this.isPlayingBGM = false
console.log('暂停——————————————', this.sourceNode)
} else this._playSourceNode() } else this._playSourceNode()
} }
} }
this.stopVideo = function(){ this.stopVideo = function () {
if (typeof this.sourceNode == 'object') { if (typeof this.sourceNode == 'object') {
if (this.isPlayingBGM) { if (this.isPlayingBGM) {
this.sourceNode.stop() this.sourceNode.stop()
...@@ -28,6 +29,7 @@ export function Audio (url, callBack) { ...@@ -28,6 +29,7 @@ export function Audio (url, callBack) {
_sourceNode.connect(audioContext.destination) _sourceNode.connect(audioContext.destination)
_sourceNode.start(0) _sourceNode.start(0)
this.sourceNode = _sourceNode this.sourceNode = _sourceNode
console.log('播放——————————————', this.sourceNode)
this.isPlayingBGM = true this.isPlayingBGM = true
} }
let loadAndAutoPlay = (audioUrl) => { let loadAndAutoPlay = (audioUrl) => {
......
...@@ -345,6 +345,13 @@ export default { ...@@ -345,6 +345,13 @@ export default {
return `${days}天${hours}:${minutes}:${second}` return `${days}天${hours}:${minutes}:${second}`
} }
this.detail.activityVideos[index].duration = date_format(srcElement.duration) 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) { authLocation (data) {
if (data.distance) this.openLocation() if (data.distance) this.openLocation()
...@@ -386,22 +393,14 @@ export default { ...@@ -386,22 +393,14 @@ export default {
window.$AUDIO.toggleBGM() window.$AUDIO.toggleBGM()
}, },
playVideo (index) { playVideo (index) {
let _this = this, let{ audioFlag } = this
{ audioFlag } = this
this.currentVideoIndex = index this.currentVideoIndex = index
let video = this.$refs[`video-${index}`][0] 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) if (audioFlag) this.audioAutoPlay(true)
setTimeout(() => { setTimeout(() => {
video.play() video.play()
if (video.webkitRequestFullScreen) video.webkitRequestFullScreen() if (video.webkitRequestFullScreen) video.webkitRequestFullScreen()
}, 500) }, 500)
}, },
openLocation () { openLocation () {
let { sponsorName, activityAddressDetailName, activityAddressLat, activityAddressLng } = this.detail 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!