# Action.SendMessages

# Action.SendMessages

Artifact:[androidx.media3:media3-test-utils](https://developer.android.com/jetpack/androidx/releases/media3)  
[View Source](https://cs.android.com/search?q=file:androidx/media3/test/utils/Action.java+class:androidx.media3.test.utils.Action.SendMessages)

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/media3/test/utils/Action.SendMessages "View this page in Java")

<br />

```
class Action.SendMessages : Action
```

<br />

|---|---|-------------------------------------------------------------------------------------------------------------------------------------------------|
| [kotlin.Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html)                                                                    |||
| ↳ | [androidx.media3.test.utils.Action](https://developer.android.com/reference/kotlin/androidx/media3/test/utils/Action)                              ||
|   | ↳ | [androidx.media3.test.utils.Action.SendMessages](https://developer.android.com/reference/kotlin/androidx/media3/test/utils/Action.SendMessages) |

*** ** * ** ***

Calls[createMessage](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer#createMessage(androidx.media3.exoplayer.PlayerMessage.Target))and[send](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/PlayerMessage#send()).

## Summary

|                                                                                                                                                                                                                                                                                                                                                                       ### Public constructors                                                                                                                                                                                                                                                                                                                                                                        |
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [SendMessages](https://developer.android.com/reference/kotlin/androidx/media3/test/utils/Action.SendMessages#SendMessages(java.lang.String,androidx.media3.exoplayer.PlayerMessage.Target,long))`(` ` tag: @`[Size](https://developer.android.com/reference/kotlin/androidx/annotation/Size)`(max = 23) `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`!,` ` target: `[PlayerMessage.Target](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/PlayerMessage.Target)`!,` ` positionMs: `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) `)`                                                                                                                                 |
| [SendMessages](https://developer.android.com/reference/kotlin/androidx/media3/test/utils/Action.SendMessages#SendMessages(java.lang.String,androidx.media3.exoplayer.PlayerMessage.Target,int,long,boolean))`(` ` tag: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`!,` ` target: `[PlayerMessage.Target](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/PlayerMessage.Target)`!,` ` mediaItemIndex: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`,` ` positionMs: `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)`,` ` deleteAfterDelivery: `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) `)` |

|                            ### Protected functions                            |
|-------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [doActionImpl](https://developer.android.com/reference/kotlin/androidx/media3/test/utils/Action.SendMessages#doActionImpl(androidx.media3.exoplayer.ExoPlayer,androidx.media3.exoplayer.trackselection.DefaultTrackSelector,android.view.Surface))`(` ` player: `[ExoPlayer](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer)`!,` ` trackSelector: `[DefaultTrackSelector](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/trackselection/DefaultTrackSelector)`!,` ` surface: `[Surface](https://developer.android.com/reference/android/view/Surface.html)`?` `)` Called by[doActionAndScheduleNextImpl](https://developer.android.com/reference/kotlin/androidx/media3/test/utils/Action#doActionAndScheduleNextImpl(androidx.media3.exoplayer.ExoPlayer,androidx.media3.exoplayer.trackselection.DefaultTrackSelector,android.view.Surface,androidx.media3.common.util.HandlerWrapper,androidx.media3.test.utils.ActionSchedule.ActionNode))to perform the action. |

## Public constructors

### SendMessages

```
SendMessages(
    tag: @Size(max = 23) String!,
    target: PlayerMessage.Target!,
    positionMs: Long
)
```  

|                                                                                        Parameters                                                                                        |
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------|
| `tag: @`[Size](https://developer.android.com/reference/kotlin/androidx/annotation/Size)`(max = 23) `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`!` | A tag to use for logging.                                          |
| `target: `[PlayerMessage.Target](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/PlayerMessage.Target)`!`                                                       | A message target.                                                  |
| `positionMs: `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)                                                                                              | The position at which the message should be sent, in milliseconds. |

### SendMessages

```
SendMessages(
    tag: String!,
    target: PlayerMessage.Target!,
    mediaItemIndex: Int,
    positionMs: Long,
    deleteAfterDelivery: Boolean
)
```  

|                                                             Parameters                                                             |
|------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `tag: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`!`                                        | A tag to use for logging.                                                                                                                                                                   |
| `target: `[PlayerMessage.Target](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/PlayerMessage.Target)`!` | A message target.                                                                                                                                                                           |
| `mediaItemIndex: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)                                      | The media item index at which the message should be sent, or[INDEX_UNSET](https://developer.android.com/reference/kotlin/androidx/media3/common/C#INDEX_UNSET())for the current media item. |
| `positionMs: `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)                                        | The position at which the message should be sent, in milliseconds.                                                                                                                          |
| `deleteAfterDelivery: `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)                         | Whether the message will be deleted after delivery.                                                                                                                                         |

## Protected functions

### doActionImpl

```
protected fun doActionImpl(
    player: ExoPlayer!,
    trackSelector: DefaultTrackSelector!,
    surface: Surface?
): Unit
```

Called by[doActionAndScheduleNextImpl](https://developer.android.com/reference/kotlin/androidx/media3/test/utils/Action#doActionAndScheduleNextImpl(androidx.media3.exoplayer.ExoPlayer,androidx.media3.exoplayer.trackselection.DefaultTrackSelector,android.view.Surface,androidx.media3.common.util.HandlerWrapper,androidx.media3.test.utils.ActionSchedule.ActionNode))to perform the action.  

|                                                                        Parameters                                                                        |
|----------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------|
| `player: `[ExoPlayer](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer)`!`                                             | The player to which the action should be applied.                          |
| `trackSelector: `[DefaultTrackSelector](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/trackselection/DefaultTrackSelector)`!` | The track selector to which the action should be applied.                  |
| `surface: `[Surface](https://developer.android.com/reference/android/view/Surface.html)`?`                                                               | The surface to use when applying actions, or`null`if no surface is needed. |