Last updated

Event Reference for Cincopa

Cincopa provides various events that enable developers to customize the player experience and respond to user interactions or system states. Below is a comprehensive list of events categorized for clarity.


Player and Video Playback Events

EventDescription
video.playTriggered when the video begins playing.
video.pauseFired when the video is paused.
video.seekedFired when the user seeks to a new position.
video.timeupdateTriggered periodically to provide playback progress updates.
video.changeFired when a new video is loaded or selected.
video.loadTriggered when a video is loaded into the player.
video.unloadFired when a video is unloaded.
video.endedTriggered when the video playback ends.
video.errorFired when an error occurs during video playback.
video.fullscreenenterTriggered when the player enters fullscreen.
video.fullscreenexitFired when the player exits fullscreen.
player.failedTriggered when the player fails to load or initialize.

Playlist and Chapter Events

EventDescription
playlist.nextTriggered when the next item in the playlist is selected.
playlist.prevTriggered when the previous item in the playlist is selected.
chapter.clickTriggered when a chapter is clicked by the user.
chapter.hideFired when a chapter is hidden.
chapter.showTriggered when a chapter is shown.
chapter.viewFired when a chapter is viewed.

API and Runtime Events

EventDescription
api.readyFired when the API is ready for interaction.
runtime.on-argsTriggered during runtime argument handling.
runtime.after-on-argsFired after on-args events are executed.
runtime.on-html-loadedFired when HTML is loaded during runtime.
runtime.on-load-htmlTriggered when HTML is loaded.
runtime.on-media-jsonFired when media JSON is loaded.
runtime.on-password-shownTriggered when a password-protected video password is shown.
runtime.on-thumbnail-shownFired when a thumbnail is displayed.

Interaction and UI Events

EventDescription
share.hideTriggered when the share menu is hidden.
share.showFired when the share menu is displayed.
overlay.hideTriggered when an overlay is hidden.
overlay.showTriggered when an overlay is displayed.
annotation.hideTriggered when an annotation is hidden.
annotation.showTriggered when an annotation is shown.
annotation.skipFired when an annotation is skipped.
cta.hideTriggered when a CTA is hidden.
cta.showTriggered when a CTA is displayed.
cta.skipFired when a CTA is skipped by the user.

Miscellaneous Events

EventDescription
chromecast.detectedFired when a Chromecast device is detected.
chromecast.errorTriggered when an error occurs with Chromecast.
chromecast.startTriggered when casting to Chromecast starts.
chromecast.stopFired when casting to Chromecast stops.
emailgate.showTriggered when an email gate is shown.
emailgate.skipFired when an email gate is skipped by the user.
emailgate.submitTriggered when an email gate is submitted.
item.downloadFired when an item is downloaded.
live.m3u8parsedTriggered when an M3U8 file for live streaming is parsed.
live.tokenFired when a live token is obtained.
live.watching-countTriggered to update the live stream viewer count.
context_menu.initTriggered when the context menu is initialized.

Notes

  1. Event Customization: These events allow developers to respond to specific actions or states within the player, enabling deep customization.
  2. Example Usage:
    cincopa.registeredFunctions = cincopa.registeredFunctions || [];
    cincopa.registeredFunctions.push({
        func: function (eventName, data, gallery) {
            console.log("Event triggered:", eventName);
            console.log("Event data:", data);
        },
        filter: "video.play,video.pause"
    });
  3. Another way of attaching and listening to events:
    cincopa.registerEvent(FUNCTION_NAME, EVENT_NAME, PRIORITY);
    cincopa.registerEvent("videoEventsHandler", "video.*", 0);
    function videoEventsHandler(eventName, data, gallery){
        console.log("Event triggered:", eventName);
        console.log("Event data:", data);
    }