Jump to content

HTML/coding help


Steve

Recommended Posts

I am trying to add support for auto-embedding of Official.fm players on DV, but I can't get it to work. Maybe someone here can spot where I'm going wrong.

 

Here's an example link: -

http://official.fm/tracks/prVO

And here is the embed code: -

<iframe width="350" height="550" frameborder="no" src="http://official.fm/player?width=350&height=550&skin_bg=000000&skin_fg=FFFFFF&artwork=1&tracklist=1&feed=http://official.fm/feed/tracks/prVO.json"></iframe>

Using the above HTML works fine, so I know it definitely works. It's my code that is wrong somewhere.

Here is what I've tried for the media tag: -

Media replacement match: -

http://official.fm/tracks/{1}

Media replacement HTML: -

<iframe width="350" height="550" frameborder="no" src="http://official.fm/player?width=350&height=550&skin_bg=000000&skin_fg=FFFFFF&artwork=1&tracklist=1&feed=http://official.fm/feed/tracks/{1}.json"></iframe>

This automatically embeds a player, but with a blank playlist. Where have I gone wrong?

Clearly, it's the 4 character code at the end of the link that identifies the particular mix/track/song. In the media replacement match, I have used the variable {1} to replace that 4 character code. Then in the media replacement HTML, I have also replaced the 4 character code with {1}. The way it's supposed to work is that when you post a link, it would take the 4 character code off the end of it and insert it into the HTML in place of {1}, which should work fine, except it doesn't and I don't know why.

Link to comment
Share on other sites

Just in case anyone else here uses Invision Power Board, or winds up here from a Google search, the mistake I made was this - In the media replacement match, you use {1}, {2} etc. for variables, but in the media replacement HTML you have to use $1, $2 etc. which is where I went wrong.

 

The correct code for the HTML is therefore: -

 

 

<iframe width="350" height="550" frameborder="no" src="http://official.fm/player?width=350&height=550&skin_bg=000000&skin_fg=FFFFFF&artwork=1&tracklist=1&feed=http://official.fm/feed/tracks/$1.json"></iframe>
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...