Amazon Developer

as

Settings
Sign out
Notifications
Alexa
Amazon Appstore
Ring
AWS
Documentation
Support
Contact Us
My Cases
Get Started
Design and Develop
Publish
Reference
Support
Native
Skip to main content

Interface IPlaybackEventBuilder

interface IPlaybackEventBuilder
Extends com.amazon.apmf.IStandard Builder interface to create a PlaybackEvent2 object.

Methods

playbackEvent()

IPlaybackEventBuilder* playbackEvent(IPlaybackEvent* playbackEvent)
Initializes the 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()

IPlaybackEventBuilder* contentId(IContentId* 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.

Parameters

contentId
IContentId* — Required ID resolvable in selected catalog.

Returns

IPlaybackEventBuilder* a non-null pointer to the current IPlaybackEventBuilder instance.

creditsPositionMs()

IPlaybackEventBuilder* creditsPositionMs(i64 creditsPositionMs)
Sets the position of the credits in the content, with 0 being the start of content. Used for determining viewing completeness.

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


durationMs()

IPlaybackEventBuilder* durationMs(i64 durationMs)
Sets the duration of the content.

Parameters

durationMs
i64 — Required Duration of the content in milliseconds.

Returns

IPlaybackEventBuilder* a non-null pointer to the current IPlaybackEventBuilder instance.

Throws


eventTimestamp()

IPlaybackEventBuilder* eventTimestamp(com.amazon.apmf.RealTimeInstant 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. 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


channelDescriptor()

IPlaybackEventBuilder* channelDescriptor(com.amazon.kepler.tv.epg_provider_models.IChannelDescriptor* 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.

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()

IPlaybackEventBuilder* playbackPositionMs(i64 playbackPositionMs)
Sets the customer’s playback position in the content, with 0 being the start of content. This is a required field. 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


profileId()

IPlaybackEventBuilder* profileId(IProfileId* profileId)
Sets the associated 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()

IPlaybackEventBuilder* state(PlaybackStateEnum playbackState)
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
PlaybackStateEnum — Required Current viewing state.

Returns

IPlaybackEventBuilder* a non-null pointer to the current IPlaybackEventBuilder instance.

buildActiveEvent()

IPlaybackEvent* buildActiveEvent()
Builds a 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


buildOffDeviceEvent()

IPlaybackEvent* buildOffDeviceEvent()
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.

Returns

IPlaybackEvent* a non-null pointer to the IPlaybackEvent object created.

Throws


Last modified on October 29, 2026