Class: UWA.Controls.AudioPlayer

UWA/Controls/AudioPlayer. UWA.Controls.AudioPlayer

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
Name Type Argument Default Description
url String <optional>
''

Url of the media to play

autoPlay String <optional>
false

Play automatically when media loaded

preload String <optional>
'none'

Audio tag preload attribute ('auto'|'metadata'|'none')

className String <optional>
''

CSS class name set to the container Element

closeButton String <optional>
true

display/hide close button

handleButton String <optional>
true

display/hide handle Button

Extends

  • UWA.Controls.Abstract

Index

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.