Fancybox Chrome autoplay video issue

338 views
Skip to first unread message

Andrea Bosiger

unread,
Feb 16, 2012, 5:02:38 PM2/16/12
to fancybox
I'm using Fancybox as a lightbox. I have videos set up in external
html docs and are loaded in the Fancybox when the link is clicked from
the main doc. The problem is Fancybox is somehow preventing "autoplay"
in Chrome. Autoplay works in Chrome w/o Fancybox. I can drag
healthcarevideo1.html over to Chrome and it works fine.

From index.html

Fancybox script:
<script type="text/javascript">
$(document).ready(function() {
$(".video").fancybox({
'overlayOpacity': 0.9,
'hideOnContentClick': true
});
}); //ready
</script>

Body code:
<li><a class="video" href="video/healthcarevideo1.html">Smart
Outsourcing (HIPPA 5010, EMR)</a></li>
<li><a class="video" href="video/healthcarevideo2.html">Guaranteed
Rejection of Claims (HIPPA 5010)</a></li>

-->From healthcarevideo1.html:
<video width="640" height="360" controls autoplay>
<source src="http://clips.vorwaerts-gmbh.de/VfE_html5.mp4" type="video/
mp4">
<source src="http://clips.vorwaerts-gmbh.de/VfE.ogv" type="video/
ogg"></video>

Any ideas?
Thanks

Andrea Bosiger

unread,
Feb 16, 2012, 5:21:18 PM2/16/12
to fancybox
I got it. I had to add width, height and type. Final code:
<script type="text/javascript">
$(document).ready(function() {
$(".video").fancybox({
'overlayOpacity': 0.9,
'width': 640, //or whatever
'height': 360, //or whatever
'type' : 'iframe',
'scrolling': 'no'
});
}); //ready
</script>

JFK

unread,
Feb 16, 2012, 6:24:39 PM2/16/12
to fancybox
don't forget to mark my answer as correct in stackoverflow ;)
thanks
Reply all
Reply to author
Forward
0 new messages