An operation such as uploading, deleting, or video processing initiated on a video in VOD can be referred to as an event. The execution of an event takes a certain amount of time. Upon completion of the event, VOD will immediately notify the application service of the execution result, i.e., sending an event notification.
VOD supports the following types of event notifications:
|Upload and deletion||Video upload completion|
|Video pull from URL completion|
|Video deletion completion|
|Video processing||Task flow status change|
|Video editing completion|
|Video composing completion|
Event notification modes include "normal callback" and "reliable callback". You can log in to the VOD Console to set the callback mode and select the events for which you want to receive callbacks. For detailed directions, please see Callback Settings.
Normal callback is a mode in which the application service passively receives event notifications. After the callback URL is configured and the normal callback mode is selected, VOD will initiate a callback to the callback URL after an event is completed.
A normal callback initiated by VOD is an HTTP request, where the request body is in JSON format and the content is the
EventContent structure excluding the
Take task status change notification as an example. The
EventType parameter in the callback is
ProcedureStateChanged, and the information is represented by the
ProcedureStateChangeEvent parameter (
Reliable callback is a mode in which the application service actively pulls event notifications to VOD. After the reliable callback mode is selected, the VOD system will put event notifications into a queue, and the application service will consume the notifications in the queue through a server API.
After the application service gets a message through the PullEvents API, the ConfirmEvents API needs to be called for confirmation. The message must be confirmed for receipt before it can be removed from the queue in VOD, so the reliability of "reliable callback" is higher than that of "normal callback". If the requirement for event notification reliability is high, you are recommended to use the "reliable callback" mode.