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

Data object MediaSessionState2

interface struct MediaSessionState2
Extends MediaSessionState Extends [MediaSessionState] with structured rating state for the currently playing media. Relationship to [MediaInfo#currentRating] (inherited via [MediaSessionState#mediaInfo]):
  • When a session exposes a MediaSessionState2 with a non-null ratingState, clients MUST prefer ratingState over the float MediaInfo.currentRating for any rating display or interaction.
  • When ratingState is null, clients should fall back to MediaInfo.currentRating.
  • Servers that expose MediaSessionState2 SHOULD continue to populate MediaInfo.currentRating (mirrored from RatingState.numericRating) so that legacy clients reading only [MediaSessionState] still see a consistent rating value.
  • When ratingState carries only a thumbs rating (no numeric rating), servers SHOULD mirror it onto MediaInfo.currentRating using the thumbs convention advertised in [Capabilities#ratings] (DOWN -> 0.0, UP -> 1.0). When no rating is present, leave it null.

Fields

ratingState

RatingState? — Optional
Structured rating state for the currently playing media item. Provides richer rating semantics than the float-based [MediaInfo#currentRating] field by distinguishing thumbs-based and numeric ratings. May be null when the provider does not support structured ratings for this session, in which case clients fall back to MediaInfo.currentRating.
Last modified on October 29, 2026