Commit f0e95c3d by 李伟康

提交代码

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