Created
April 21, 2019 12:22
-
-
Save konnnn/1aacb76508c90e7d709db758c9784681 to your computer and use it in GitHub Desktop.
Check if AVPlayer is currently playing an item
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
import AVFoundation | |
extension AVPlayer { | |
var isPlaying: Bool { | |
return (self.player.rate != 0 && self.player.error == nil) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment