Play video on Vimeo then onFinish closing video window

602 views
Skip to first unread message

TualatinWeb

unread,
Dec 2, 2010, 11:09:00 AM12/2/10
to fancybox
I've got Fancybox working with Vimeo and now I want the video window
to close when it's finished playing.

My javascript uses the id of mooga:

$("#mooga").fancybox({
'padding' : 0,
'autoScale' : false,
'transitionIn' : 'none',
'transitionOut' : 'none',
'hideOnContentClick' : false,
'width' : 630,
'height' : 367,
'type' : 'swf'
});

and my HTML is:

<a href="http://vimeo.com/moogaloop.swf?clip_id=16863868&autoplay=1"
id="mooga" ><img src="http://dascom-systems.com/new/wp-content/uploads/
Dascom_Testimonial_Button-01.jpg" alt="Play Video" border="0" /></a>

Looking at other examples I think that I need to use in Javascript:

event listener
onFinish
window.close()

Any help is appreciated.

RavanH

unread,
Dec 3, 2010, 5:08:10 AM12/3/10
to fancybox
This is an interesting notion and I'd be interested in getting it to
work too. To incorporate it in the next release of Easy FancyBox
plugin for WordPress which supports Vimeo by the way, so it might
serve your purpose too ;)

Now I found some generic javascript suggestions to detect the end of a
flash movie which might be usable :

A.

function poller(){
if (! thisMovie(moviename).IsPlaying()){ parent.$.fancybox.close(); }
window.setTimeout('poller()', 1000);
}

B.

yourObject.onStatus = function(detect) {
if(detect.code == "NetStream.Play.Stop") { parent.
$.fancybox.close(); }
}

C.

var movie = window.document.movie;
if(movie.TCurrentFrame("/") == movie.TotalFrames())
parent.$.fancybox.close();

D.

video.addEventListener(VideoEvent.COMPLETE, parent.
$.fancybox.close());


All only partly adapted and certainly untested :) so it needs work.

The route I see is to use 'onComplete' in FancyBox to start the
detection routine and then from within that function call parent.
$.fancybox.close(); ( do we need "parent." here? ) to auto-close the
overlay at the end of the movie...

Luca Pellicoro

unread,
Oct 31, 2013, 3:17:55 AM10/31/13
to fanc...@googlegroups.com
Resurrecting an old thread... 

I found a solution that worked for my needs by modifying froogaloop. 

See public/script.js and public/froogaloop.js (look for comments with HACK)

I started here:
Reply all
Reply to author
Forward
0 new messages