Skip to main content

VideoPlaybackControlView

A view that shows playback controls and timeline for the given player.

open class VideoPlaybackControlView: _View, ThemeProvider 

Inheritance

_View, ThemeProvider

Properties

content

A content displayed by the view.

open var content: Content = .initial 

player

A player the view listens to.

open weak var player: AVPlayer? 

loadingIndicator

A loading indicator that is visible when video is loading.

open private(set) lazy var loadingIndicator: ChatLoadingIndicator = components
.loadingIndicator.init()
.withoutAutoresizingMaskConstraints

playPauseButton

A playback control button.

open private(set) lazy var playPauseButton: UIButton = UIButton()
.withoutAutoresizingMaskConstraints

timestampLabel

A label displaying the current time position.

open private(set) lazy var timestampLabel: UILabel = UILabel()
.withoutAutoresizingMaskConstraints
.withAdjustingFontForContentSizeCategory
.withBidirectionalLanguagesSupport

durationLabel

A label displaying the overall video duration.

open private(set) lazy var durationLabel: UILabel = UILabel()
.withoutAutoresizingMaskConstraints
.withAdjustingFontForContentSizeCategory
.withBidirectionalLanguagesSupport

timeSlider

A slider used to show a timeline.

open private(set) lazy var timeSlider: UISlider = UISlider()
.withoutAutoresizingMaskConstraints

rootContainer

A container for playback button and time labels.

open private(set) lazy var rootContainer: ContainerStackView = ContainerStackView(axis: .vertical)
.withoutAutoresizingMaskConstraints

Methods

setUp()

override open func setUp() 

setUpLayout()

override open func setUpLayout() 

setUpAppearance()

override open func setUpAppearance() 

updateContent()

override open func updateContent() 

timeSliderDidChange(_:event:)

Is invoked when time slider changes the value.

@objc open func timeSliderDidChange(_ sender: UISlider, event: UIEvent) 

handleItemDidPlayToEndTime(_:)

Is invoked when current track reached the end.

@objc open func handleItemDidPlayToEndTime(_ notification: NSNotification) 

handleTapOnPlayPauseButton()

Is invoked when playback button is touched up inside.

@objc open func handleTapOnPlayPauseButton() 

unsubscribeFromPlayerNotifications(_:)

Unsubscribes from all notifications. Is invoked with old player when new player is set or when current view is deallocated.

open func unsubscribeFromPlayerNotifications(_ player: AVPlayer?) 

subscribeToPlayerNotifications()

Unsubscribes to current player notifications. Is invoked when new player is set.

open func subscribeToPlayerNotifications() 

Did you find this page helpful?