How to handle bitmovin's start and pause event in javascript

I want to log some data on player’s loading,start or stop event.
I am using some example code but that is not working it saying that this function is not found. need some urgent help on this.
this is my code.
export function load(key, url, token, licenseserver, playerid) {
var conf = {
key: key
};

url = url.toLowerCase();
url = "https:" + url;
token = token.replace("Bearer=","")
var source = {
    title: 'Spherex',
    dash: url + '?token=' + token,
    drm: {
        clearkey: {
            LA_URL: licenseserver + "getkey?token=" + token,
            headers: {
                'content-type': 'application/json'
            }
        }
    }
};


var player = new bitmovin.player.Player(document.getElementById(playerid), conf);
player.load(source);

player.onPaused(source).then(function (value) {
    alert("hello world stop");
});

}

Hi @rajeshrai0512,

Thank you for reaching out to us.

Here is the code to listen for the pause event.

player.on('paused', function () {
    alert("hello world stop");
});

You can find all the available player events here - PlayerEvent | Bitmovin Player API 8.161.0

Thankyou very much @Kishore its working perfectly.
one more thing how can i play the video for specific time for example i hava video of 1 minute. on button click or any event it will play for 10 seconds means it should be configurble. like player…play(starting time,end time)
player.play(10,20);

one more point i want to add here that how can we rewind and forward in bitmovin player by using javascript

Hi @rajeshrai0512,

That feature is not available out of the box, you have to either run your own timer in the app and stop the playback, or listen for the timechanged player event and stop the playback based on the current time.

This topic was automatically closed 60 minutes after the last reply. New replies are no longer allowed.