Coleman
Coleman

Reputation: 565

How do I start the server in the Rdio web playback API example?

I am trying to get the "hello world" app for the Rdio web playback API working. I cloned the repo and opened the hello.html file. When I click play, the following error appears:

Uncaught TypeError: Cannot call method 'rdio_play' of null

I am getting that error because apiswf, which rdio_play is being called on, is null. The relevant code: apiswf.rdio_play($('#play_key').val());

In the issues for the repo, I found that another user had the same problem. That user figured out that her problem was that she hadn't started the local server. So it seems that the local server, if it was running, would put the needed swf in the element #apiswf. But it's not running.

After carefully reading the readme and the comments in the code that it directed me to, and what seemed to be the relevant parts of the Javascript, I still don't understand how to start the local server. Thank you.

Upvotes: 0

Views: 308

Answers (1)

Coleman
Coleman

Reputation: 565

I will answer my own question. I asked about this in the issue I linked to in the question details, and the following has now been added to the project's readme:

You must run this example from a web server (local or otherwise). The Web Playback API does not support urls that begin with 'file://'.

So, it wasn't working for me because I was just opening the hello.html file from my file manager. I needed to be serving the file from a server. I set up a simple, local node.js server to serve the files, and it then worked.

Upvotes: 2

Related Questions