Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
logging-scratch-gui
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
David Goessmann
logging-scratch-gui
Commits
ab89ee1a
Unverified
Commit
ab89ee1a
authored
5 years ago
by
Benjamin Wheeler
Committed by
GitHub
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Revert "Pause video on tutorial window shrink"
parent
dc82e5f6
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/components/cards/card.css
+8
-0
8 additions, 0 deletions
src/components/cards/card.css
src/components/cards/cards.jsx
+24
-44
24 additions, 44 deletions
src/components/cards/cards.jsx
with
32 additions
and
44 deletions
src/components/cards/card.css
+
8
−
0
View file @
ab89ee1a
...
...
@@ -275,6 +275,14 @@
margin-right
:
0.5rem
;
}
.video-cover
{
width
:
100%
;
height
:
100%
;
position
:
absolute
;
top
:
0
;
left
:
0
;
}
.steps-list
{
display
:
flex
;
flex-direction
:
row
;
...
...
This diff is collapsed.
Click to expand it.
src/components/cards/cards.jsx
+
24
−
44
View file @
ab89ee1a
...
...
@@ -85,50 +85,32 @@ const CardHeader = ({onCloseCards, onShrinkExpandCards, onShowAll, totalSteps, s
</
div
>
);
class
VideoStep
extends
React
.
Component
{
componentDidMount
()
{
const
script
=
document
.
createElement
(
'
script
'
);
script
.
src
=
`https://fast.wistia.com/embed/medias/
${
this
.
props
.
video
}
.jsonp`
;
script
.
async
=
true
;
script
.
setAttribute
(
'
id
'
,
'
wistia-video-content
'
);
document
.
body
.
appendChild
(
script
);
const
script2
=
document
.
createElement
(
'
script
'
);
script2
.
src
=
'
https://fast.wistia.com/assets/external/E-v1.js
'
;
script2
.
async
=
true
;
script2
.
setAttribute
(
'
id
'
,
'
wistia-video-api
'
);
document
.
body
.
appendChild
(
script2
);
}
componentDidUpdate
()
{
const
video
=
window
.
Wistia
.
api
(
`
${
this
.
props
.
video
}
`
);
if
(
!
this
.
props
.
expanded
)
{
video
.
pause
();
}
}
componentWillUnmount
()
{
const
script
=
document
.
getElementById
(
'
wistia-video-content
'
);
script
.
parentNode
.
removeChild
(
script
);
const
script2
=
document
.
getElementById
(
'
wistia-video-api
'
);
script2
.
parentNode
.
removeChild
(
script2
);
}
render
()
{
return
(
<
div
className
=
{
styles
.
stepVideo
}
>
<
div
className
=
{
`wistia_embed wistia_async_
${
this
.
props
.
video
}
`
}
id
=
"video-div"
style
=
{
{
height
:
`257px`
,
width
:
`466px`
}
}
>
</
div
>
</
div
>
);
}
}
// Video step needs to know if the card is being dragged to cover the video
// so that the mouseup is not swallowed by the iframe.
const
VideoStep
=
({
video
,
dragging
})
=>
(
<
div
className
=
{
styles
.
stepVideo
}
>
{
dragging
?
(
<
div
className
=
{
styles
.
videoCover
}
/>
)
:
null
}
<
iframe
allowFullScreen
allowTransparency
=
"true"
frameBorder
=
"0"
height
=
"257"
scrolling
=
"no"
src
=
{
`https://fast.wistia.net/embed/iframe/
${
video
}
?seo=false&videoFoam=true`
}
title
=
"📹"
width
=
"466"
/>
<
script
async
src
=
"https://fast.wistia.net/assets/external/E-v1.js"
/>
</
div
>
);
VideoStep
.
propTypes
=
{
expanded
:
PropTypes
.
bool
.
isRequired
,
dragging
:
PropTypes
.
bool
.
isRequired
,
video
:
PropTypes
.
string
.
isRequired
};
...
...
@@ -316,7 +298,6 @@ const Cards = props => {
>
<
Draggable
bounds
=
"parent"
cancel
=
"#video-div"
// disable dragging on video div
position
=
{
{
x
:
x
,
y
:
y
}
}
onDrag
=
{
onDrag
}
onStart
=
{
onStartDrag
}
...
...
@@ -344,7 +325,6 @@ const Cards = props => {
steps
[
step
].
video
?
(
<
VideoStep
dragging
=
{
dragging
}
expanded
=
{
expanded
}
video
=
{
translateVideo
(
steps
[
step
].
video
,
locale
)
}
/>
)
:
(
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment