diff --git a/SwiftAudioEx/Classes/Observer/AVPlayerItemObserver.swift b/SwiftAudioEx/Classes/Observer/AVPlayerItemObserver.swift index 9736cf7..2ec14d9 100644 --- a/SwiftAudioEx/Classes/Observer/AVPlayerItemObserver.swift +++ b/SwiftAudioEx/Classes/Observer/AVPlayerItemObserver.swift @@ -114,6 +114,9 @@ class AVPlayerItemObserver: NSObject { extension AVPlayerItemObserver: AVPlayerItemMetadataOutputPushDelegate { func metadataOutput(_ output: AVPlayerItemMetadataOutput, didOutputTimedMetadataGroups groups: [AVTimedMetadataGroup], from track: AVPlayerItemTrack?) { - delegate?.item(didReceiveTimedMetadata: groups) + let groupsWithMetadata = groups.filter { !$0.items.isEmpty } + if !groupsWithMetadata.isEmpty { + delegate?.item(didReceiveTimedMetadata: groupsWithMetadata) + } } }