###Contents
Player.state
Player.videoInfo.duration
Player.videoInfo.currentTime
Player.videoInfo.width
Player.videoInfo.height
Player.usePlayerObject
Player.play(options)
Player.stop([silent])
Player.pause()
Player.resume()
Player.togglePause()
Player.formatTime(seconds)
Player.seek(seconds)
Player.audio.get()
Player.audio.set(index)
Player.audio.cur()
##Public events
###ready
'ready' is sent when player has recieved a steam info (duration, resolution, etc) and playing starts.
Player.on('ready', function(){
$('#duration').html(Player.formatTime(Player.videoInfo.duration));
});
###bufferingBegin, bufferingEnd
Events are sent when a video buffering starts and ends, weak Internet connection or after rewinding.
var $loadingIndicator=$('#loading_indicator');
Player.on('bufferingBegin', function(){
$loadingIndicator.show();
});
Player.on('bufferingEnd', function(){
$loadingIndicator.hide();
});
###stop
Sends when the playback has been stopped.
Player.on('stop', function(){
$videoScene.hide();
});
###complete
is sent when the end of video file is reached and playing is stopped.
Player.on('complete', function(){
playNextVideo();
});
##Public properties
###Player.state
String: Current player condition:
play
: video is playingpause
: video is pausedstop
: video is stopped
###Player.videoInfo.duration
Number: video file duration in seconds
###Player.videoInfo.currentTime
Number: current playing time in seconds
###Player.videoInfo.width
Number: video stream width in pixels
###Player.videoInfo.height
Number: video stream height in pixels
###Player.usePlayerObject
Boolean: defines: will or won't the or sef plugin be used.
Available only for the next platform: Samsung
###Player.play(options)
The video starts playing.
options
Plain object: hash containing parametrs for the starting
Or
url
String: the path to a video
Player.play({
url: "movie.mp4"
});
Player.play("movie.mp4");
//Both variants are the same
Player.play({
url: "movie.mp4"
from: 20
});// starts video from the 20 sec point
###Player.stop([silent])
Stops video playing.
silent[optional]
Boolean: if flagsilent
is sent, then the eventstop
isn't called
Player.stop();
App.onDestroy(function(){
Player.stop(true);
}); // Stops playing and allows to avoid side effects
###Player.pause()
Pauses video playing.
Player.pause();
###Player.resume()
Resumes video playing after pause.
Player.resume();
###Player.togglePause()
Switches pause/resume according to the current condition.
Player.togglePause();
###Player.formatTime(seconds)
Converts time in seconds in the srting with a type H:MM:SS
seconds
Number: the time in seconds
String: result string
Player.formatTime(PLayer.videoInfo.duration); // => "1:30:27"
###Player.seek(seconds)
The transit on the set time in seconds.
seconds
Number: the time in seconds
Player.seek(20);//перейти на 20 секунду
Player.seek(Player.videoInfo.currentTime + 10);//прыжок на 10 секунд вперед
###Player.audio.get()
Returns an array with codes of sound tracks languages.
A list with all codes you can find here http://forum.doom9.org/showthread.php?t=155762
Available only for the next platform: Samsung
Array: the array with codes
var tracksArray=Player.audio.get();//=> [7501171, 6448492]
var currentLang=array[Player.audio.cur()];//=> 7501171
var currentLangString=Strings[currentLang];//=> "Russian"
###Player.audio.set(index)
Defines the sound track in copliance with the index.
Available only for the next platform: Samsung
index
Number: sound track index
Player.audio.set(0);
###Player.audio.cur()
Defines the sound track in copliance with the index.
Available only for the next platform: Samsung
Number: Index of the current sound track
Player.audio.cur(); //=> 1