---
title: "setStartTime(_:for:)"
framework: mediaplayer
role: symbol
role_heading: Instance Method
path: "mediaplayer/mpmusicplayermediaitemqueuedescriptor/setstarttime(_:for:)"
---

# setStartTime(_:for:)

The time the designated media item is to start playing.

## Declaration

```swift
func setStartTime(_ startTime: TimeInterval, for mediaItem: MPMediaItem)
```

## Parameters

- `startTime`: The doc://com.apple.documentation/documentation/Foundation/TimeInterval describing when the media item starts playing.
- `mediaItem`: The media item in the queue that has a changed start time.

## See Also

### Setting start and end times

- [setEndTime(_:for:)](mediaplayer/mpmusicplayermediaitemqueuedescriptor/setendtime(_:for:).md)
