ApiRTC iOS SDK Documentation

Class Video​View

open class VideoView: UIView  

Ready view handling WebRTC video stream

VideoView VideoView RTCVideoViewDelegate RTCVideoViewDelegate VideoView->RTCVideoViewDelegate UIView UIView VideoView->UIView Descriptable Descriptable VideoView->Descriptable

Conforms To

RTCVideoViewDelegate
UIView

Initializers

init(frame:​renderer:​)

public init(frame: CGRect, renderer: RendererType)  

init?(coder:​)

required public init?(coder aDecoder: NSCoder)  

Properties

renderer

open var renderer: RTCVideoRenderer  

renderer​Type

open private(set) var rendererType: RendererType! 

content​Mode

open override var contentMode: UIView.ContentMode  

only .scaleAspectFit & scaleAspectFill have an effect

frame

open override var frame: CGRect  

video​Size

open private(set) var videoSize  

Currently rendering video size

layout​OnVideo​Size​Change

open var layoutOnVideoSizeChange = true

Turns on/off automatic layou update on video size change

is​Content​Mode​Switchable

open var isContentModeSwitchable: Bool  

True if .scaleAspectFill renderer rect differs from .scaleAspectFit rect

Methods

layout​Subviews()

open override func layoutSubviews()  

on​Video​Size​Change(_:​)

open func onVideoSizeChange(_ onVideoSizeChange: @escaping ((_ size: CGSize) -> Void))  

Fired on video size changing

take​Snapshot(rect:​)

open func takeSnapshot(rect: CGRect? = nil) -> UIImage?  

Takes snapshot from area with desired rect

video​View(_:​did​Change​Video​Size:​)

public func videoView(_ videoView: RTCVideoRenderer, didChangeVideoSize size: CGSize)