---
title: "setEndTime(_:forItemWith:)"
framework: mediaplayer
role: symbol
role_heading: Instance Method
path: "mediaplayer/mpmusicplayerplayparametersqueuedescriptor/setendtime(_:foritemwith:)"
---

# setEndTime(_:forItemWith:)

Sets the time the item with the associated play parameters is to stop playing.

## Declaration

```swift
func setEndTime(_ endTime: TimeInterval, forItemWith playParameters: MPMusicPlayerPlayParameters)
```

## Parameters

- `endTime`: The doc://com.apple.documentation/documentation/Foundation/TimeInterval describing when the item with designated play parameters stops playing.
- `playParameters`: The play parameters associated with the item in the queue that has a changed end time.

## See Also

### Setting start and end times

- [setStartTime(_:forItemWith:)](mediaplayer/mpmusicplayerplayparametersqueuedescriptor/setstarttime(_:foritemwith:).md)
