Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mr-julyedu
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
baiguangyao
mr-julyedu
Commits
6ad3b130
Commit
6ad3b130
authored
Aug 28, 2020
by
zhanghaozhe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
视频安全问题
parent
ac6d0920
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
16 deletions
+6
-16
src/components/video/index.js
+6
-16
No files found.
src/components/video/index.js
View file @
6ad3b130
...
...
@@ -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
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment