Skip to content

Commit

Permalink
Support the iOS17 event to:
Browse files Browse the repository at this point in the history
onAccessLogEntryNotification &  onErrorLogEntryNotification
update the pod version to 3.28.1
  • Loading branch information
imberezin committed Jan 22, 2024
1 parent 0875231 commit 5f2d3e9
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
15 changes: 13 additions & 2 deletions Classes/Player/AVPlayerEngine/AVPlayerEngine+Observation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,19 @@ extension AVPlayerEngine {

NotificationCenter.default.addObserver(self, selector: #selector(self.didFailToPlayToEndTime(_:)), name: .AVPlayerItemFailedToPlayToEndTime, object: self.currentItem)
NotificationCenter.default.addObserver(self, selector: #selector(self.didPlayToEndTime(_:)), name: .AVPlayerItemDidPlayToEndTime, object: self.currentItem)
NotificationCenter.default.addObserver(self, selector: #selector(self.onAccessLogEntryNotification), name: .AVPlayerItemNewAccessLogEntry, object: self.currentItem)
NotificationCenter.default.addObserver(self, selector: #selector(self.onErrorLogEntryNotification), name: .AVPlayerItemNewErrorLogEntry, object: self.currentItem)
NotificationCenter.default.addObserver(self, selector: #selector(self.onPlaybackStalledNotification), name: .AVPlayerItemPlaybackStalled, object: self.currentItem)
NotificationCenter.default.addObserver(self, selector: #selector(self.timebaseChanged), name: Notification.Name(kCMTimebaseNotification_EffectiveRateChanged as String), object: nil)
if #available(iOS 17.0, *) {
// On iOS, this branch runs in versions 17.0 and greater.
NotificationCenter.default.addObserver(self, selector: #selector(self.onAccessLogEntryNotification), name: AVPlayerItem.newAccessLogEntryNotification, object: self.currentItem)
NotificationCenter.default.addObserver(self, selector: #selector(self.onErrorLogEntryNotification), name: AVPlayerItem.newErrorLogEntryNotification, object: self.currentItem)
} else {
// This branch runs in earlier iOS versions.
NotificationCenter.default.addObserver(self, selector: #selector(self.onAccessLogEntryNotification), name: .AVPlayerItemNewAccessLogEntry, object: self.currentItem)
NotificationCenter.default.addObserver(self, selector: #selector(self.onErrorLogEntryNotification), name: .AVPlayerItemNewErrorLogEntry, object: self.currentItem)

}

}

func removeObservers() {
Expand All @@ -66,6 +75,8 @@ extension AVPlayerEngine {
NotificationCenter.default.removeObserver(self, name: .AVPlayerItemNewErrorLogEntry, object: self.currentItem)
NotificationCenter.default.removeObserver(self, name: .AVPlayerItemPlaybackStalled, object: self.currentItem)
NotificationCenter.default.removeObserver(self, name: Notification.Name(kCMTimebaseNotification_EffectiveRateChanged as String), object: nil)
NotificationCenter.default.removeObserver(self, name: AVPlayerItem.newAccessLogEntryNotification, object: self.currentItem)
NotificationCenter.default.removeObserver(self, name: AVPlayerItem.newErrorLogEntryNotification, object: self.currentItem)
}

@objc func onAccessLogEntryNotification(notification: Notification) {
Expand Down
2 changes: 1 addition & 1 deletion PlayKit.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ suffix = '.0000' # Dev mode
Pod::Spec.new do |s|

s.name = 'PlayKit'
s.version = '3.28.0' + suffix
s.version = '3.28.1' + suffix
s.summary = 'PlayKit: Kaltura Mobile Player SDK - iOS'
s.homepage = 'https://github.com/kaltura/playkit-ios'
s.license = { :type => 'AGPLv3', :text => 'AGPLv3' }
Expand Down

0 comments on commit 5f2d3e9

Please sign in to comment.