new UWA.Controls.AudioPlayer(options)
Display an Audio player, uses Adobe Flash if audio tag is not supported.
Example
var audioPlayer = new UWA.Controls.AudioPlayer();
audioPlayer.play('http://example.com/mysong.mp3');
Parameters
Name | Type | Description | |||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object | Options hash or a option/value pair. Properties
|
Extends
- UWA.Controls.Abstract
Index
Methods
Methods
-
getAdapter(file) → {UWA.Controls.AudioPlayer.Adapter}
-
Load Adapter.
Parameters
Name Type Description file
String Audio source url
Returns
- Type
- UWA.Controls.AudioPlayer.Adapter
-
buildSkeleton()
-
Create the player HTML skeleton.
-
attachEvents()
-
Attach DOM events to player skeleton.
-
reset()
-
Reset.
-
load(file, title)
-
Load an audio file.
TODO restore "title" argument
Parameters
Name Type Description file
String Audio source url
title
String Audio source title
-
play(file, title)
-
Play an audio file.
Parameters
Name Type Description file
String Audio source url
title
String Audio source title
-
pause()
-
Pause current song.
-
stop()
-
Stop current song.
-
close()
-
Stop and hide the player.
-
onPlayPause()
-
Toggle play/pause
-
onPlay()
-
HTML5 Media Event 'play'.
-
onPause()
-
HTML5 Media Event 'pause'.
-
onCanPlay()
-
HTML5 Media Event 'canplay'. This event is generated when enough data is available that the media can be played.
-
onMetadataLoaded()
-
HTML5 Media Event 'metadataloaded'.
-
onTimeUpdate()
-
HTML5 Media Event 'timeupdate'.
-
trackLoadProgress()
-
HTML5 'progress' event.