Added in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Also in [R Extensions 3](https://developer.android.com/sdkExtensions) Summary: [Constants](https://developer.android.com/reference/android/provider/CloudMediaProvider.CloudMediaSurfaceStateChangedCallback#constants) \| [Methods](https://developer.android.com/reference/android/provider/CloudMediaProvider.CloudMediaSurfaceStateChangedCallback#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/provider/CloudMediaProvider.CloudMediaSurfaceStateChangedCallback#inhmethods)

# CloudMediaProvider.CloudMediaSurfaceStateChangedCallback

*** ** * ** ***


`
public
static
final

class
CloudMediaProvider.CloudMediaSurfaceStateChangedCallback
`


`

extends https://developer.android.com/reference/java/lang/Object


`

`


`

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.provider.CloudMediaProvider.CloudMediaSurfaceStateChangedCallback |

<br />

*** ** * ** ***

This class is used by `https://developer.android.com/reference/android/provider/CloudMediaProvider` to send `https://developer.android.com/reference/android/view/Surface` state updates to
picker launched via `https://developer.android.com/reference/android/provider/MediaStore#ACTION_PICK_IMAGES`.
**See also:**

- `https://developer.android.com/reference/android/provider/MediaStore#ACTION_PICK_IMAGES`

## Summary

| ### Constants ||
|---|---|
| `int` | `https://developer.android.com/reference/android/provider/CloudMediaProvider.CloudMediaSurfaceStateChangedCallback#PLAYBACK_STATE_BUFFERING` Constant to notify that the playback is buffering |
| `int` | `https://developer.android.com/reference/android/provider/CloudMediaProvider.CloudMediaSurfaceStateChangedCallback#PLAYBACK_STATE_COMPLETED` Constant to notify that the playback has completed |
| `int` | `https://developer.android.com/reference/android/provider/CloudMediaProvider.CloudMediaSurfaceStateChangedCallback#PLAYBACK_STATE_ERROR_PERMANENT_FAILURE` Constant to notify that the playback has failed with a permanent error. |
| `int` | `https://developer.android.com/reference/android/provider/CloudMediaProvider.CloudMediaSurfaceStateChangedCallback#PLAYBACK_STATE_ERROR_RETRIABLE_FAILURE` Constant to notify that the playback has failed with a retriable error. |
| `int` | `https://developer.android.com/reference/android/provider/CloudMediaProvider.CloudMediaSurfaceStateChangedCallback#PLAYBACK_STATE_MEDIA_SIZE_CHANGED` Constant to notify that the media size is first known or has changed. |
| `int` | `https://developer.android.com/reference/android/provider/CloudMediaProvider.CloudMediaSurfaceStateChangedCallback#PLAYBACK_STATE_PAUSED` Constant to notify that the playback is paused. |
| `int` | `https://developer.android.com/reference/android/provider/CloudMediaProvider.CloudMediaSurfaceStateChangedCallback#PLAYBACK_STATE_READY` Constant to notify that the playback is ready to be played |
| `int` | `https://developer.android.com/reference/android/provider/CloudMediaProvider.CloudMediaSurfaceStateChangedCallback#PLAYBACK_STATE_STARTED` Constant to notify that the playback has started |

| ### Public methods ||
|---|---|
| ` void` | ` https://developer.android.com/reference/android/provider/CloudMediaProvider.CloudMediaSurfaceStateChangedCallback#setPlaybackState(int,%20int,%20android.os.Bundle)(int surfaceId, int playbackState, https://developer.android.com/reference/android/os/Bundle playbackStateInfo) ` This is called to notify playback state update for a `https://developer.android.com/reference/android/view/Surface` on the picker launched via `https://developer.android.com/reference/android/provider/MediaStore#ACTION_PICK_IMAGES`. |

| ### Inherited methods |
|---|---|
| From class ` https://developer.android.com/reference/java/lang/Object ` |---|---| | ` https://developer.android.com/reference/java/lang/Object` | ` https://developer.android.com/reference/java/lang/Object#clone()() ` Creates and returns a copy of this object. | | ` boolean` | ` https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) ` Indicates whether some other object is "equal to" this one. | | ` void` | ` https://developer.android.com/reference/java/lang/Object#finalize()() ` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object. | | ` final https://developer.android.com/reference/java/lang/Class<?>` | ` https://developer.android.com/reference/java/lang/Object#getClass()() ` Returns the runtime class of this `Object`. | | ` int` | ` https://developer.android.com/reference/java/lang/Object#hashCode()() ` Returns a hash code value for the object. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#notify()() ` Wakes up a single thread that is waiting on this object's monitor. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#notifyAll()() ` Wakes up all threads that are waiting on this object's monitor. | | ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/java/lang/Object#toString()() ` Returns a string representation of the object. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos) ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis) ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#wait()() ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*. | ||

## Constants

### PLAYBACK_STATE_BUFFERING

Added in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Also in [R Extensions 3](https://developer.android.com/sdkExtensions)

```
public static final int PLAYBACK_STATE_BUFFERING
```

Constant to notify that the playback is buffering

<br />

Constant Value:

1
(0x00000001)


### PLAYBACK_STATE_COMPLETED

Added in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Also in [R Extensions 3](https://developer.android.com/sdkExtensions)

```
public static final int PLAYBACK_STATE_COMPLETED
```

Constant to notify that the playback has completed

<br />

Constant Value:

5
(0x00000005)


### PLAYBACK_STATE_ERROR_PERMANENT_FAILURE

Added in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Also in [R Extensions 3](https://developer.android.com/sdkExtensions)

```
public static final int PLAYBACK_STATE_ERROR_PERMANENT_FAILURE
```

Constant to notify that the playback has failed with a permanent error.

<br />

Constant Value:

7
(0x00000007)


### PLAYBACK_STATE_ERROR_RETRIABLE_FAILURE

Added in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Also in [R Extensions 3](https://developer.android.com/sdkExtensions)

```
public static final int PLAYBACK_STATE_ERROR_RETRIABLE_FAILURE
```

Constant to notify that the playback has failed with a retriable error.

<br />

Constant Value:

6
(0x00000006)


### PLAYBACK_STATE_MEDIA_SIZE_CHANGED

Added in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Also in [R Extensions 3](https://developer.android.com/sdkExtensions)

```
public static final int PLAYBACK_STATE_MEDIA_SIZE_CHANGED
```

Constant to notify that the media size is first known or has changed.

Pass the width and height of the media as a `https://developer.android.com/reference/android/graphics/Point` inside the `https://developer.android.com/reference/android/os/Bundle` with
`https://developer.android.com/reference/android/content/ContentResolver#EXTRA_SIZE` as the key.

<br />

**See also:**

- `https://developer.android.com/reference/android/provider/CloudMediaProvider.CloudMediaSurfaceStateChangedCallback#setPlaybackState(int,%20int,%20android.os.Bundle)`
- `https://developer.android.com/reference/android/media/MediaPlayer.OnVideoSizeChangedListener#onVideoSizeChanged(android.media.MediaPlayer,%20int,%20int)`

Constant Value:

8
(0x00000008)


### PLAYBACK_STATE_PAUSED

Added in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Also in [R Extensions 3](https://developer.android.com/sdkExtensions)

```
public static final int PLAYBACK_STATE_PAUSED
```

Constant to notify that the playback is paused.

<br />

Constant Value:

4
(0x00000004)


### PLAYBACK_STATE_READY

Added in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Also in [R Extensions 3](https://developer.android.com/sdkExtensions)

```
public static final int PLAYBACK_STATE_READY
```

Constant to notify that the playback is ready to be played

<br />

Constant Value:

2
(0x00000002)


### PLAYBACK_STATE_STARTED

Added in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Also in [R Extensions 3](https://developer.android.com/sdkExtensions)

```
public static final int PLAYBACK_STATE_STARTED
```

Constant to notify that the playback has started

<br />

Constant Value:

3
(0x00000003)


## Public methods

### setPlaybackState

Added in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Also in [R Extensions 3](https://developer.android.com/sdkExtensions)

```
public void setPlaybackState (int surfaceId, 
                int playbackState, 
                Bundle playbackStateInfo)
```

This is called to notify playback state update for a `https://developer.android.com/reference/android/view/Surface`
on the picker launched via `https://developer.android.com/reference/android/provider/MediaStore#ACTION_PICK_IMAGES`.

<br />

| Parameters ||
|---|---|
| `surfaceId` | `int`: id which uniquely identifies a `https://developer.android.com/reference/android/view/Surface` <br /> |
| `playbackState` | `int`: playback state to notify picker about. Value is either `0` or a combination of the following: - `https://developer.android.com/reference/android/provider/CloudMediaProvider.CloudMediaSurfaceStateChangedCallback#PLAYBACK_STATE_BUFFERING` - `https://developer.android.com/reference/android/provider/CloudMediaProvider.CloudMediaSurfaceStateChangedCallback#PLAYBACK_STATE_READY` - `https://developer.android.com/reference/android/provider/CloudMediaProvider.CloudMediaSurfaceStateChangedCallback#PLAYBACK_STATE_STARTED` - `https://developer.android.com/reference/android/provider/CloudMediaProvider.CloudMediaSurfaceStateChangedCallback#PLAYBACK_STATE_PAUSED` - `https://developer.android.com/reference/android/provider/CloudMediaProvider.CloudMediaSurfaceStateChangedCallback#PLAYBACK_STATE_COMPLETED` - `https://developer.android.com/reference/android/provider/CloudMediaProvider.CloudMediaSurfaceStateChangedCallback#PLAYBACK_STATE_ERROR_RETRIABLE_FAILURE` - `https://developer.android.com/reference/android/provider/CloudMediaProvider.CloudMediaSurfaceStateChangedCallback#PLAYBACK_STATE_ERROR_PERMANENT_FAILURE` - `https://developer.android.com/reference/android/provider/CloudMediaProvider.CloudMediaSurfaceStateChangedCallback#PLAYBACK_STATE_MEDIA_SIZE_CHANGED` |
| `playbackStateInfo` | `Bundle`: `https://developer.android.com/reference/android/os/Bundle` which may contain extra information about the playback state, such as media size, progress/seek info or details about errors. This value may be `null`. <br /> |