翻訳は機械翻訳により提供されています。提供された翻訳内容と英語版の間で齟齬、不一致または矛盾がある場合、英語版が優先します。
関数ライフサイクルフック
ライフサイクルフックは、MediaTailor が再生中に関数を実行するタイミングを定義します。このページは、入力フィールド、出力名前空間、および各フックのデータフローを管理するルールの完全なリファレンスです。
概要
MediaTailor は 2 つのライフサイクルフックをサポートしています。
-
PRE_SESSION_INITIALIZATIONビューワーが新しいセッションを開始すると、 が 1 回発生します。オーディエンスセグメントの取得などの 1 回限りのセットアップ作業に使用します。この時点では広告時間枠は発生していないため、広告時間枠コンテキストは使用できません。 -
PRE_ADS_REQUESTは、ストリーム内の広告ブレークごとに 1 回、すべての広告決定サーバー (ADS) リクエストの前に起動します。ターゲットデータを使用した ADS リクエストのカスタマイズ、ADS URL の変更、ヘッダーの追加に使用します。
主な違いはタイミングです。 は 1 回PRE_SESSION_INITIALIZATION実行され、セッション全体で保持されるデータを設定しますが、 は繰り返しPRE_ADS_REQUEST実行され、各 ADS リクエストを特定の広告時間枠に合わせて調整できます。
入力フィールドリファレンス
| フィールド | タイプ | PRE_SESSION_INITIALIZATION | PRE_ADS_REQUEST |
|---|---|---|---|
session.id |
Long | ✓ | ✓ |
session.uuid |
String | ✓ | ✓ |
session.client_ip |
文字列 | ✓ | ✓ |
session.user_agent |
文字列 | ✓ | ✓ |
session.referer* |
String | ✓ | ✓ |
session.avail_duration_secs |
Long | ✗ | ✓ |
session.avail_duration_ms |
Long | ✗ | ✓ |
player_params.* |
String | ✓ | ✓ |
event.id |
文字列 | ✓ | ✓ |
event.hook |
文字列 | ✓ | ✓ |
event.timestamp |
String | ✓ | ✓ |
avail.index |
Int | ✗ | ✓ |
avail.random |
Long | ✗ | ✓ |
avail.source_content_time_epoch_ms |
Long | ✗ | ✓ |
scte.event_id |
Int | ✗ | ✓ |
scte.avail_num |
Int | ✗ | ✓ |
scte.segmentation_event_id |
Int | ✗ | ✓ |
scte.segmentation_type_id |
Int | ✗ | ✓ |
scte.segmentation_upid |
String | ✗ | ✓ |
scte.segmentation_upid.assetId |
文字列 | ✗ | ✓ |
scte.segmentation_upid.cueData.key |
文字列 | ✗ | ✓ |
scte.segmentation_upid.cueData.value |
String | ✗ | ✓ |
scte.unique_program_id |
Int | ✗ | ✓ |
scte.archive_allowed_flag |
ブール値 | ✗ | ✓ |
scte.delivery_not_restricted_flag |
ブール値 | ✗ | ✓ |
scte.device_restrictions |
Int | ✗ | ✓ |
scte.no_regional_blackout_flag |
ブール値 | ✗ | ✓ |
scte.segment_num |
Int | ✗ | ✓ |
scte.segments_expected |
Int | ✗ | ✓ |
scte.sub_segment_num |
Int | ✗ | ✓ |
scte.sub_segments_expected |
Int | ✗ | ✓ |
scte.avails_expected |
Long | ✗ | ✓ |
adsRequest.url |
String | ✗ | ✓ |
adsRequest.method |
文字列 | ✗ | ✓ |
adsRequest.headers.<key> |
文字列 | ✗ | ✓ |
adsRequest.body |
String | ✗ | ✓ |
* session.refererは、Referer ヘッダーがセッション初期化リクエストに含まれている場合にのみ存在します。アクセスする前に $exists(session.referer) を使用して確認します。