Home > english, Programming > An example how to use the VIMEO Moogaloop Javascript API

An example how to use the VIMEO Moogaloop Javascript API

August 19th, 2009 Leave a comment Go to comments

Last time I worked a little with the Moogaloop JavaScript API, because I thought it would be a nice workaround solution for integrate the Moogaloop API in an Adobe AIR Application. First time I tried the example code from the vimeo api documentation and it worked fine on my webserver. But for my case I did not want to use the SWIFF JavaScript Code. Only the SWFObject Code for embedding Flash Content in HTML was for me o.k. So I spent a few hours to get this API work without this SWIFF JavaScript thing. I tried a lot, failed a lot, cried a lot and laughed a lot about myself and my limited JavaScript knowledge. So now I am happy with my current version, because it works fine without this SWIFF thing, except loading a new Video (or should I say loading a new clipID) into this SWF Container failed. So if anyone has an idea, please post a comment here!

Download SWFObject  Code Example

Related posts:

  1. Working with Vimeo Moogaloop API in Flash
  2. Vimeo Moogaloop in Flex – FlexVimeoPlayer Component
  3. An Adobe Air Component for the Vimeo Moogaloop API
  4. The new YouTube AS3 Chromeless API in Flex, Air, Flash

  1. Jaimon Mathew
    December 19th, 2009 at 15:16 | #1

    Hi,

    First of all a big thanks for posting this. I also needed the same functionality and the sample from vimeo’s website wasn’t working at all. I’ve managed to get new clips loading, so I thought I’ll share that with you. When the video is first loaded, somehow the element “myContent” disappears from the DOM tree, so the second call to SWFObject fails. Solution?, create “myContent” if it doesn’t exists.

    first add a container div on top of myContent like,

    …..

    Then when loading the second clip before calling swfobject.embedSWF, add these lines,

    var vp=document.getElementById(‘myContent’);
    if(!vp) {
    var container=document.getElementById(‘myContentContainer’);
    container.innerHTML=”;
    vp=document.createElement(‘DIV’);
    vp.id=’myContent’;
    container.appendChild(vp);
    }
    swfobject.embedSWF(“http://www.vimeo.com/moogaloop.swf”,’myContent’….

    HTH

    Jaimon

  2. admin
    December 19th, 2009 at 17:39 | #2

    Hi Jaimon,

    I know this problem… And I am still have it :-( I don’t know a solution and JavaScript is not really my cup of tea. Sorry. Hopefully some of my bolg readers know a good solution…

    Best regards,
    Flo

  3. Jaimon Mathew
    December 21st, 2009 at 12:47 | #3

    Hi Flo, may be I wasn’t clear on my first post. As I mentioned there, I did manage to get new clips playing. You can see the source code for a fully working example at http://docs.google.com/Doc?docid=0ASBiQVsuhHGlZDRrd2Z4Zl8xZG03OWt4ZHA&hl=en

    HTH

    Jaimon

  4. admin
    December 21st, 2009 at 13:25 | #4

    Uh yeah Jaimon. You were clear! I read to fast your comment and answered to fast… Thanks a lot for your solution. It also works fine on my server! :-) Thanks!!

    Maybe I will rewrite my Air Vimeo Component now :-)

  5. ben
    February 10th, 2011 at 13:26 | #5

    hey thanks… your example works ! Saying this because the ones provided by vimeo itself don’t. #shame on ‘em (; !

  1. March 2nd, 2010 at 14:04 | #1