Chrome Extension

Videojs check if video is playing

var videoObj = videojs("video_id");

if (!videoObj.paused()) {
    console.log("Video is playing");
} else {
    console.log("Video is paused");

//USING .paused() function of videojs

Do you know, you can create and search your own code snippets on Devsheet. Store your code on cloud using devsheet and search using its chrome extension. Is it look cool?

To check whether a video is playing or not you can use .paused() method if you are using Videojs library in your project. The method will return false if the video is in play mode and return true if it is paused.

As in the above code snippet, we have wrapped the function inside the if-else condition and we are logging if the video is playing or not. You can write your code inside those conditions if you have any requirements.

Also, we have initialized Videojs object in our videoObj variable that will contain all the properties and methods related to Videojs player.

Search Index Data (The code snippet can also be found with below search text)

Check whether the video is in play mode using Videojs
Was this helpful?
Never leave your website again in search of code snippets by installing our chrome extension.