Class YtMooPlayer
Version
1.0.
The mootools class for easy access the features of the chromeless youtube players.
Defined in: <YtMooPlayer.js>.
| Constructor Attributes | Constructor Name and Description |
|---|---|
| Field Attributes | Field Name and Description |
|---|---|
|
If the video should autostart.
|
|
|
Height of the player in pixels.
|
|
|
The amount of time
(in ms) to check for loading state.
|
|
|
Which video to load
initial (can be boolean false if no video).
|
|
|
Width of the player in pixels.
|
| Method Attributes | Method Name and Description |
|---|---|
|
cue(startSeconds)
Cue a video.
|
|
|
Determines the amount of bytes, which are already loaded.
|
|
|
Determines the videos amount of total bytes.
|
|
|
Get the percent of time passed, for the video playback.
|
|
|
Get the seconds of video playback passed.
|
|
|
Get the duration of the video in seconds.
|
|
|
Determine how much percent of the video are already loaded.
|
|
|
getState()
Get the current state of the player as text.
|
|
|
Get the current state of the player as number.
|
|
|
Retrieves the embed code for the current video or false.
|
|
|
initialize(target, options)
Initialize the YtMooPlayer.
|
|
|
loadVideo(videoId, startSeconds)
Load a video
|
|
|
pause()
Pause the video.
|
|
|
play(startSeconds)
Play the current video.
|
|
|
playVideo(videoId, startSeconds)
Play a specific video.
|
|
|
stop()
Stop the video.
|
| Event Attributes | Event Name and Description |
|---|---|
|
The video is completly buffered.
|
|
|
The video is buffering.
|
|
|
onCueing()
The video is currently cueing.
|
|
|
onEnded()
The video has been stopped by the user or ended.
|
|
|
The video is currently loaded.
|
|
|
onPaused()
The video has been paused.
|
|
|
onPlay()
The video starts to play.
|
|
|
onReady()
The player is ready for loading/playing videos now.
|
|
|
onStateChange(stateId, previousStateId)
The players state has changed.
|
|
|
The player has been intialized.
|
Class Detail
YtMooPlayer()
Author: DracoBlue JanS@DracoBlue.de.
var myplayer = new YtMooPlayer('player_div', // use #player_div as container
{
'videoId' : 'AJSWEHNCBDE' // load YT-Video with that id
}
);
myplayer.play(); // start the video
Field Detail
{Boolean}
options.autoStart
If the video should autostart.
Needs videoId-option set in this case.
- Default Value:
- false
{Number}
options.height
Height of the player in pixels.
- Default Value:
- 385
{Number}
options.loading_check_interval
The amount of time
(in ms) to check for loading state.
- Default Value:
- 1000
{String|Boolean}
options.videoId
Which video to load
initial (can be boolean false if no video).
- Default Value:
- false
{Number}
options.width
Width of the player in pixels.
- Default Value:
- 640
Method Detail
cue(startSeconds)
Cue a video. Takes an optional parameter to determine the second to start
from.
- Parameters:
- {Number} startSeconds
- seconds of the video to start at
- Since:
- 1.0
{Number}
getBytesLoaded()
Determines the amount of bytes, which are already loaded.
- Since:
- 1.0
- Returns:
- {Number} Amount of bytes
{Number}
getBytesTotal()
Determines the videos amount of total bytes.
- Since:
- 1.0
- Returns:
- {Number} Amount of bytes
{Number}
getCurrentPercent()
Get the percent of time passed, for the video playback.
- Since:
- 1.0
- Returns:
- {Number} The percent of time passed (between 0 and 100)
{Number}
getCurrentTime()
Get the seconds of video playback passed.
- Since:
- 1.0
- Returns:
- {Number} The time in seconds
{Number}
getDuration()
Get the duration of the video in seconds.
- Since:
- 1.0
- Returns:
- {Number} The total duration in seconds
{Number}
getPercentLoaded()
Determine how much percent of the video are already loaded.
- Since:
- 1.0
- Returns:
- {Number} How much is already loaded in percent (number between 0 and 100)
{String}
getState()
Get the current state of the player as text.
- Since:
- 1.0
- Returns:
- {String} The current state as string
{Number}
getStateId()
Get the current state of the player as number.
- Since:
- 1.0
- Returns:
- {Number} The current state as id
{String}
getVideoEmbedCode()
Retrieves the embed code for the current video or false.
- Since:
- 1.0
- Returns:
- {String} The embed code for this video
initialize(target, options)
Initialize the YtMooPlayer. This will also create an instance of the
flashplayer, which is needed to use the YtMooPlayer!
- Parameters:
- {String} target
- The identifier of the target object for the player.
- {Object} options
- The options for the player.
- Since:
- 1.0
loadVideo(videoId, startSeconds)
Load a video
- Parameters:
- {String} videoId
- The id of the video
- {Number} startSeconds
- seconds of the video to start at
- Since:
- 1.0
pause()
Pause the video.
- Since:
- 1.0
play(startSeconds)
Play the current video. Takes an optional parameter to determine the
second to start from.
- Parameters:
- {Number} startSeconds
- seconds of the video to start at
- Since:
- 1.0
playVideo(videoId, startSeconds)
Play a specific video. Takes an optional parameter to determine the
second to start from.
- Parameters:
- videoId
- startSeconds
- Since:
- 1.0
stop()
Stop the video.
- Since:
- 1.0
Event Detail
onBuffered()
The video is completly buffered.
- Since:
- 1.0
onBuffering()
The video is buffering. As soon as enough is buffered the Event
onPlay will be triggered and the video starts to play.
- Since:
- 1.0
onCueing()
The video is currently cueing. This happens usually after the Event
onLoading. As soon as this Event is triggered one may launch the
video with the play Method.
- Since:
- 1.0
onEnded()
The video has been stopped by the user or ended.
- Since:
- 1.0
onLoading()
The video is currently loaded. Loading means, that the video is about to be
accessible by the player (e.g. reading duration is possible).
- Since:
- 1.0
onPaused()
The video has been paused.
- Since:
- 1.0
onPlay()
The video starts to play.
- Since:
- 1.0
onReady()
The player is ready for loading/playing videos now.
- Since:
- 1.0
onStateChange(stateId, previousStateId)
The players state has changed.
- Parameters:
- {Number} stateId
- The new state
- {Number} previousStateId
- The previous state
- Since:
- 1.0
onUnstarted()
The player has been intialized. Occurs right after the Event onReady.
- Since:
- 1.0