Minor performance improvement

This commit is contained in:
Arkadiusz Fal
2023-05-16 18:51:07 +02:00
parent 7972498f2c
commit 5d8e8483d1
3 changed files with 16 additions and 8 deletions

View File

@@ -459,12 +459,16 @@ final class PlayerModel: ObservableObject {
return
}
streamSelection = stream
playStream(
stream,
of: currentVideo,
preservingTime: !currentItem.playbackTime.isNil
)
DispatchQueue.global(qos: .userInitiated).async {
DispatchQueue.main.async {
self.streamSelection = stream
}
self.playStream(
stream,
of: currentVideo,
preservingTime: !self.currentItem.playbackTime.isNil
)
}
}
private func handlePresentationChange() {