All Products
Search
Document Center

ApsaraVideo Live:Production studio callbacks

Last Updated:Jan 02, 2025

This topic describes the request parameters of production studio callbacks and provides examples of these callbacks.

Request parameters

ParameterTypeRequiredDescription
CasterIdStringNoThe ID of the production studio.
  • This parameter is required if you set the EventType parameter to OperateCallback or RuntimeErrorCallback.
  • This parameter is optional if you set the EventType parameter to EpisodeGroupCallback.
EventTypeStringYesThe type of the event.
  • OperateCallback: callback for operations.
  • RuntimeErrorCallback: callback for runtime errors.
  • EpisodeGroupCallback: callback for carousel playback.
  • ShowListDTSCallback: callback for playback progress of the current episode if the production studio is in playlist mode.
EventMessageEventMessageYesThe description of the event. For more information, see the EventMessage section of this topic.

EventMessage

  • The following table describes the fields of the EventMessage parameter if you set the EventType parameter to OperateCallback or RuntimeErrorCallback.
    FieldTypeRequiredDescription
    RequestIdStringNoThe ID of the request. This field is required if you set the EventType parameter to OperateCallback.
    SceneIdStringNoThe ID of the scene. This field is required for scene events.
    LayoutIdStringNoThe ID of the layout. This field is required for layout events.
    ResourceIdStringNoThe ID of the resource. This field is required for video source events.
    ComponentIdStringNoThe ID of the component. This field is required for component events.
    CodeStringNoThe status code.
    MessageStringNoThe message of the event.
  • The following table describes the fields of the EventMessage parameter if you set the EventType parameter to EpisodeGroupCallback.
    FieldTypeRequiredDescription
    ProgramIdStringYesThe ID of the episode list for carousel playback.
    EpisodeIdStringYesThe ID of the episode.
    CodeStringNoThe status code.
    MessageStringNoThe message of the event.
  • The following table describes the fields of the EventMessage parameter if you set the EventType parameter to ShowListDTSCallback.
    FieldTypeRequiredDescription
    ProgressTimeStringYesThe playback progress of the episode. Unit: milliseconds.
    ShowIdStringYesThe ID of the episode.
    DurationStringYesThe total length of the episode.
    ShowNameStringYesThe name of the episode.

Status codes

Status codeDescription
SuccessThe operation is successful.
StreamInterruptThe playback of live streams or files is unexpectedly terminated.
CanvasStreamInterruptThe canvas stream is unexpectedly terminated.
AudioResampleFailedThe audio resampling failed.
AudioAddFailedThe audio source failed to be added.
AudioDelFailedThe audio source failed to be deleted.
AudioStreamTypeInvalidThe type of the audio stream failed to be parsed.
VideoTypeInvalidThe type of the layer failed to be parsed.
VideoVisibleInvalidThe visibility of the layer element failed to be parsed.
VideoTransparencyInvalidThe transparency value of the layer element failed to be parsed.
VideoEffectInvalidThe effect value of the layer element failed to be parsed.
VideoWidthInvalidThe normalized value of the width of the layer element failed to be parsed.
VideoPositionReferInvalidThe reference axis of the layer element failed to be parsed.
VideoStreamTypeInvalidThe media type failed to be parsed. Media types include live streams and files.
VideoRepeatNumInvalidThe number of times that the video-on-demand (VOD) file is repeated failed to be parsed.
VideoStreamAddFailedThe live stream failed to be added.
ImageOpenFailedThe image failed to be opened.
ImageGetDecodeInfoFailedThe decoding information of the image failed to be queried.
ImageDecodeFailedThe image failed to be decoded.
TextInvalidThe text failed to be parsed.
TextFontInvalidThe font of the text failed to be parsed.
TextSizeInvalidThe normalized value of the font size of the text failed to be parsed.
TextBorderWidthInvalidThe normalized value of the border width of the text failed to be parsed.
CanvasLoadFailedThe canvas stream failed to be loaded.
SideOutputUrlInvalidThe stream redirect URL is invalid.

Examples

Callback for operations

 {
    "CasterId": "16A96B9A-F203-4EC5-8E43-CB92E68F****",
    "EventType": "OperateCallback",
    "EventMessage": {
        "RequestId": "26A96B9A-A201-4EC3-8E43-CB92E68FA132",
        "SceneId": "35716B9A-A201-4EC3-8E43-CB92E68F****",
        "ComponentId": "06196B9A-A201-4EC3-8E43-CB92E68F****",
        "Code": "ImageOpenFailed",
        "Message": "Fail to open image: http://XXXX/XXXX.jpg"
    }
}

Callback for runtime errors

{
    "CasterId": "16A96B9A-F203-4EC5-8E43-CB92E68F****",
    "EventType": "RuntimeErrorCallback",
    "EventMessage": {
      "Code": "StreamInterrupt",
      "Message": "Failed to open stream: rtmp://DOMAIN/APP/STREAM"
    }
}

Callback for playback progress

{
  "EventMessage": {
    "ProgressTime": "116796",
    "ShowId": "9ef1db9d-5e24-4e5f-b161-8a2429d9b882",
    "Duration": "396847",
    "ShowName": "test.mp4"
  },
  "EventType": "ShowListDTSCallback",
  "ResponseTime": 1663731128684,
  "CasterId": "3761c920-dfa6-40c7-a79c-2886b1493996"
}