Inserting ad markers (EXT-X-CUE-OUT/EXT-X-CUE-IN) | v0.17.3.0+

REST API를 사용하여 LL-HLS 및 HLS playlist 내에 동적으로 광고 마커를 삽입 할 수 있습니다.

CUE-OUT 이벤트를 호출하게 되면 playlist 내에 아래와 같이 태그가 추가됩니다.

#EXT-X-CUE-OUT:DURATION=<time>

#EXT-X-CUE-IN

#EXT-X-CUE-OUT#EXT-X-CUE-IN은 한쌍이며, 두 태그 사이의 전체 섹션은 광고 서버에 의해 광고 컨텐츠로 대체됩니다.

DURATION=<time> 은 필수이며, 광고의 유지 시간을 나타냅니다.

CUE-IN 이벤트를 호출하여 삽입된 광고를 조기에 종료 할 수 있습니다. 이벤트 호출 시 playlist 내에 #EXT-X-CUE-IN 태그가 즉시 추가되며 기존에 추가되어 있던 #EXT-X-CUE-IN 태그는 삭제됩니다.

API Interface

Request

POST /v1/vhosts{vhost}/apps/{app}/streams/{stream}:sendEvent

Header

Authorization: Basic {credentials}

# Authorization
Credentials for HTTP Basic Authentication created with <AccessToken>

Body

{
  "eventFormat": "cue",
  "events":[
    {
      "cueType": "out", // out | in
      "duration": 60500 // milliseconds, only available when cueType is out
    }
  ]
}
POST /v1/vhosts{vhost}/apps/{app}/streams/{stream}:sendEvents

Header

Authorization: Basic {credentials}

# Authorization
Credentials for HTTP Basic Authentication created with <AccessToken>

Body

[
  {
    "eventFormat": "id3v2",
    "eventType": "video", // "eventTarget": "video" is same
    "events":[
      {
        "frameType": "TXXX",
        "info": "AirenSoft",
        "data": "OvenMediaEngine"
      },
      {
        "frameType": "TIT2",
        "data": "OvenMediaEngine 123"
      }
    ]
  },
  {
    "eventFormat": "cue",
    "events":[
      {
        "cueType": "out", // out | in
        "duration": 60500 // milliseconds, only available when cueType is out
      }
    ]
  }
]

Responses

200 Ok

The request has succeeded

Header

Content-Type: application/json

Body

{
    "message": "OK",
    "statusCode": 200
}
400 Bad Request

Invalid request. Body is not a Json Object or does not have a required value

401 Unauthorized

Authentication required

Header

WWW-Authenticate: Basic realm=”OvenMediaEngine”

Body

{
    "message": "[HTTP] Authorization header is required to call API (401)",
    "statusCode": 401
}
404 Not Found

The given vhost name or application name could not be found.

Body

{
    "message": "[HTTP] Could not find the application: [default/app2] (404)",
    "statusCode": 404
}

Last updated