Commit f0e95c3d by 李伟康

提交代码

1 parent bd917267
...@@ -33,10 +33,18 @@ export function Audio (url, callBack) { ...@@ -33,10 +33,18 @@ export function Audio (url, callBack) {
audioContext.decodeAudioData(xhr.response, buffer => { audioContext.decodeAudioData(xhr.response, buffer => {
this.buffer = buffer this.buffer = buffer
if (buffer) { if (buffer) {
if (wx.getNetworkType) wx.getNetworkType({
success: function (res) {
_this._playSourceNode() _this._playSourceNode()
callBack() callBack()
} }
}) })
else {
_this._playSourceNode()
callBack()
}
}
})
} }
} }
xhr.send() xhr.send()
......
...@@ -219,14 +219,13 @@ export default { ...@@ -219,14 +219,13 @@ export default {
viewFlag: false, viewFlag: false,
audio: null, audio: null,
audioFlag: false, audioFlag: false,
videoUrl: '', videoUrl: ''
test: Date.now()
} }
}, },
mounted () { mounted () {
let _this = this let _this = this
let jsApiList = window.$ISWXWORK ? ['launchMiniprogram'] : ['updateAppMessageShareData'] let jsApiList = window.$ISWXWORK ? ['launchMiniprogram'] : ['updateAppMessageShareData']
wxConfig.init(['getLocation', 'openLocation', 'onMenuShareAppMessage', ...jsApiList]).then(() => { wxConfig.init(['getLocation', 'openLocation', 'getNetworkType', 'onMenuShareAppMessage', ...jsApiList]).then(() => {
wxConfig.ready(() => { wxConfig.ready(() => {
this.getActivityDetail() this.getActivityDetail()
}) })
...@@ -275,8 +274,14 @@ export default { ...@@ -275,8 +274,14 @@ export default {
this.getActivityGroup() this.getActivityGroup()
let [redirectUrl] = window.location.href.split('?') let [redirectUrl] = window.location.href.split('?')
if (data.activityVideos && data.activityVideos.length) { if (data.activityVideos && data.activityVideos.length) {
data.activityVideos.map((e, index) => { // data.activityVideos.map((e, index) => {
e.poster = `${e.activityVideo}?x-oss-process=video/snapshot,t_10000,m_fast,f_jpg` // e.poster = `${e.activityVideo}?x-oss-process=video/snapshot,t_10000,m_fast,f_jpg`
// })
/**安卓退出全屏 */
document.addEventListener('webkitfullscreenchange', () => {
if (!document.webkitIsFullScreen && data.activityMusic) {
this.audioAutoPlay()
}
}) })
} }
if (data.activityMusic) { if (data.activityMusic) {
...@@ -312,7 +317,6 @@ export default { ...@@ -312,7 +317,6 @@ export default {
}) })
}, },
imgError (index) { imgError (index) {
alert('2')
this.detail.activityVideos[index].poster = '' this.detail.activityVideos[index].poster = ''
}, },
share () { share () {
...@@ -356,6 +360,10 @@ export default { ...@@ -356,6 +360,10 @@ export default {
this.currentVideoIndex = index this.currentVideoIndex = index
let video = this.$refs[`video-${index}`][0] let video = this.$refs[`video-${index}`][0]
video.controls = false video.controls = false
video.addEventListener('webkitendfullscreen', () => {
this.audioAutoPlay()
video.removeEventListener('webkitendfullscreen')
})
if (ISMOBILE) this.showLoading('准备中...') if (ISMOBILE) this.showLoading('准备中...')
if (audioFlag) this.audioAutoPlay(true) if (audioFlag) this.audioAutoPlay(true)
setTimeout(() => { setTimeout(() => {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!