Tempo (AS3) – Small Efficient Media Player
Version 2.0.1, Updated October 06, 2008
- Compatibility: Flash Player 9 and later (ActionScript 3.0)
- File Size: About 25Kb
- Change Log
Download Now (2.0.1)
What's New
- Now extends TempoLite - Previously Tempo and TempoLite shared the same core classes but not through extending. With the overhaul, Tempo now extends directly from TempoLite, simplifying integration.
- Removed PureMVC and restructured - I was searching for a way to get TempoLite even smaller than it already was. In the end, I nixed PureMVC and realized I didn’t miss it (at least for this project). With TempoLite losing PureMVC, I had to take that change to Tempo. With that and a LOT of restructuring I managed to cut file size by about 7Kb!
- Dropped compiled size by 7Kb (32Kb -> 25Kb)
- Fixed video scaling issue on initial play - This was an issue I noticed after converting to TempoLite 2.0.0, where the video would play unscaled, then repeat scaled.
Description
Tempo is an online Flash-based music player, built to allow for a fully customizable interface. It is even capable of changing skins on the fly. Skinning is handled by making a simple SWF with movieclips with specific names. Tempo will look to see if the buttons exist, and if so, will assign actions to them. You can make a skin as simple as the Demo in minutes, or you can take the time to build one as unique as the Winamp skin. Tempo currently supports the following file types: flv, mp4, m4v, m4a, 3gp, mov, f4v, f4p, f4a, f4b, and mp3.Competitors
This is a list of other known Flash media players currently out. While some media players may seem fancy or elaborate, Tempo's goal is to be small, efficient and configurable. Below is a list of comparable players with similar capabilities and file sizes:- AFComponents Embeddable FLV Player : 120kb
- Wimpy RAVE 2.0.7 : 109kb (Not Free)
- Wimpy MP3 6.0.15 : 64kb (Not Free)
- YouTube Player : 76kb
- JW Media Player 4.1 : 40kb
- Flowplayer 2.2.4 : 120kb
- TSVideo 1.0 : 115kb (Not free)
- MC Classic Media Player : 120kb
- MC Altair 0.8 : 33kb (Single file, no playlist)
- Tempo : 25kb
You need to upgrade your Flash Player
This site requires atleast version 9. If you would like to continue anyways, please click here to bypass.
This site requires atleast version 9. If you would like to continue anyways, please click here to bypass.
Playlists: | Skins: | Refresh Video Playlist | Refresh Main Playlist
Usage
Item Object
An item object is used for handling a single item. You pass an item object to add audio or video to the play list. When you try to retrieve audio or video from the play list, it is returned as an item object. Below is the format of an item object :{title: "My Song", length: "100", url: "mySong.mp3", extOverride: "m4a"}If no title is passed, it will be set to "". If no length is passed, it will be set to -1. If extOverride isn't passed, Tempo will get that last three letters of the file name to guess the file format.
Support Video Formats
Below is a list of the supported video formats. This is basically a run down of the videos Flash can play.- flv
- mp4
- m4v
- 3gp
- mov
- f4v
- f4p
- f4b
Support Audio Formats
Below is a list of the supported audio formats, this is basically a run down of the sounds Flash can play.- m4a
- f4a
- mp3
Support Playlist Formats
You can pass the following playlist file types to Tempo. For each file type (if XML based) is a list of the corresponding tags as they relate to the Item Object described above.- ASX
- <title> = Title
- <ref> or <base> = URL
- <duration> = Length
- Example
- XSPF
- <title> = Title
- <location> = URL
- <duration> = Length
- Example
- M3U
- PLS
- <title> = Title
- <media:group><media:content url=”value”> = URL
- <duration>= Length
- Spec
Javascript API
Methods
play()
- Plays selected item in the playlist
playpause()
- Toggles between play and pause
pause()
- Pauses selected item in the playlist
stop()
- Stops the selected item in the playlist
next()
- Plays the next item in the playlist
prev()
- Plays the previous item in the playlist
playItem(index:Number)
- Plays specified item in the playlist
loadFile(item:Object, autoStart:Boolean = true)
- Creates a playlist of a single item and load the item
loadSkin(url:String = "DefaultSkin.swf")
- Loads a new skin
loadPlayList(url:String = "playlists/Tempo.m3u")
- Loads a new playlist
addItem(item:Object, index:Number = undefined)
- Adds an item to the playlist at the end, or at index specified
removetem(index:Number = undefined)
- Removes an item from the playlist from the end, or at index specified
clearItems()
- Clears the playlist
mute(b:Boolean)
- Turns audio off or on
Properties
setId : Number
getId : Number
- A unique id for this specific player. Useful where more than one player is on the page (default "1")
setRepeat : Boolean
getRepeat : Boolean
- Whether to loop the playlist (false) or a single item (true) (default false)
setShuffle : Boolean
getShuffle : Boolean
- Whether to shuffle the playlist or not (default false)
setVolume : Number
getVolume : Number
- A number from 0 to 1 determines volume (default 0.5)
setSeekPercent : Number
getSeekPercent : Number
- Current play percentage through item
getItemData : Object
- Returns current playlist item object
getItemIndex : Number
- Returns current playlist item index
getLength : Number
- Returns number of items in playlist
getLoadPercent : Number
- Returns the load percentage
getTimeElapsed : Number
- Returns current play time, in 00:00 format
getTimeRemaining : Number
- Returns current remaining play time, in 00:00 format
getObjectID : String
- Returns unique SWF object ID in the html
Events
onPlay
- Dispatched when item begins playing
onMetaData : Object
- Dispatched when metadata for current item is retrieved.
- Passes metadata as an object.
onPlayProgress : Object
- Dispatches when play progress is updated.
- [sourcecode language="as3"] {percent:currentPercent, elapsed:timeCurrent, remain:timeLeft, total:timeTotal}[/sourcecode]
- percent : Current play percentage through item
- elapsed : Current play time, in 00:00 format
- remain : Current remaining play time, in 00:00 format
- total : Total length of item, in 00:00 format
onPlayComplete : Void
- Dispatched when item has finished playing
onLoad : Object
- Dispatched when a new item has begun to load.
- [sourcecode language="as3"]{url:strURL, type:"audio", time:timeTotal}[/sourcecode]
- url : URL of item loading
- type : Either "audio" or "video"
- time : Elapsed play time
onLoadProgress
- Dispatches when load progress is updated.
- [sourcecode language="as3"]{loaded:bytesLoaded, total:bytesTotal}[/sourcecode]
- loaded : Current bytes loaded
- total : Bytes to load
onVolume : Number
- Dispatched when the volume has changed.
- Passes the new volume setting.
onShuffle : Boolean
- Dispatched when the shuffle setting has changed.
- Pass the new shuffle setting.
onRepeat : Boolean
- Dispatched when the repeat setting has changed.
- Pass the new repeat setting.
Flashvars API
autoStart : Boolean
- Determines if the player will immediately play the first item (default true)
autoStartIndex : Number
- The index of an item in the playlist to play if 'autoStart' is set to true (default 0)
bufferTime : Number
- Seconds to pre-buffer before playing an item (default 1)
fileURL : String
- The URL to an item to play, will create a playlist consisting on this single item
playerId : String
- A unique id for this specific player. Useful where more than one player is on the page (default "1")
playlistURL : String
- The URL of the playlist to load (default "playlists/Tempo.m3u")
repeat : Boolean
- Whether to loop the playlist (false) or a single item (true) (default false)
shuffle : Boolean
- Whether to shuffle the playlist or not (default false)
skinURL : String
- The URL to the skin to load (default "DefaultSkin.swf")
volume : Number
- A number from 0 to 1 determines volume (default 0.5)
Change Log
Tempo 2.0.1 for AS3 (October 06, 2008)
- Now extends TempoLite
- Removed PureMVC and restructured
- Dropped compiled size by 7Kb (32Kb -> 25Kb)
- Fixed video scaling issue on initial play
Tempo 1.1 for AS3 (September 19, 2008)
- Added file extension override
- Fixed pause bug
- Updated to PureMVC AS3 Multicore 1.0.5
Tempo 1.0.3 for AS3 (June 26, 2008)
- Forgot to add PlayListProxy as a listener for metadata
- Playlist will automatically update with metadata as it's received
Tempo 1.0.2 for AS3 (unreleased)
- Fixed int comparison bug in removeItem, addItem, and play. Introduced in 1.0.1
Tempo 1.0.1 for AS3 (unreleased)
- Fixed issue of adding / removing item from playlist at index '0'
Tempo 1.0.0 for AS3 (unreleased)
- Changed how the repeat property is handled. Instead of a boolean, it now passes a string. Accepted values are REPEAT_TRACK, REPEAT_ALL, and REPEAT_NONE.
Tempo 0.9.5 for AS3 (May 14, 2008)
- Updates for TempoLite
Tempo 0.9.4 for AS3 (unreleased)
- Updates for TempoLite
Tempo 0.9.3 for AS3 (unreleased)
- Updates for TempoLite
Tempo 0.9.2 for AS3
- Added loadSkin and loadPlayList methods to JavaScript API. Can't believe I forgot these.
Tempo 0.9.1 for AS3
- Switched to PureMVC multicore and tweaked api.
Tempo 0.9.0 for AS3 (unreleased)
- Enhanced shuffle, now allows for next and previous shuffled songs.
- Improved Winamp skin.
- Dropped file size from 58kb to 31kb.
- Reorganized files again and optimized.
- Improved Javascript, and FlashVar support.
- Improved playlist updating.
Tempo 0.8.0 for AS3 (unreleased)
- Probably should've been a minor release.
- Built a demo ui to swap between playlists and skins.
- Only changes here involved stability between playlists and skin changing.
Tempo 0.7.1 for AS3 (unreleased)
- Fixed play list issue when an unplayable file is in the play list. Changed double click to single click for items in play lists.
Tempo 0.7 for AS3 (unreleased)
- Fixed playlist tracking issue.
- Cleaned up code and reorganized structure.
- Reduced file size slightly.
Tempo 0.6 for AS3 (unreleased)
- Added new skins (Zune, Winamp).
- Now handles video, and aac music (m4a and mp4).
- Also supports full screen video (only in Demo and Default skins).
Tempo 0.5 for AS3 (unreleased)
- Supports custom views / skins, Player and Playlists. Loads default playlist file only.