Skip to content

Commit

Permalink
player, add property to determine if playback is video or audio
Browse files Browse the repository at this point in the history
  • Loading branch information
piemonte committed Jan 10, 2020
1 parent 4d30ae9 commit 9447176
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Sources/Player.swift
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,15 @@ open class Player: UIViewController {
open var playbackResumesWhenEnteringForeground: Bool = true

// state

open var isCurrentPlaybackVideo: Bool {
get {
guard let asset = self._asset else {
return false
}
return asset.tracks(withMediaType: .video).count != 0
}
}

/// Playback automatically loops continuously when true.
open var playbackLoops: Bool {
Expand Down

0 comments on commit 9447176

Please sign in to comment.