Alert when the videos start playing VideoJS

I have a VueJS application and am playing a video using a VideoJS player. I need to track and fire an alert when the player starts playing the video. I need help figuring out a way to do this. I am initializing my video player using this code.
this.player = videojs(this.$refs.videoPlayer, this.options, () => {
this.player.log(‘onPlayerReady’, this);

You can use the alert keyword to display the warning message.

For example,

Initialise VideoJS and Add Event Listener

In your JavaScript code, add an event listener to the play event and initialize VideoJS. You can carry out the desired action, such as displaying an alert when the play event is fired.

// Initialize VideoJS
var video = videojs('my-video');

// Attach event listener to the "play" event
video.on('play', function() {
  alert('Video is now playing!');

The unidentified method inside the video. on(‘play’,…) will be performed in the code above when the play event is triggered, displaying an alert with the message Video is now playing!.

Hey VideoJS objects allow you to listen to numerous events fired during a video playback’s lifecycle. You can find a complete list of events at the following link. You must scroll down to the Events Section to get the list.

Can you give me an example of code snippet?

Yes, you can use the following code snippet to listen and fire an alert when the video starts playing

this.player.on('play', () => {
alert("Video is playing");