Stay organized with collections
Save and categorize content based on your preferences.
The CAF DAI SDK integrates closely with the native CAF Ad Breaks functionality. As such, in most cases, you should use CAF Ad Break events to trigger logging or custom functionality. However, the CAF DAI SDK offers several additional events that are not available directly through CAF Ad Breaks, such as quartile tracking events.
Publishers who want full parity with platforms using the IMA DAI SDK may need to attach event listeners to the StreamManager to handle these additional events. If it is necessary to pass these events on to the attached sender apps, simply forward the event to the sender via castContext.sendCustomMessage().
Example:
...streamManager.addEventListener(ima.cast.dai.api.StreamEvent.Type.MIDPOINT,(event)=>{// add custom receiver handler code here, if necessaryconsole.log(event);// broadcast event to all attached senders, so they can// run custom handler code, if necessaryconstCUSTOM_CHANNEL='urn:x-cast:com.example.cast.mynamespace';castContext.sendCustomMessage(CUSTOM_CHANNEL,null,event);});castContext.start();...
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2023-11-14 UTC."],[[["The CAF DAI SDK leverages CAF Ad Break events for logging and custom functionality, recommending their use over separate implementations."],["For advanced use cases like quartile tracking, the CAF DAI SDK provides additional StreamEvents beyond standard CAF Ad Break events."],["To ensure sender application compatibility, publishers can utilize `castContext.sendCustomMessage()` to relay custom CAF DAI events to sender applications."]]],[]]