Event Input
Use of the Vevo API requires some events to be sent back to Vevo as they occur. All events share the following common EventInput type:
input EventInput {
videoId: String!,
containerId: String,
position: Int!,
sessionId: String,
device: String,
anonId: String!,
appVersion: String!
}
videoId: The id of the video which triggered the event.
containerId: The id of the container containing the video. This is nullable, as there won't always be a parent container (for search results, as an example).
position: The playhead position of the currently visible video, in seconds.
sessionId: An identifier representing a user "session"; cycled each time the application is closed.
device: The model number of the current hardware sending the event. An example would be "3920X".
anonId: An anonymous ID that must be unique and persistent across sessions. It may be persistent across application installations. It must not be persistent across devices. Example solutions would be to use the device advertising id, or generate a version 4 UUID at application installation.
appVersion: The current version of the running application.
Event Submission
There are four events which can be submitted as they occur. Play and Heartbeat are required.
recordPlay(event: EventInput!): Boolean!
The user has pressed the "play" button on the UI or a new video has otherwise started playing. Heartbeat events should now start for this video.
recordHeartbeat(interval: Int!, event: EventInput!): Boolean!
Heartbeats must be sent at a regular interval while a video is playing. This interval (usually 5 seconds) is also sent in the function, as shown above. There is no "stop" event; it is implicit in the last heartbeat recevied.
recordPause(event: EventInput!): Boolean!
The user has pressed the "pause" button. This event does not encompass other reasons that a video may stop playing, such as backgrounding of the app. Heartbeat events may pause until the video starts playing again. If the app is closed or backgrounded, heartbeat events may stop. Subsequent play events should be recorded.
recordNext(event: EventInput!): Boolean!
The user has pressed the "next" or "skip" button in the UI. In this case, the video id in the event input is the id of the video that was skipped, not the next video that will play.