Skip to main content

Callback events

callbackevents​

callbackevents is an object that contains three functions onPlay, onPause, onFinish. Clients can used these callback functions for callback alert whenever certain events take place on our SDK-

  • OnPlay - called whenever play is clicked,
  • OnPause - called whenever pause is clicked,
  • OnFinish - called when the video is fully watched,

Sample Usage:

function onPlay(time) {  
console.log("Video Played at:", time);
};

function onPause(time) {
console.log("Video Paused at:", time);
};

function onFinish(time) {
console.log("Video Stopped at:", time);
};

onSubmitPass​

onSubmitPass is an object that contains the callback function for evaluating videoIdUrl and password. videoIdUrl contains the videoId if passed in the masterConfig, or videoUrl otherwise. If onSubmitPass is not passed in customConfig, the password feature is turned off.

Sample Usage:

const onSubmitPass = (data) => {
return new Promise((resolve, reject) => {

// logic for evaluating data.videoIdUrl and data.

if(correct) resolve({'success':true});
else reject()
})
}