Event Handling Summary

manuman94 edited this page May 7, 2014 · 4 revisions

Event Handling - Summary

ytCropper library has listeners to handle all kind of events (user interaction, retrieving data, etc.). List of all posible events:

  • Event onProgress(e, currentTime)
    It fires when the video is being played.

e -> Event object.
currentTime -> Current play time in seconds

Example:

$(cropper).on("onProgress",function(e, currentTime){
    // TODO
});


  • Event onFirstHandleChange(e, handleValue)
    It fires when the first handle is dragged or if it changes its value.

e -> Event object.
handleValue -> Handle value in seconds

Example:

$(cropper).on("onFirstHandleChange",function(e, handleValue){
    //TODO
});


  • Event onSecondHandleChange(e, handleValue)
    It fires when the second handle is dragged or if it changes its value.

e -> Event object.
handleValue -> Handle value in seconds

Example:

$(cropper).on("onSecondHandleChange",function(e, handleValue){
    //TODO
});


  • Event onVideoPlay(e, currentTime)
    It fires when the video start to play or when resuming.

currentTime -> Current play time in seconds
e -> Event object.

Example:

$(cropper).on("onVideoPlay",function(e, currentTime){
    //TODO
});


  • Event onVideoPause(e, currentTime)
    It fires when the video is paused. The video is paused by the user interaction.

currentTime -> Current play time in seconds
e -> Event object.

Example:

$(cropper).on("onVideoPause",function(e, currentTime){
    //TODO
});


  • Event onVideoStop(e,currentTime)
    It fires when the video is stopped. The video stops when it ends.

currentTime -> Current play time in seconds
e -> Event object.

Example:

$(cropper).on("onVideoStop",function(e, currentTime){
    //TODO
});


  • Event onInfoReady(e)
    It fires when the video information has been loaded. You can't get the video parameters (title, duration) until ytCropper doesn't get the YouTube API response.

e -> Event object.

Example:

$(cropper).on("onInfoReady",function(e){
    //TODO
});



More information about this plugin on this wiki.