Commit 6ad3b130 by zhanghaozhe

视频安全问题

parent ac6d0920
......@@ -16,7 +16,6 @@ import jsCookie from 'js-cookie'
import Single from "src/components/detail/single";
import SingleSuccess from "../detail/single/singleSuccess";
import './CustomPlayButton'
import VConsole from 'vconsole'
let alert = Modal.alert
......@@ -112,7 +111,6 @@ class Video extends Component {
componentDidMount() {
new VConsole()
if (window.location.protocol === 'https:') {
window.location.replace('http' + window.location.href.slice(5))
return
......@@ -486,16 +484,6 @@ class Video extends Component {
})
this.player.addChild('CustomPlayButtonCover')
this.player.on('play', () => {
console.log('play')
let videoTime = window.sessionStorage.getItem('videoTimeBeforeReload')
if (videoTime) {
setTimeout(() => {
// window.alert(videoTime)
this.player.currentTime(Number(videoTime))
}, 2000)
// window.sessionStorage.removeItem('videoTimeBeforeReload')
}
const {videoList, activeIndex, vCourseId, course = {}} = this.state
// 当视频播放时 看是否是第一次播放(初次进入页面 刷新页面 切换视频 都是第一次播放 需要获取上次的播放时间)
if (this.isCurrentVideoFirstPlay) {
......@@ -517,10 +505,12 @@ class Video extends Component {
this.setupTimer();
}
})
this.player.on('ready', () => {
console.log('ready')
this.player.on('durationchange', () => {
let videoTime = window.sessionStorage.getItem('videoTimeBeforeReload')
if (videoTime) {
this.player.currentTime(Number(videoTime))
window.sessionStorage.removeItem('videoTimeBeforeReload')
}
})
this.player.on('ratechange', () => {
this.currentPlaybackRate = this.player.playbackRate()
......
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