Fb:mp3

From Facebook Developers Wiki

Jump to: navigation, search

Contents

[edit] Description

Renders a flash-based audio player.


[edit] Attributes

RequiredNameTypeDescription
required src string The URL of the audio file. The URL must be absolute.
optional title string The name of the song.
artist string The name of the artist performing the song.
album string The title of the album.
width int The width of the player in pixels. (default value is 300)
height int Does nothing. (default value is 29)


[edit] Examples

<fb:mp3 src="http://host.com/file.mp3" title="Song Name" artist="Song Artist" />
fbmp3tl5.png


[edit] Notes

  • The src attribute must point directly to the mp3 file,[possible bug?][who says?] and cannot be played by a query string (for example, "songs.php?songid=35911").
  • Supported formats include .mp3.
  • .wav files are not supported[possible bug?].
  • File's bitrate must me in increments of 11KHz (11KHz, 22KHz, 44.1 KHz all work).
  • File must end in .mp3 (for example, /location/1385097 will not work).
  • Song name, artist, and album must be in ASCII characters or does not display correctly. i.e. Song names in Chinese do not display in Chinese but in gibberish or not at all[possible bug?].
  • Even though the artist attribute is optional, providing an empty string value (ie: artist="") will result in "Unknown Artist" being displayed, rather than nothing as specified[possible bug?].
  • The height attribute doesn't actually do anything[possible bug?].
  • If there are multiple fb:mp3 controls on the same page, it is possible for the user to play all of them simultaneouly[possible bug?]


[edit] Requested Enhancements

  • Prevent the simultaneous playback of multiple fb:mp3 controls on the same page by stopping any currently playing fb:mp3 if another one is played.
  • Enable the "height" attribute
  • Implement volume control
  • Add XSPF support
  • Make artist attribute truly optional. IE: When it is not specified, no artist is displayed and it does not scroll away from the song title


[edit] See Also