Interface IPlaybackEventBuilder
interface IPlaybackEventBuilder
Extends com.amazon.apmf.IStandard
Builder interface to create a PlaybackEvent2 object.
Methods
playbackEvent()
Initializes theIPlaybackEventBuilder*playbackEvent(IPlaybackEvent*playbackEvent)
PlaybackEventBuilder with values of existing playbackEvent.
Parameters
playbackEvent
IPlaybackEvent* — Required
The playback event whose values will be used to initialize the builder.
Returns
IPlaybackEventBuilder*
a non-null pointer to the current IPlaybackEventBuilder instance.
contentId()
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.IPlaybackEventBuilder*contentId(IContentId*contentId)
Parameters
contentId
IContentId* — Required
ID resolvable in selected catalog.
Returns
IPlaybackEventBuilder*
a non-null pointer to the current IPlaybackEventBuilder instance.
creditsPositionMs()
Sets the position of the credits in the content, with 0 being the start of content. Used for determining viewing completeness.IPlaybackEventBuilder*creditsPositionMs(i64creditsPositionMs)
Parameters
creditsPositionMs
i64 — Required
Credits position in milliseconds since the start of content.
Returns
IPlaybackEventBuilder*
a non-null pointer to the current IPlaybackEventBuilder instance.
Throws
InvalidArgumentError— if the creditsPositionMs is less than 0.
durationMs()
Sets the duration of the content.IPlaybackEventBuilder*durationMs(i64durationMs)
Parameters
durationMs
i64 — Required
Duration of the content in milliseconds.
Returns
IPlaybackEventBuilder*
a non-null pointer to the current IPlaybackEventBuilder instance.
Throws
InvalidArgumentError— if the durationMs is less than 0.
eventTimestamp()
Sets the date of when the playback event occurred. This is is a required field for playback events which did not occur on the same device.IPlaybackEventBuilder*eventTimestamp(com.amazon.apmf.RealTimeInstanteventTimestamp)
buildOffDeviceEvent() will fail if this field is not set.
Parameters
eventTimestamp
com.amazon.apmf.RealTimeInstant — Required
Event date in time since epoch.
Returns
IPlaybackEventBuilder*
a non-null pointer to the current IPlaybackEventBuilder instance.
Throws
InvalidArgumentError— if the eventTimestamp is less than 0.
channelDescriptor()
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.IPlaybackEventBuilder*channelDescriptor(com.amazon.kepler.tv.epg_provider_models.IChannelDescriptor*channelDescriptor)
Parameters
channelDescriptor
com.amazon.kepler.tv.epg_provider_models.IChannelDescriptor* — Required
The uniquely identifying descriptor of the channel the content is playing on.
Returns
IPlaybackEventBuilder*
a non-null pointer to the current IPlaybackEventBuilder instance.
playbackPositionMs()
Sets the customer’s playback position in the content, with 0 being the start of content. This is a required field.IPlaybackEventBuilder*playbackPositionMs(i64playbackPositionMs)
buildActiveEvent() and buildOffDeviceEvent() will fail if this field is not set.
Parameters
playbackPositionMs
i64 — Required
Current position in milliseconds since the start of content.
Returns
IPlaybackEventBuilder*
a non-null pointer to the current IPlaybackEventBuilder instance.
Throws
InvalidArgumentError— if the playbackPositionMs is less than 0.
profileId()
Sets the associatedIPlaybackEventBuilder*profileId(IProfileId*profileId)
profileId of the user who is watching the content.
Parameters
profileId
IProfileId* — Required
The associated profileId of the user.
Returns
IPlaybackEventBuilder*
a non-null pointer to the current IPlaybackEventBuilder instance.
state()
Sets the customer’s current viewing state of the content. This is a required field.IPlaybackEventBuilder*state(PlaybackStateEnumplaybackState)
buildActiveEvent() and buildOffDeviceEvent() will fail if this field is not set.
Parameters
playbackState
PlaybackStateEnum — Required
Current viewing state.
Returns
IPlaybackEventBuilder*
a non-null pointer to the current IPlaybackEventBuilder instance.
buildActiveEvent()
Builds aIPlaybackEvent*buildActiveEvent()
PlaybackEvent object with the fields set on the builder for a playback event that occured on-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.
Returns
IPlaybackEvent*
a non-null pointer to the IPlaybackEvent object created.
Throws
ObjectCreationError— if required fields are not set.
buildOffDeviceEvent()
Builds aIPlaybackEvent*buildOffDeviceEvent()
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.
Returns
IPlaybackEvent*
a non-null pointer to the IPlaybackEvent object created.
Throws
ObjectCreationError— if required fields are not set.

