speeding up listening to audio

This commit is contained in:
talksik
2021-12-25 23:15:35 -08:00
parent ee4cedf986
commit b1a22b715b
2 changed files with 17 additions and 17 deletions
@@ -432,22 +432,22 @@ extension CircleGridView {
print("player queued up items!!!")
// notify every half second
let timeScale = CMTimeScale(NSEC_PER_SEC)
let time = CMTime(seconds: 0.5, preferredTimescale: timeScale)
// let timeScale = CMTimeScale(NSEC_PER_SEC)
// let time = CMTime(seconds: 0.5, preferredTimescale: timeScale)
timeObserverToken = queuePlayer.addPeriodicTimeObserver(forInterval: time, queue: .main) {time in
// update player transport UI
print("periodic time observer: \(time)")
// if the current playeritem is the latest one:
// 1. deselect this user
// 2. update databse that I listened to this
if queuePlayer.currentItem == AVPlayerItems.last {
// hide the footer now...ehhh don't need to
// DispatchQueue.main.asyncAfter(deadline: .now() + 2) {
// self.selectedFriendIndex = nil
// }
}
}
// timeObserverToken = queuePlayer.addPeriodicTimeObserver(forInterval: time, queue: .main) {time in
// // update player transport UI
// print("periodic time observer: \(time)")
// // if the current playeritem is the latest one:
// // 1. deselect this user
// // 2. update databse that I listened to this
// if queuePlayer.currentItem == AVPlayerItems.last {
// // hide the footer now...ehhh don't need to
//// DispatchQueue.main.asyncAfter(deadline: .now() + 2) {
//// self.selectedFriendIndex = nil
//// }
// }
// }
// TODO: right now not updating all of that
// update the listencount and firstlistentimestamp of those messages in firestore