Ad-Server Integration
The glomex Video Player can be seamlessly integrated through your ad-server using script.js
. This approach allows you to deliver video content through your existing ad infrastructure.
For proper integration, the script must be placed in a friendly iframe. If you’re using Google Ad Manager, ensure that Serve in SafeFrame  is set to Off.
Basic Integration
For a standard integration, use the following creative code. Replace REPLACE_WITH_INTEGRATION_ID
with your glomex integration ID:
<script src="https://player.glomex.com/integration/1/script.js?integrationId=REPLACE_WITH_INTEGRATION_ID"></script>
Integration with Passback
For scenarios where you need a fallback option when no ad is available, extend the basic integration with a passback function:
<script>
window.glomexPassback = function() {
console.log('Passback received');
// Your fallback logic goes here when no ad is available
};
</script>
<script src="https://player.glomex.com/integration/1/script.js?integrationId=REPLACE_WITH_INTEGRATION_ID&onPassback=glomexPassback"></script>
When an onPassback
function is defined, the player will only be displayed when an ad is available. If no ad is available, the player will be removed and your specified passback function will be called.
Advanced Event Handling
The glomex script integration supports several events that you can leverage for more sophisticated implementations:
<script>
/**
* Called when no ad is available
* Must be specified via the "onPassback" parameter
*/
window.glomexPassback = function() {
console.log('Passback received');
// Handle the passback scenario when no ad is available
};
/**
* Called when the integration is ready with content
* Must be specified via the "onReady" parameter
*/
window.glomexReady = function() {
console.log('Ready received');
// Player is ready with content
};
/**
* Called when the integration has loaded
* Must be specified via the "onLoad" parameter
* Provides the player instance as a parameter
*/
window.glomexLoad = function(instance) {
console.log('Integration loaded', instance);
// Integration has been loaded and rendered
};
/**
* Called when content playback is complete
* Must be specified via the "onComplete" parameter
*/
window.glomexComplete = function() {
console.log('Content complete');
// Video has finished playing
};
</script>
<script src="https://player.glomex.com/integration/1/script.js?integrationId=REPLACE_WITH_INTEGRATION_ID&onPassback=glomexPassback&onReady=glomexReady&onLoad=glomexLoad&onComplete=glomexComplete"></script>
Event Reference
Event | Parameter | Description |
---|---|---|
onPassback | None | Triggered when no ad is available |
onReady | None | Triggered when the integration is ready with content |
onLoad | instance | Triggered when the integration has loaded and rendered |
onComplete | None | Triggered when content playback is complete |
Related Resources
- Embed Code Documentation - Learn more about the standard embed code
- Embed Code Generator - Generate embed codes for your integration