2

I came across Drew Baker's froogaloop API example page: http://labs.funkhausdesign.com/examples/vimeo/froogaloop2-api-basics.html

I view and copy the exact source code on a html but when I test it locally, the API does not work, vimeo player does not play, nor alert the messages

it only works when I host the html locally with MAMP why is this ????

Thanks !

Brendan Nee
  • 5,087
  • 2
  • 33
  • 32
Ray Tsai
  • 128
  • 5
  • 14

2 Answers2

3

Are you sure you're adding the &api=1 string to the video?

I don't have a Froogaloop demo handy, but I did make a demo that doesn't use Froogaloop: check it out here.

Mottie
  • 84,355
  • 30
  • 126
  • 241
  • hey man thanks for the reply, I do have api=1 ... :s ... really love the demo! helps heaps ! the vimeo api doc is so poor, it's really hard to get my head around how it exactly works :/ – Ray Tsai Dec 11 '11 at 00:17
  • I'm sorry, I should have asked first, but the demo I shared only works on an iframe based player.. it basically uses the iframes "postMessage" to pass a json string between the parent and the iframe. This functionality isn't available is IE8 and older though. So if you need to play a video in an older browser, use the embed player like in the link you shared. – Mottie Dec 11 '11 at 00:33
  • thanks a lot ! starting getting an idea how it works, I think I will only be using the iframe embed player so that's not a problem, cheers ! .... still has no idea why it needs to be hosted to function properly ... I mirror your example to a html file and test it locally .... it only works when I place the javascript at the bottom of the body ... but when I place javascript at the bottom for my example, nothing changed .... this is so weird : ( – Ray Tsai Dec 11 '11 at 01:23
  • OH duh! I see what you're asking now... Yeah, the problem is due to browser security restrictions between local files and the internet. Check out this [SO answer](http://stackoverflow.com/a/1568653/145346) – Mottie Dec 11 '11 at 14:12
  • I know this is old, but +1 for the fiddled demo. Thanks! – woz Mar 01 '14 at 20:02
1

Froogaloop doesn't work on local urls with file://. You'll need to make your HTML available via http. You could use the node.js http-server to do this easily.

Install from npm:

$ npm install http-server -g

From the directory you'd like to serve:

$ http-server

Many other options exist including MAMP, Dropbox's public folder or Python's SimpleHTTPServer

Community
  • 1
  • 1
Brendan Nee
  • 5,087
  • 2
  • 33
  • 32