Post

Replies

Boosts

Views

Activity

Reply to MusicKit swift start / end times
Bump! I'm having the same issue. I've tried countless variations of this, but they all suffer from the same issue. This also affects the play button in the apple music app, after attempting to set the queue with an entry that has a defined startTime, the play button changes the player state as follows. LOG New Playback State: {"playbackStatus": "paused", "playbackTime": 20, "title": "Tangerine"} LOG New Playback State: {"playbackStatus": "playing", "playbackTime": 20.000288009643555, "title": "Tangerine"} LOG New Playback State: {"playbackStatus": "stopped", "playbackTime": 20.000307083129883, "title": "Tangerine"} LOG New Playback State: {"playbackStatus": "paused", "playbackTime": 20, "title": "Tangerine"} The Code let musicItemId = MusicItemID.init(itemId) let request = MusicCatalogResourceRequest<Song>(matching: \.id, equalTo: musicItemId) let response = try await request.response() let player = SystemMusicPlayer.shared guard let playableMusicItem = response.items.first else { return } let queueEntry = MusicPlayer.Queue.Entry(playableMusicItem, startTime: 25.0, endTime: 35.0) let queue = MusicPlayer.Queue.init([queueEntry]) player.queue = queue try await player.prepareToPlay()
Topic: Media Technologies SubTopic: General Tags:
May ’24