Skip to content

Commit

Permalink
Player, add additional property
Browse files Browse the repository at this point in the history
  • Loading branch information
piemonte committed Jan 12, 2020
1 parent 4610433 commit b09095b
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions Sources/Player.swift
Original file line number Diff line number Diff line change
Expand Up @@ -271,8 +271,8 @@ open class Player: UIViewController {
}
}

/// Media playback's current time.
open var currentTime: TimeInterval {
/// Media playback's current time interval in seconds.
open var currentTimeInterval: TimeInterval {
get {
if let playerItem = self._playerItem {
return CMTimeGetSeconds(playerItem.currentTime())
Expand All @@ -281,6 +281,17 @@ open class Player: UIViewController {
}
}
}

/// Media playback's current time.
open var currentTime: CMTime {
get {
if let playerItem = self._playerItem {
return playerItem.currentTime()
} else {
return CMTime.indefinite
}
}
}

/// The natural dimensions of the media.
open var naturalSize: CGSize {
Expand Down

0 comments on commit b09095b

Please sign in to comment.