提交 1ed818eb authored 作者: 王鹏飞's avatar 王鹏飞

修复线上代码错误导致的系统报警

上级 fb000368
...@@ -126,7 +126,7 @@ module.exports = Behavior({ ...@@ -126,7 +126,7 @@ module.exports = Behavior({
}, },
// 跳转到指定位置,单位s // 跳转到指定位置,单位s
seek(position) { seek(position) {
this.player.seek(position) this.player && this.player.seek(position)
console.log('video', 'seek') console.log('video', 'seek')
}, },
// 设置倍速播放 // 设置倍速播放
...@@ -188,10 +188,11 @@ module.exports = Behavior({ ...@@ -188,10 +188,11 @@ module.exports = Behavior({
const { duration } = e.detail const { duration } = e.detail
this.setData({ duration }) this.setData({ duration })
console.log('video', 'onloadedmetadata') console.log('video', 'onloadedmetadata')
this.data.startTime && this.seek(this.data.startTime)
}, },
onFullScreenChange() { onFullScreenChange() {
this.triggerEvent('fullscreenchange') this.triggerEvent('fullscreenchange')
console.log('video', 'onloadedmetadata') console.log('video', 'onfullscreenchange')
}, },
onError(e) { onError(e) {
this.updateStatus('ended') this.updateStatus('ended')
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
autoplay="{{ autoplay }}" autoplay="{{ autoplay }}"
loop="{{ loop }}" loop="{{ loop }}"
muted="{{ muted }}" muted="{{ muted }}"
initial-time="{{ time }}" initial-time="{{ startTime }}"
show-center-play-btn="{{ false }}" show-center-play-btn="{{ false }}"
auto-pause-if-open-native="{{ false }}" auto-pause-if-open-native="{{ false }}"
bindplay="onPlay" bindplay="onPlay"
......
...@@ -3,13 +3,13 @@ const env = 'production' ...@@ -3,13 +3,13 @@ const env = 'production'
if (env === 'production') { if (env === 'production') {
module.exports = { module.exports = {
appVersion: 'sofia_v3.2.7', appVersion: 'sofia_v3.2.8',
apiBaseURL: 'https://wechat-api.ezijing.com', // 接口请求地址 apiBaseURL: 'https://wechat-api.ezijing.com', // 接口请求地址
tenant: 'sofia' tenant: 'sofia'
} }
} else { } else {
module.exports = { module.exports = {
appVersion: 'sofia_v3.2.7', appVersion: 'sofia_v3.2.8',
apiBaseURL: 'https://wechat-api2.ezijing.com', // 接口请求地址 apiBaseURL: 'https://wechat-api2.ezijing.com', // 接口请求地址
tenant: 'sofia' tenant: 'sofia'
} }
......
...@@ -96,8 +96,11 @@ Page({ ...@@ -96,8 +96,11 @@ Page({
} }
// 跳转播放进度 // 跳转播放进度
const player = this.selectComponent('#player') const player = this.selectComponent('#player')
if (player && this.data.progress.cpt) { if (player) {
player.seek(this.data.progress.cpt) const startTime = this.data.progress.cpt
this.setData({ 'progress.cpt': startTime })
player.seek(startTime)
console.log(startTime)
} }
this.setData({ 'progress.loaded': true }) this.setData({ 'progress.loaded': true })
}) })
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
id="player" id="player"
src="{{ videoPlayUrl }}" src="{{ videoPlayUrl }}"
autoplay="{{ autoplay }}" autoplay="{{ autoplay }}"
startTime="{{ progress.cpt }}"
bindtimeupdate="onTimeupdate" bindtimeupdate="onTimeupdate"
bindswitchAudio="onSwitchVideo" bindswitchAudio="onSwitchVideo"
wx:if="{{ hasVideo }}" wx:if="{{ hasVideo }}"
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论