How to Add Pre-Roll and Post-Roll Videos to Your Gallery
Cincopa provides a way to add pre-roll and post-roll videos to enhance your gallery experience. You can dynamically configure these roll videos using Cincopa events before the gallery is loaded and customize their behavior as needed.
For more details, refer to the Cincopa Events Documentation and the Cincopa Embed Documentation.
Pre-Roll and Post-Roll Configuration Options
You can control pre-roll and post-roll video behavior using the following arguments:
Argument | Type | Description |
---|---|---|
prerollAssetID | String | The asset ID for the pre-roll video. |
postrollAssetID | String | The asset ID for the post-roll video. |
prepostroll | Boolean | Set to true to enable pre-roll and post-roll videos. |
rollFrequency | String | Defines when to play the roll video. Options: on_each , on_first , on_first_last . |
Relevant Events
runtime.on-args
: Used to configure the pre-roll and post-roll videos.
Example Usage
Below is an example demonstrating how to enable and configure pre-roll and post-roll videos for your gallery:
<script type="text/javascript">
var cincopa = cincopa || {};
cincopa.registeredFunctions = cincopa.registeredFunctions || [];
cincopa.registeredFunctions.push({
func: function (name, data, gallery) {
// Enable pre-roll and post-roll videos
gallery.args.prerollAssetID = "AQJDeYiYFKhg"; // Pre-roll video asset ID
gallery.args.postrollAssetID = "AQJDeYiYFKhg"; // Post-roll video asset ID
gallery.args.prepostroll = true; // Turn on Pre/Post Roll Video option
gallery.args.rollFrequency = "on_each"; // Roll frequency options: on_each, on_first, on_first_last
},
filter: "runtime.on-args"
});
</script>