To handle errors in Videojs player, you can use the following code:
const errorCodes = ["MEDIA_ERR_CUSTOM", "MEDIA_ERR_ABORTED", "MEDIA_ERR_NETWORK", "MEDIA_ERR_DECODE", "MEDIA_ERR_SRC_NOT_SUPPORTED", "MEDIA_ERR_ENCRYPTED"];
playerInstance.on("error", function() {
sendEvent("playerError", errorCodes[playerInstance.error().code]);
});
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Paused after 2 secs of ad start | |
Resumed after 1 min | |
Ad break fucked up | |
---------------------------------- | |
If the ad break comes in first 10 secs |
if(tap === true)
if(autoplay === true)
if(mute === true)
Video will play with taptounmute, with autoplay and with mute
if(tap === true)
if(autoplay === true)
if(mute === false)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In the server go to the wordpress path.. in most systems it is | |
/var/www/wordpress/wp-includes/embed.php | |
In the above file add this | |
wp_embed_register_handler( 'vidgyor', '#https://static\.vidgyor\.com/player/vod/html/(.+?)\.html\?videoId=(.+?)&cmsAccountId=(.+?)&masterProfileId=(.+?)($|&)#i', 'wp_embed_handler_vidgyor' ); | |
function wp_embed_handler_vidgyor( $matches, $attr, $url, $rawattr ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This is for getting data from aws s3 bucket UI. | |
document.querySelector("something").children.forEach(child => console.log(child.children[1].textContent)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const crypto = require("crypto") | |
// The `generateKeyPairSync` method accepts two arguments: | |
// 1. The type ok keys we want, which in this case is "rsa" | |
// 2. An object with the properties of the key | |
const { publicKey, privateKey } = crypto.generateKeyPairSync("rsa", { | |
// The standard secure default length for RSA keys is 2048 bits | |
modulusLength: 2048, | |
}) |
To integrate the midroll plugin to your existing videojs player follow the below steps.
<link rel="stylesheet" href="https://vgrplayer.s3.ap-south-1.amazonaws.com/midroll-test-player/vidgyor-vjs_v3.css">
<script src="https://vgrplayer.s3.ap-south-1.amazonaws.com/midroll-player/ads.min.js"></script>