Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
2
2015-12-uni-ffm
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
CmS
2015-12-uni-ffm
Commits
32736a79
Commit
32736a79
authored
11 years ago
by
Hakim El Hattab
Browse files
Options
Downloads
Patches
Plain Diff
auto play/pause html5 media when entering/leaving slide (#388)
parent
18795c16
No related branches found
Branches containing commit
No related tags found
Loading
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
js/reveal.js
+36
-0
36 additions, 0 deletions
js/reveal.js
js/reveal.min.js
+2
-2
2 additions, 2 deletions
js/reveal.min.js
with
38 additions
and
2 deletions
js/reveal.js
+
36
−
0
View file @
32736a79
...
@@ -1147,6 +1147,10 @@ var Reveal = (function(){
...
@@ -1147,6 +1147,10 @@ var Reveal = (function(){
}
}
}
}
// Handle embedded content
stopEmbeddedContent
(
previousSlide
);
startEmbeddedContent
(
currentSlide
);
updateControls
();
updateControls
();
updateProgress
();
updateProgress
();
...
@@ -1419,6 +1423,38 @@ var Reveal = (function(){
...
@@ -1419,6 +1423,38 @@ var Reveal = (function(){
}
}
/**
* Start playback of any embedded content inside of
* the targeted slide.
*/
function
startEmbeddedContent
(
slide
)
{
if
(
slide
)
{
toArray
(
slide
.
querySelectorAll
(
'
video, audio
'
)
).
forEach
(
function
(
el
)
{
if
(
!
el
.
hasAttribute
(
'
data-ignore
'
)
)
{
el
.
play
();
}
}
);
}
}
/**
* Stop playback of any embedded content inside of
* the targeted slide.
*/
function
stopEmbeddedContent
(
slide
)
{
if
(
slide
)
{
toArray
(
slide
.
querySelectorAll
(
'
video, audio
'
)
).
forEach
(
function
(
el
)
{
if
(
!
el
.
hasAttribute
(
'
data-ignore
'
)
)
{
el
.
pause
();
}
}
);
}
}
/**
/**
* Reads the current URL (hash) and navigates accordingly.
* Reads the current URL (hash) and navigates accordingly.
*/
*/
...
...
This diff is collapsed.
Click to expand it.
js/reveal.min.js
+
2
−
2
View file @
32736a79
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