Skip to content

Commit

Permalink
add setSeconds
Browse files Browse the repository at this point in the history
  • Loading branch information
LePips committed Sep 18, 2022
1 parent d8eb3d2 commit d666f30
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Sources/VLCUI/UIVLCVideoPlayerViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,12 @@ public extension UIVLCVideoPlayerViewController {
self.shrinkScreen()
}
case let .setTicks(ticks):
assert(ticks >= 0 && ticks <= media.length.intValue)
assert(ticks >= 0 && ticks <= media.length.intValue, "Given ticks not in range of media length")
self.mediaPlayer.time = VLCTime(int: ticks)
case let .setSeconds(seconds):
let tickSeconds = seconds * 1000
assert(tickSeconds >= 0 && tickSeconds <= media.length.intValue, "Given seconds not in range of media length")
self.mediaPlayer.time = VLCTime(int: tickSeconds)
case let .setSubtitleSize(size):
self.mediaPlayer.setSubtitleSize(size)
case let .setSubtitleFont(fontName):
Expand Down
3 changes: 3 additions & 0 deletions Sources/VLCUI/VLCVideoPlayer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ public struct VLCVideoPlayer: UIViewControllerRepresentable {
/// Set the player ticks
case setTicks(Int32)

/// Set the player seconds
case setSeconds(Int32)

/// Set the media subtitle size
///
/// **Note**: Due to VLCKit, a given size does not accurately represent a font size and magnitudes are inverted.
Expand Down

0 comments on commit d666f30

Please sign in to comment.