Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
C
cmscenter
Project
Project
Details
Activity
Releases
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
吕祺
cmscenter
Commits
8217ab78
Commit
8217ab78
authored
Aug 09, 2021
by
吕祺
⛹🏽
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add control
parent
f6b84cd3
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
68 deletions
+8
-68
index.js
components/Video/index.js
+8
-68
No files found.
components/Video/index.js
View file @
8217ab78
...
@@ -3,84 +3,24 @@ import React from 'react'
...
@@ -3,84 +3,24 @@ import React from 'react'
export
default
class
Video
extends
React
.
PureComponent
{
export
default
class
Video
extends
React
.
PureComponent
{
constructor
(
props
)
{
constructor
(
props
)
{
super
(
props
)
super
(
props
)
this
.
state
=
{
mounted
:
false
}
this
.
mustPlay
=
this
.
mustPlay
.
bind
(
this
)
}
componentDidMount
()
{
this
.
setState
({
mounted
:
true
})
document
.
addEventListener
(
'WeixinJSBridgeReady'
,
this
.
mustPlay
,
false
)
}
mustPlay
()
{
if
(
this
.
state
.
mounted
)
{
document
.
getElementById
(
this
.
props
.
id
).
play
()
document
.
removeEventListener
(
'WeixinJSBridgeReady'
,
this
.
mustPlay
,
false
)
}
else
{
setTimeout
(
this
.
mustPlay
,
300
)
}
}
componentWillUnmount
()
{
document
.
removeEventListener
(
'WeixinJSBridgeReady'
,
this
.
mustPlay
,
false
)
}
}
render
()
{
render
()
{
const
{
poster
,
src
,
id
,
full
}
=
this
.
props
const
{
poster
,
src
,
id
}
=
this
.
props
const
{
mounted
}
=
this
.
state
if
(
!
full
)
{
return
(
<
video
id
=
{
id
}
loop
muted
=
{
true
}
playsInline
=
{
true
}
webkit
-
playsinline
=
"true"
x5
-
video
-
player
-
type
=
"h5-page"
x5
-
video
-
player
-
fullscreen
=
"true"
disableremoteplayback
=
"true"
autoPlay
preload
=
"auto"
poster
=
{
poster
}
>
<
source
id
=
"mp4"
src
=
{
src
}
type
=
"video/mp4"
/>
<
/video
>
)
}
poster
=
{
videoPoster
}
if
(
!
mounted
)
{
return
(
<
video
data
-
object
-
fit
=
"cover"
data
-
object
-
position
=
"100% 0%"
id
=
{
id
}
// loop
// muted={true}
playsInline
=
{
true
}
webkit
-
playsinline
=
"true"
x5
-
video
-
player
-
type
=
"h5-page"
x5
-
video
-
player
-
fullscreen
=
"true"
disableremoteplayback
=
"true"
// autoPlay
preload
=
"auto"
poster
=
{
poster
}
><
/video
>
)
}
return
(
return
(
<
video
<
video
data
-
object
-
fit
=
"cover"
data
-
object
-
position
=
"100% 0%"
id
=
{
id
}
id
=
{
id
}
playsInline
=
{
true
}
//
playsInline={true}
webkit
-
playsinline
=
"true"
//
webkit-playsinline="true"
x5
-
video
-
player
-
type
=
"h5-page"
//
x5-video-player-type="h5-page"
x5
-
video
-
player
-
fullscreen
=
"true"
//
x5-video-player-fullscreen="true"
disableremoteplayback
=
"true"
controls
preload
=
"auto"
preload
=
"auto"
poster
=
{
poster
}
poster
=
{
poster
}
>
>
<
source
id
=
"mp4"
src
=
{
src
}
type
=
"video/mp4"
/>
<
source
id
=
"mp4"
src
=
{
src
}
type
=
"video/mp4"
/>
<
/video
>
<
/video
>
)
)
}
}
}
}
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