libcast / html5player-client
Libcast HTML5 Player JavaScript Client
README
Installation and use
The script build/libcast_player_client.min.js
must be included either inside the <head>
document part,
or at the end of the HTML page, just before the closing </body>
tag.
Then you must instanciate one LibcastPlayer
object per embed:
var player = new LibcastPlayer('player_id');
See tests/single_embed.html
for a complete example of how to use this client.
After client instantiation, Libcast embeds should behave like the standard HTML5 MediaElement API (see https://developer.mozilla.org/en/docs/Web/API/HTMLMediaElement).
Available player methods
The following list of methods is available from embed <iframe>
elements
once the Libcast client has been instantiated.
play()
pause()
toggle()
[*]seek(seconds)
[*] whereseconds
must be an integer or a floatchapter(number)
[*] wherenumber
must be an integermute()
[*]setVolume(level)
[**] wherelevel
must be a float between 0 and 1 (percentage)
(* non HTML5 MediaElement API standard)
(** a bit different from the HTML5 MediaElement API standard because of JavaScript limitations)
Available player attributes
The following list of attributes is available from embed <iframe>
elements
once the Libcast client has been instantiated.
volume
duration
currentTime
Available player events
The following list of events is emitted by embed <iframe>
elements once the
Libcast client has been instantiated.
loadedmetadata
loadeddata
canplay
play
playing
pause
timeupdate
volumechange
ended
Compile source
Install npm (Node) on your machine
Install grunt
npm install -g grunt-cli
Install npm dependencies
npm install
Build source
grunt
This should compile source under the /build
directory.