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
MediaSessionState2with a non-nullratingState, clients MUST preferratingStateover the floatMediaInfo.currentRatingfor any rating display or interaction. -
When
ratingStateis null, clients should fall back toMediaInfo.currentRating. -
Servers that expose
MediaSessionState2SHOULD continue to populateMediaInfo.currentRating(mirrored fromRatingState.numericRating) so that legacy clients reading only [MediaSessionState] still see a consistent rating value. -
When
ratingStatecarries only a thumbs rating (no numeric rating), servers SHOULD mirror it ontoMediaInfo.currentRatingusing the thumbs convention advertised in [Capabilities#ratings] (DOWN-> 0.0,UP-> 1.0). When no rating is present, leave it null.
Fields
ratingState
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 toRatingState?— Optional
MediaInfo.currentRating.
