VKLiveStream

@objc
public class VKLiveStream : NSObject
extension VKLiveStream: RTMPStreamDelegate
extension VKLiveStream: RPBroadcastActivityViewControllerDelegate
extension VKLiveStream: RPBroadcastControllerDelegate

VKLiveStream is a handler to host and join live streams streaming from the device camera.

  • Declaration

    Swift

    @objc
    public static let shared: VKLiveStream

Stream Configuration

Stream Variables

  • The current active stream that was joined. This could be a hosted or joined stream and is usually the VideoKit Api Stream response.

    Declaration

    Swift

    public var currentStream: VKStream? { get }
  • RTMP Streamer (Available only in standard and lowLatency mode)

    Declaration

    Swift

    public var rtmpStreamer: VKRTMPStreamer?
  • WebRTC Streamer (Available only in ultra low latency mode)

    Declaration

    Swift

    public var webRtcStreamer: VKWebRTCStreamer?
  • Current Streaming State

    Declaration

    Swift

    public var state: VKLiveStreamState

Stream Hosting Features

  • Host a new live stream Parameters:

    • typpe: VKStreamProfile (.standard, .liveTranscribe, .lowLatency, .webrtc)
    • view: UIView to preview your capture stream

    Declaration

    Swift

    public func host(type: VKStreamProfile, inView view: UIView? = nil, completion: @escaping (VKStream?, Error?) -> Void)
  • Stops a specific stream. Parameters:

    • stream: VKStream - The stream that should be ended

    Declaration

    Swift

    public func stopHosting(stream: VKStream, completion: @escaping (Bool) -> Void)
  • Stop host stream which is currently active. Parameters:

    • stream: VKStream - The stream that should be ended

    Declaration

    Swift

    public func stopActiveHostingStream(completion: @escaping (Bool) -> Void)
  • Register Video effect on hosting stream. Please note you can only add effects when hosting a stream. Parameters:

    • effect: VideoEffect

    Declaration

    Swift

    public func registerVideoEffect(effect: VKVideoEffect)
  • Unregister Video effect on hosting stream Parameters:

    • effect: VideoEffect

    Declaration

    Swift

    public func unregisterVideoEffect(effect: VKVideoEffect)
  • Register Audio effect on hosting stream. Please note you can only add effects when hosting a stream. Parameters:

    • effect: VideoEffect

    Declaration

    Swift

    public func registerAudioEffect(effect: VKAudioEffect)
  • Unregister Audio effect on hosting stream Parameters:

    • effect: VideoEffect

    Declaration

    Swift

    public func unregisterAudioEffect(effect: VKAudioEffect)

Stream Participant Features

  • Join live stream by VKStream Parameters:

    • stream: VKStream - The stream to join
    • view: UIView - The View that the video stream should appear in

    Declaration

    Swift

    public func join(stream: VKStream, inView view: UIView)
  • Join live stream by stream id Parameters:

    • streamId: String - The stream id to join. Make sure you are providing a stream that is active.
    • view: UIView - The View that the video stream should appear in

    Declaration

    Swift

    public func join(streamId: String, inView view: UIView, completion: @escaping (VKStream?, Error?) -> Void)

RTMPStreamDelegate