# MediaPlayback


```
@Generated(value = ["GoogleHomePlatformCodegen"])
interface MediaPlayback : MediaPlaybackTrait.Attributes, MatterTrait, MediaPlaybackCommands
```

<br />

*** ** * ** ***

API for the MediaPlayback trait. This trait provides an interface for controlling media playback (play, pause, and so forth) on a media device such as a TV, set-top box, or smart speaker.

## Summary

| ### Nested types |
|---|
| `enum https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MediaPlayback.Attribute : https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-enum/index.html, https://developers.home.google.com/reference/kotlin/com/google/home/Field` Descriptor enum for this trait's attributes. |
| `enum https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MediaPlayback.Command : https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-enum/index.html` Descriptor enum for this trait's commands. |
| `class https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MediaPlayback.StateChangedEvent : https://developers.home.google.com/reference/kotlin/com/google/home/Event, https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MediaPlaybackTrait.StateChanged` |
| `enum https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MediaPlayback.StateChangedEvent.EventFields : https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-enum/index.html, https://developers.home.google.com/reference/kotlin/com/google/home/Field` Descriptor enum for this event's fields. |

| ### Public functions |
|---|---|
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html` | `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MediaPlayback#supports(com.google.home.matter.standard.MediaPlayback.Attribute)(attribute: https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MediaPlayback.Attribute)` |
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html` | `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MediaPlayback#supports(com.google.home.matter.standard.MediaPlayback.Command)(command: https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MediaPlayback.Command)` |

| ### Public properties |
|---|---|
| `open https://developers.home.google.com/reference/kotlin/com/google/home/TraitFactory<https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MediaPlayback>` | `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MediaPlayback#factory()` |

