Commit 5abac888 by zhanghaozhe

视频安全问题

parent 6ad3b130
......@@ -507,9 +507,12 @@ class Video extends Component {
})
this.player.on('durationchange', () => {
let videoTime = window.sessionStorage.getItem('videoTimeBeforeReload')
let rate = window.sessionStorage.getItem('videoRateBeforeReload')
if (videoTime) {
this.player.currentTime(Number(videoTime))
rate && this.player.playbackRate(rate)
window.sessionStorage.removeItem('videoTimeBeforeReload')
window.sessionStorage.removeItem('videoRateBeforeReload')
}
})
this.player.on('ratechange', () => {
......@@ -568,6 +571,7 @@ class Video extends Component {
this.currentVideoTimer = setTimeout(() => {
if (this.currentVideoExpireTime < new Date().getTime()) {
window.sessionStorage.setItem('videoTimeBeforeReload', this.player.currentTime())
window.sessionStorage.setItem('videoRateBeforeReload', this.player.playbackRate())
this.getVideoSrc()
}
}, interval)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment