Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add missing docs #41

Merged
merged 3 commits into from Jan 20, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
36 changes: 36 additions & 0 deletions README.rst
Expand Up @@ -31,6 +31,10 @@ Player.js is hosted on Embedly's CDN.

<script type="text/javascript" src="//cdn.embed.ly/player-0.0.12.min.js"></script>

install via npm
::

npm install player.js

Ready
-----
Expand Down Expand Up @@ -249,7 +253,39 @@ will allow you to easily listen to events and takes care of the house keeping.
receiver.on('getDuration', function(callback){
callback(video.duration);
});

receiver.on('getVolume', function(callback){
callback(video.volume*100);
});

receiver.on('setVolume', function(value){
video.volume = (value/100);
});

receiver.on('mute', function(){
video.mute = true;
});

receiver.on('unmute', function(){
video.mute = false;
});

receiver.on('getMuted', function(callback){
callback(video.mute);
});

receiver.on('getLoop', function(callback){
callback(video.loop);
});

receiver.on('setLoop', function(value){
video.loop = value;
});

video.addEventListener('ended', function(){
receiver.emit('ended');
});

video.addEventListener('timeupdate', function(){
receiver.emit('timeupdate', {
seconds: video.currentTime,
Expand Down