PlaybackEvent object.
Constructors
new PlaybackEventBuilder()
new PlaybackEventBuilder(): PlaybackEventBuilderReturns
PlaybackEventBuilderMethods
buildActiveEvent()
buildActiveEvent():PlaybackEvent
Builds a PlaybackEvent object with the fields set on the builder for a playback event that occured on-device.
If EventTimestamp is not set, it will be set as the current time.
For VOD content, contentId needs to be set.
For linear/live content, either liveStationId or channelDescriptor needs to be set while
contentId can be provided additionally.
Throws
InvalidArgumentErrorif required fields are not set.
Returns
PlaybackEvent
PlaybackEvent The PlaybackEvent object created.
buildOffDeviceEvent()
buildOffDeviceEvent():PlaybackEvent
Builds a PlaybackEvent object with the fields set on the builder for a playback event that occured off-device.
For VOD content, contentId needs to be set.
For linear/live content, either liveStationId or channelDescriptor needs to be set while
contentId can be provided additionally.
Throws
InvalidArgumentErrorif required fields are not set.
Returns
PlaybackEvent
PlaybackEvent The PlaybackEvent object created.
channelDescriptor()
channelDescriptor(channelDescriptor:IChannelDescriptor): PlaybackEventBuilder
Sets the channel descriptor of the linear channel the content is playing on.
The channel descriptor uniquely identifies the channel across all channels within the application package,
This channel descriptor should match the one used for Live TV integration.
This field is required only if the content is being played as part of a Live TV linear channel
that has been integrated using the Kepler EPG Provider API.
Parameters
channelDescriptor
IChannelDescriptor
The uniquely identifying descriptor of the channel the content is playing on.
Returns
PlaybackEventBuilder PlaybackEventBuilder The currentPlaybackEventBuilder object.
contentId()
contentId(contentId: IContentId): PlaybackEventBuilder Sets the ID, resolvable in selected catalog, of the content being played. This field is required for VOD content and optional for linear/live content.Parameters
contentId
IContentId ID resolvable in selected catalog.Returns
PlaybackEventBuilder PlaybackEventBuilder The currentPlaybackEventBuilder object.
creditsPositionMs()
creditsPositionMs(creditsPositionMs:number): PlaybackEventBuilder
Sets the position of the credits in the content, offset from 0. Used for determining viewing completeness.
Parameters
creditsPositionMs
number
Credits position in milliseconds.
Throws
InvalidArgumentErrorif the position is less than 0.
Returns
PlaybackEventBuilder PlaybackEventBuilder The currentPlaybackEventBuilder object.
durationMs()
durationMs(durationMs:number): PlaybackEventBuilder
Sets the duration of the content.
Parameters
durationMs
number
Duration of the content in milliseconds.
Throws
InvalidArgumentErrorif the position is less than 0.
Returns
PlaybackEventBuilder PlaybackEventBuilder The currentPlaybackEventBuilder object.
eventTimestamp()
eventTimestamp(eventTimestamp:Date): PlaybackEventBuilder
Sets the date when the playback event occurred.
This is is a required field for playback events which did not occur on the same device. buildOffDeviceEvent() will fail if this field is not set.
Parameters
eventTimestamp
Date
Date event occured.
Returns
PlaybackEventBuilder PlaybackEventBuilder The currentPlaybackEventBuilder object.
liveStationId()
liveStationId(liveStationId: IContentId): PlaybackEventBuilder Sets the ID of the linear station the content is playing on. This field is required only if the content is being played as part of a Live TV linear channel. 1.3.0Parameters
liveStationId
IContentId The ID of the linear station the content is playing on.Returns
PlaybackEventBuilder PlaybackEventBuilder The currentPlaybackEventBuilder object.
playbackEvent()
playbackEvent(playbackEvent: IPlaybackEvent): PlaybackEventBuilder Initializes thePlaybackEventBuilder with values of existing playbackEvent.
Parameters
playbackEvent
IPlaybackEvent The playback event whose values will be used to initialize the builder.Returns
PlaybackEventBuilder PlaybackEventBuilder The currentPlaybackEventBuilder object.
playbackPositionMs()
playbackPositionMs(playbackPositionMs:number): PlaybackEventBuilder
Sets the customer’s current position in playback, offset from 0.
This is a required field. buildActiveEvent() and buildOffDeviceEvent() will fail if this field is not set.
Parameters
playbackPositionMs
number
Current position in milliseconds.
Throws
InvalidArgumentErrorif theplaybackPositionMsis less than 0.
Returns
PlaybackEventBuilder PlaybackEventBuilder The currentPlaybackEventBuilder object.
playbackState()
playbackState(playbackState: PlaybackState): PlaybackEventBuilder Sets the customer’s current viewing state of the content. This is a required field.buildActiveEvent() and buildOffDeviceEvent() will fail if this field is not set.
Parameters
playbackState
PlaybackState Current viewing state.Returns
PlaybackEventBuilder PlaybackEventBuilder The currentPlaybackEventBuilder object.
profileId()
profileId(profileId: IProfileId): PlaybackEventBuilder Sets the associatedprofileId of the user who is watching the content.
Parameters
profileId
IProfileId The associatedprofileId of the user.
Returns
PlaybackEventBuilder PlaybackEventBuilder The currentPlaybackEventBuilder object.

