Skip to content

Commit 3d5ced0

Browse files
committed
- Improved: backgruondVideo example.
1 parent 386b6b8 commit 3d5ced0

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

examples/backgroundVideo.html

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,14 @@
5858
width: 100%;
5959
left: 0;
6060
top: 43%;
61+
62+
/*
63+
* Preventing flicker on some browsers
64+
* See http://stackoverflow.com/a/36671466/1081396 or issue #183
65+
*/
66+
-webkit-transform: translate3d(0,0,0);
67+
-ms-transform: translate3d(0,0,0);
68+
transform: translate3d(0,0,0);
6169
}
6270

6371
/*solves problem with overflowing video in Mac with Chrome */
@@ -91,13 +99,7 @@
9199
$(document).ready(function() {
92100
$('#fullpage').fullpage({
93101
verticalCentered: true,
94-
sectionsColor: ['#1bbc9b', '#4BBFC3', '#7BAABE'],
95-
afterRender: function(){
96-
97-
98-
//playing the video
99-
$('video').get(0).play();
100-
}
102+
sectionsColor: ['#1bbc9b', '#4BBFC3', '#7BAABE']
101103
});
102104
});
103105
</script>
@@ -135,7 +137,7 @@
135137

136138
<div id="fullpage">
137139
<div class="section " id="section0">
138-
<video autoplay loop muted id="myVideo">
140+
<video id="myVideo" loop muted data-autoplay>
139141
<source src="imgs/flowers.mp4" type="video/mp4">
140142
<source src="imgs/flowers.webm" type="video/webm">
141143
</video>

0 commit comments

Comments
 (0)