Security News
Input Validation Vulnerabilities Dominate MITRE's 2024 CWE Top 25 List
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
@glomex/content-sdk-js
Advanced tools
SDK that offers easy access for developers to video sources and glomex tracking events
An SDK that offers easy access for developers to video sources and to transfer tracking events to glomex.
To run the example project, clone the repo, and run npm install
from the root directory first.
Using npm:
npm install @glomex/content-sdk-js
In a browser:
<script src="//player.glomex.com/content-sdk/1/glomex.content-sdk.js"></script>
Note:
This SDK module uses ES6 syntax and requires the consumer
to use babel compiler and to provide a proper Promise polyfill.
const glomexContentSdk = require('@glomex/content-sdk-js');
// Fill your config here
const config = {
integrationId: '[INTEGRATION_ID]',
contentId: '[CONTENT_ID]'
};
// glomexContentSdk is asynchronous
// so there is no need to wait for loading in your code
const sdk = glomexContentSdk(config);
const videoSourcesLoaded = sdk.getSources();
// ... other preparations ...
videoSourcesLoaded.then(function(sources) {
const videoPlayer = createOwnVideoPlayer(sources);
// tracking is asyncronous too, so you don't wait here
sdk.trackContentBegin();
// before your video begin
videoPlayer.addEventListener('loadeddata', function() {
// asynchronous operation
sdk.trackAdBegin('preroll');
});
// after your video ended
videoPlayer.addEventListener('ended', function() {
// asynchronous operation
sdk.trackAdBegin('postroll');
});
// play your video
videoPlayer.play();
}, function(error) { // rare you can get an error 'no video'
console.log(error);
});
In case you don't have any video player on the page, use our script
for creating HTML5 video player and getting this example working.
Otherwise the createOwnVideoPlayer
function should return a video player object.
<script src="//player.glomex.com/content-sdk/1/create-video-player.js"></script>
To learn more about content-sdk visit our Content SDK Integration Guide
Made with ♥ by glomex
FAQs
SDK that offers easy access for developers to video sources and glomex tracking events
The npm package @glomex/content-sdk-js receives a total of 1 weekly downloads. As such, @glomex/content-sdk-js popularity was classified as not popular.
We found that @glomex/content-sdk-js demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 18 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.