| ### Inherited functions |
|---|
| From [com.google.home.matter.standard.MediaPlaybackCommands](https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MediaPlaybackCommands) |---|---| | `suspend https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html` | `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MediaPlaybackCommands#activateAudioTrack(kotlin.String,kotlin.UByte)(trackId: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html, audioOutputIndex: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-u-byte/index.html)` Activate an audio track. | | `https://developers.home.google.com/reference/kotlin/com/google/home/BatchableCommand<https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html>` | `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MediaPlaybackCommands#activateAudioTrackBatchable(kotlin.String,kotlin.UByte)(trackId: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html, audioOutputIndex: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-u-byte/index.html)` The batchable version of `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MediaPlaybackCommands#activateAudioTrack(kotlin.String,kotlin.UByte)` command. | | `suspend https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html` | `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MediaPlaybackCommands#activateTextTrack(kotlin.String)(trackId: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)` Activate a text track. | | `https://developers.home.google.com/reference/kotlin/com/google/home/BatchableCommand<https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html>` | `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MediaPlaybackCommands#activateTextTrackBatchable(kotlin.String)(trackId: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)` The batchable version of `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MediaPlaybackCommands#activateTextTrack(kotlin.String)` command. | | `suspend https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html` | `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MediaPlaybackCommands#deactivateTextTrack()()` Deactivate the current text track. | | `https://developers.home.google.com/reference/kotlin/com/google/home/BatchableCommand<https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html>` | `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MediaPlaybackCommands#deactivateTextTrackBatchable()()` The batchable version of `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MediaPlaybackCommands#deactivateTextTrack()` command. | | `suspend https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MediaPlaybackTrait.FastForwardCommand.Response` | `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MediaPlaybackCommands#fastForward(kotlin.Function1)(optionalArgs: https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MediaPlaybackTrait.FastForwardCommand.OptionalArgs.() -> https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)` Fast forward the current media. | | `https://developers.home.google.com/reference/kotlin/com/google/home/BatchableCommand<https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MediaPlaybackTrait.FastForwardCommand.Response>` | `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MediaPlaybackCommands#fastForwardBatchable(kotlin.Function1)(optionalArgs: https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MediaPlaybackTrait.FastForwardCommand.OptionalArgs.() -> https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)` The batchable version of `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MediaPlaybackCommands#fastForward(kotlin.Function1)` command. | | `suspend https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MediaPlaybackTrait.NextCommand.Response` | `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MediaPlaybackCommands#next()()` Move to the next item in the media. | | `https://developers.home.google.com/reference/kotlin/com/google/home/BatchableCommand<https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MediaPlaybackTrait.NextCommand.Response>` | `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MediaPlaybackCommands#nextBatchable()()` The batchable version of `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MediaPlaybackCommands#next()` command. | | `suspend https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MediaPlaybackTrait.PauseCommand.Response` | `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MediaPlaybackCommands#pause()()` Pause the current media. | | `https://developers.home.google.com/reference/kotlin/com/google/home/BatchableCommand<https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MediaPlaybackTrait.PauseCommand.Response>` | `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MediaPlaybackCommands#pauseBatchable()()` The batchable version of `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MediaPlaybackCommands#pause()` command. | | `suspend https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MediaPlaybackTrait.PlayCommand.Response` | `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MediaPlaybackCommands#play()()` Play the current media. | | `https://developers.home.google.com/reference/kotlin/com/google/home/BatchableCommand<https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MediaPlaybackTrait.PlayCommand.Response>` | `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MediaPlaybackCommands#playBatchable()()` The batchable version of `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MediaPlaybackCommands#play()` command. | | `suspend https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MediaPlaybackTrait.PreviousCommand.Response` | `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MediaPlaybackCommands#previous()()` Move to the previous item in the current media. | | `https://developers.home.google.com/reference/kotlin/com/google/home/BatchableCommand<https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MediaPlaybackTrait.PreviousCommand.Response>` | `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MediaPlaybackCommands#previousBatchable()()` The batchable version of `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MediaPlaybackCommands#previous()` command. | | `suspend https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MediaPlaybackTrait.RewindCommand.Response` | `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MediaPlaybackCommands#rewind(kotlin.Function1)(optionalArgs: https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MediaPlaybackTrait.RewindCommand.OptionalArgs.() -> https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)` Rewind the current media. | | `https://developers.home.google.com/reference/kotlin/com/google/home/BatchableCommand<https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MediaPlaybackTrait.RewindCommand.Response>` | `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MediaPlaybackCommands#rewindBatchable(kotlin.Function1)(optionalArgs: https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MediaPlaybackTrait.RewindCommand.OptionalArgs.() -> https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)` The batchable version of `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MediaPlaybackCommands#rewind(kotlin.Function1)` command. | | `suspend https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MediaPlaybackTrait.SeekCommand.Response` | `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MediaPlaybackCommands#seek(kotlin.ULong)(position: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-u-long/index.html)` Change the playback position in the current media to the specified position. | | `https://developers.home.google.com/reference/kotlin/com/google/home/BatchableCommand<https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MediaPlaybackTrait.SeekCommand.Response>` | `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MediaPlaybackCommands#seekBatchable(kotlin.ULong)(position: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-u-long/index.html)` The batchable version of `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MediaPlaybackCommands#seek(kotlin.ULong)` command. | | `suspend https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MediaPlaybackTrait.SkipBackwardCommand.Response` | `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MediaPlaybackCommands#skipBackward(kotlin.ULong)(deltaPositionMilliseconds: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-u-long/index.html)` Skip backward by a specified amount of time within the current media. | | `https://developers.home.google.com/reference/kotlin/com/google/home/BatchableCommand<https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MediaPlaybackTrait.SkipBackwardCommand.Response>` | `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MediaPlaybackCommands#skipBackwardBatchable(kotlin.ULong)(deltaPositionMilliseconds: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-u-long/index.html)` The batchable version of `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MediaPlaybackCommands#skipBackward(kotlin.ULong)` command. | | `suspend https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MediaPlaybackTrait.SkipForwardCommand.Response` | `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MediaPlaybackCommands#skipForward(kotlin.ULong)(deltaPositionMilliseconds: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-u-long/index.html)` Skip forward by a specified amount of time within the current media. | | `https://developers.home.google.com/reference/kotlin/com/google/home/BatchableCommand<https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MediaPlaybackTrait.SkipForwardCommand.Response>` | `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MediaPlaybackCommands#skipForwardBatchable(kotlin.ULong)(deltaPositionMilliseconds: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-u-long/index.html)` The batchable version of `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MediaPlaybackCommands#skipForward(kotlin.ULong)` command. | | `suspend https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MediaPlaybackTrait.StartOverCommand.Response` | `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MediaPlaybackCommands#startOver()()` Start over from the beginning of the current media. | | `https://developers.home.google.com/reference/kotlin/com/google/home/BatchableCommand<https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MediaPlaybackTrait.StartOverCommand.Response>` | `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MediaPlaybackCommands#startOverBatchable()()` The batchable version of `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MediaPlaybackCommands#startOver()` command. | | `suspend https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MediaPlaybackTrait.StopCommand.Response` | `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MediaPlaybackCommands#stop()()` Stop playing the current media. | | `https://developers.home.google.com/reference/kotlin/com/google/home/BatchableCommand<https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MediaPlaybackTrait.StopCommand.Response>` | `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MediaPlaybackCommands#stopBatchable()()` The batchable version of `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MediaPlaybackCommands#stop()` command. | |
| From [com.google.home.matter.standard.MediaPlaybackTrait.Attributes](https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MediaPlaybackTrait.Attributes) |---|---| | `open https://developers.home.google.com/reference/kotlin/com/google/home/StructDescriptor` | `@https://developers.home.google.com/reference/kotlin/com/google/home/annotation/HomeExperimentalGenericApi https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MediaPlaybackTrait.Attributes#getDescriptor()()` Returns the descriptor for the struct. | | `open https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html?` | `@https://developers.home.google.com/reference/kotlin/com/google/home/annotation/HomeExperimentalGenericApi https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MediaPlaybackTrait.Attributes#getFieldValueById(kotlin.UInt)(tagId: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-u-int/index.html)` Returns the value of the field for the given tag ID. | |
| From [com.google.home.TraitStateInvalidation](https://developers.home.google.com/reference/kotlin/com/google/home/TraitStateInvalidation) |---|---| | `suspend https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html` | `https://developers.home.google.com/reference/kotlin/com/google/home/TraitStateInvalidation#forceRead()()` | |

| ### Inherited properties |
|---|
| From [com.google.home.matter.standard.MediaPlaybackTrait.Attributes](https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MediaPlaybackTrait.Attributes) |---|---| | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html<https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-u-int/index.html>` | `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MediaPlaybackTrait.Attributes#acceptedCommandList()` A list of client-generated commands which are supported by this cluster server instance. | | `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MediaPlaybackTrait.TrackStruct?` | `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MediaPlaybackTrait.Attributes#activeAudioTrack()` The currently active audio track. | | `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MediaPlaybackTrait.TrackStruct?` | `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MediaPlaybackTrait.Attributes#activeTextTrack()` The currently active text track. | | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html<https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-u-int/index.html>` | `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MediaPlaybackTrait.Attributes#attributeList()` A list of the attribute IDs of the attributes supported by the cluster instance. | | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html<https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MediaPlaybackTrait.TrackStruct>?` | `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MediaPlaybackTrait.Attributes#availableAudioTracks()` The list of available audio tracks. | | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html<https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MediaPlaybackTrait.TrackStruct>?` | `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MediaPlaybackTrait.Attributes#availableTextTracks()` The list of available text tracks. | | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-u-short/index.html` | `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MediaPlaybackTrait.Attributes#clusterRevision()` The revision of the server cluster specification supported by the cluster instance. | | `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MediaPlaybackTrait.PlaybackStateEnum?` | `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MediaPlaybackTrait.Attributes#currentState()` The current playback state of media. | | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-u-long/index.html?` | `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MediaPlaybackTrait.Attributes#duration()` The duration, in milliseconds, of the media currently being played back. | | `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MediaPlaybackTrait.Feature` | `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MediaPlaybackTrait.Attributes#featureMap()` Whether the server supports zero or more optional cluster features. | | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html<https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-u-int/index.html>` | `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MediaPlaybackTrait.Attributes#generatedCommandList()` A list of server-generated commands (server to client) which are supported by this cluster server instance. | | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-float/index.html?` | `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MediaPlaybackTrait.Attributes#playbackSpeed()` The speed at which the current media is being played. | | `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MediaPlaybackTrait.PlaybackPositionStruct?` | `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MediaPlaybackTrait.Attributes#sampledPosition()` The position of playback as of the specified time. | | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-u-long/index.html?` | `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MediaPlaybackTrait.Attributes#seekRangeEnd()` The furthest forward valid position to which a client may seek, in milliseconds, relative to the start of the media. | | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-u-long/index.html?` | `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MediaPlaybackTrait.Attributes#seekRangeStart()` The earliest valid position to which a client may seek, in milliseconds, relative to the start of the media. | | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-u-long/index.html?` | `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/MediaPlaybackTrait.Attributes#startTime()` The start time of the media, such as a livestream event, in UTC (ISO-8601) format. | |
| From [com.google.home.Trait](https://developers.home.google.com/reference/kotlin/com/google/home/Trait) |---|---| | `https://developers.home.google.com/reference/kotlin/com/google/home/Trait.TraitMetadata` | `https://developers.home.google.com/reference/kotlin/com/google/home/Trait#metadata()` | |

## Public functions

### supports

```
fun supports(attribute: MediaPlayback.Attribute): Boolean
```

### supports

```
fun supports(command: MediaPlayback.Command): Boolean
```

## Public properties

### factory

```
open val factory: TraitFactory<MediaPlayback>
```