Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion Sources/VLCUI/UIVLCVideoPlayerView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,9 @@ extension UIVLCVideoPlayerView: VLCMediaPlayerDelegate {

private func setConfigurationValues(with player: VLCMediaPlayer, from configuration: VLCVideoPlayer.Configuration) {

player.time = VLCTime(int: configuration.startTime.asTicks.asInt32)
if !configuration.skipInitialTimeSet {
player.time = VLCTime(int: configuration.startTime.asTicks.asInt32)
}

let defaultPlayerSpeed = player.rate(from: configuration.rate)
player.fastForward(atRate: defaultPlayerSpeed)
Expand Down
8 changes: 8 additions & 0 deletions Sources/VLCUI/VLCVideoPlayer/Configuration.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,14 @@ public extension VLCVideoPlayer {
public var subtitleColor: ValueSelector<_PlatformColor> = .auto
public var playbackChildren: [PlaybackChild] = []
public var options: [String: Any] = [:]
/// When `true`, the initial `player.time` assignment in
/// `setConfigurationValues` is skipped.
///
/// Use this for live streams where an explicit seek — even to the
/// current position — causes VLC to flush its buffers and re-acquire
/// the stream, resulting in long rebuffering delays or loss of the
/// live-edge position.
public var skipInitialTimeSet: Bool = false

public init(url: URL) {
self.url = url
Expand Down