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
-
Declaration
Swift
public var sessionPreset: AVCaptureSession.Preset
-
Declaration
Swift
public var fps: Int
-
Type of streaming your are performing
Declaration
Swift
public var streamingMode: VKLiveStreamingMode
-
Declaration
Swift
public var broadcastExtensionBundleIdentifier: String
-
Declaration
Swift
public var broadcastExtensionSetupUIBundleIdentifier: String
-
Declaration
Swift
public var continuousExposure: Bool
-
Should camera try to continuously auto focus?
Declaration
Swift
public var continuousAutofocus: Bool
-
Video Orientation. Portrait sets width and height to 720x1280, Landscape is going to be 1280x720.
Declaration
Swift
public var orientation: VKLiveStreamOrientation { get set }
-
Mute audio for your stream
Declaration
Swift
public var audioMuted: Bool { get set }
-
Video stabilization mode (Check https://developer.apple.com/documentation/avfoundation/avcapturevideostabilizationmode for more information)
Declaration
Swift
public var videoStabilizationMode: AVCaptureVideoStabilizationMode
-
Camera position for streaming (Check https://developer.apple.com/documentation/avfoundation/avcapturedevice/position for more information)
Declaration
Swift
public var cameraPosition: AVCaptureDevice.Position
-
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
-
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)
-
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)
-
Declaration
Swift
public func rtmpStream(_ stream: RTMPStream, didPublishInsufficientBW connection: RTMPConnection)
-
Declaration
Swift
public func rtmpStream(_ stream: RTMPStream, didPublishSufficientBW connection: RTMPConnection)
-
Declaration
Swift
public func rtmpStream(_ stream: RTMPStream, didOutput audio: AVAudioBuffer, presentationTimeStamp: CMTime)
-
Declaration
Swift
public func rtmpStream(_ stream: RTMPStream, didOutput video: CMSampleBuffer)
-
Declaration
Swift
public func rtmpStream(_ stream: RTMPStream, didStatics connection: RTMPConnection)
-
Declaration
Swift
public func rtmpStreamDidClear(_ stream: RTMPStream)
-
Declaration
Swift
public func broadcastActivityViewController(_ broadcastActivityViewController: RPBroadcastActivityViewController, didFinishWith broadcastController: RPBroadcastController?, error: Error?)
-
Declaration
Swift
public func broadcastController(_ broadcastController: RPBroadcastController, didFinishWithError error: Error?)
-
Declaration
Swift
public func broadcastController(_ broadcastController: RPBroadcastController, didUpdateServiceInfo serviceInfo: [String : NSCoding & NSObjectProtocol])
-
Declaration
Swift
public func broadcastController(_ broadcastController: RPBroadcastController, didUpdateBroadcast broadcastURL: URL)