高度な IMA イベントをリッスンする
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
CAF DAI SDK はネイティブの CAF ミッドロール挿入点機能と緊密に統合されています。そのため、通常は CAF のミッドロール挿入点イベントを使用してロギングやカスタム機能をトリガーする必要があります。CAF DAI SDK には、CAF のミッドロール挿入点では直接利用できない追加イベント(四分位トラッキング イベントなど)が提供されています。
IMA DAI SDK を使用しているプラットフォームと同等の機能が必要な場合は、イベント リスナーを StreamManager にアタッチして、これらの追加イベントを処理する必要があります。これらのイベントを接続されている送信者アプリに渡す必要がある場合は、単に castContext.sendCustomMessage() を介して送信者にイベントを転送するだけです。
例:
...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();...
[[["わかりやすい","easyToUnderstand","thumb-up"],["問題の解決に役立った","solvedMyProblem","thumb-up"],["その他","otherUp","thumb-up"]],[["必要な情報がない","missingTheInformationINeed","thumb-down"],["複雑すぎる / 手順が多すぎる","tooComplicatedTooManySteps","thumb-down"],["最新ではない","outOfDate","thumb-down"],["翻訳に関する問題","translationIssue","thumb-down"],["サンプル / コードに問題がある","samplesCodeIssue","thumb-down"],["その他","otherDown","thumb-down"]],["最終更新日 2025-08-21 UTC。"],[],["The CAF DAI SDK utilizes CAF Ad Break events for most functions, but it also provides additional events like quartile tracking. Publishers needing full parity with the IMA DAI SDK should attach event listeners to the StreamManager to handle these extra events. To pass these events to sender apps, use `castContext.sendCustomMessage()`. An example shows how to add a listener for the `MIDPOINT` event, log it, and then broadcast it to all connected senders via a custom message channel.\n"]]