VKPlayerView

@objcMembers
public class VKPlayerView : UIView
extension VKPlayerView: AVAssetResourceLoaderDelegate

Public properties

  • Declaration

    Swift

    public weak var delegate: VKPlayerViewDelegate?
  • Indicates the current state of the player. This property is read only and can be observed via KVO.

    Declaration

    Swift

    public var playState: VKPlayState { get }
  • Indicates how video will occupy it’s place.

    Declaration

    Swift

    public var aspectMode: VKAspectMode { get set }
  • Indicates preferred video resolution to use for playback. If nothing is set player will choose resolution in accordance with current connection bandwidth.

    Declaration

    Swift

    public var preferredVideoResolution: VKVideoResolution? { get set }
  • Indicates whether player should loop video

    Declaration

    Swift

    public var loop: Bool
  • Indicates whether player is muted

    Declaration

    Swift

    public var muted: Bool { get set }
  • Indicates the current time position of the player. This property is read only and can be observed via KVO.

    Declaration

    Swift

    public var currentTime: TimeInterval { get }
  • The duration of the current playing item. If there’s no item to be played the value is 0.

    Declaration

    Swift

    public var duration: TimeInterval { get }
  • The current video of the player.

    Declaration

    Swift

    fileprivate(set) public var video: VKVideo? { get }
  • Indicates whether the current video is ready to play

    Declaration

    Swift

    fileprivate(set) public var isReadyToPlay: Bool { get }

Initialization

  • Declaration

    Swift

    required public init?(coder aDecoder: NSCoder)
  • Declaration

    Swift

    public override func updateConstraints()

Public methods

  • Reset player to initial state

    Declaration

    Swift

    public func reset()
  • Sets the player to a particular video object without playing it just yet. It will begin to preload the video.

    Declaration

    Swift

    public func set(video: VKVideo)

    Parameters

    video

    The video object to set to.

  • Play the video object.

    Declaration

    Swift

    public func play(video: VKVideo)

    Parameters

    video

    The video object to play.

  • Play the current video.

    Declaration

    Swift

    public func play()
  • Pause playback the current video.

    Declaration

    Swift

    public func pause()
  • Stop playback of the current video and set playback position to the beginning.

    Declaration

    Swift

    public func stop()
  • Move the current play position to a different time position

    Declaration

    Swift

    public func seek(to: TimeInterval)

    Parameters

    to

    The time position to move to.

Private methods