Menu

Expand
Rate this page:

Migrating from 2.x to 3.x - iOS

This page is for reference only. We are no longer onboarding new customers to Programmable Video. Existing customers can continue to use the product until December 5, 2024.

We recommend migrating your application to the API provided by our preferred video partner, Zoom. We've prepared this migration guide to assist you in minimizing any service disruption.

This guide provides an introduction to the 3.x Programmable Video iOS SDK and a set of guidelines to migrate an application from 2.x to 3.x.

Programming Model

The programming model has not changed from 2.x to 3.x. Refer to our 2.x migration guide for a refresher on the Video iOS SDK models.

Xcode and iOS Version Support

Twilio Video 3.x is built with Xcode 11 and officially adds support for iOS 13 and iPadOS 13 APIs. The framework can be consumed with previous versions of Xcode. However, re-compiling Bitcode when exporting for Ad Hoc or Enterprise distribution requires the use of Xcode 11.x. 3.0 also removes support for iOS 9 and iOS 10, and raises the minimum supported iOS version to 11.0.

If your application's Deployment Target was previously set to iOS 10.3 or earlier, you will need to update it to 11.0 or greater to use the 3.x SDK.

Region Selection

The SDK uses a new WebSocket based signaling transport, and communicates with globally available signaling Servers over IPv4 and IPv6 networks. The TVIConnectOptions.region property has been added which allows you to specify the region of the signaling server. By default, the Client will connect to the nearest signaling Server determined by latency based routing. Setting a value other than "gll" bypasses routing and guarantees that signaling traffic will be terminated in the region that you prefer.

let connectOptions = ConnectOptions(token: accessToken) { (builder) in
    builder.region = "us1"
    builder.roomName = "my-room"
}
self.room = TwilioVideoSDK.connect(with: connectOptions, delegate: self)

If you were previously allowing traffic to signaling servers by IP address you will now need to allow the FQDN for the region that you are connecting to instead. See the Signaling Communication section of the Video IP Addresses guide for more information.

Access Tokens

With this new WebSocket based signaling transport, some modifications may need to be made to the Access Tokens that you generate. Specifically:

  • Ensure that the AccessToken does not contain a configuration profile sid. Configuration profiles were previously deprecated and are no longer supported.
  • Set the Time-To-Live (TTL) of your AccessToken to the maximum allowed session duration, currently 14400 seconds (4 hours). This ensures that when a network loss occurs the client will be able to re-authenticate the reconnection. Note, a reconnection attempt with an expired AccessToken will result in an AccessTokenExpiredError.

TVICameraSource Orientation Tracking Changes

With support for iOS 13, we now have the ability to monitor UIWindowScene based notifications, for determining the orientation of the camera for capture and preview. The TVICameraSourceOrientationTracker protocol has been added and TVICameraSourceOptionsBuilder has a new property, orientationTracker which allows you to adopt this method of tracking.

To opt into tracking based on the rotation of a UIWindowScene you must provide the scene to track when creating the TVICameraSourceOptions.

// Track the orientation of the key window's scene.
let options = CameraSourceOptions { (builder) in
    if let keyScene = UIApplication.shared.keyWindow?.windowScene {
        builder.orientationTracker = UserInterfaceTracker(scene: keyScene)
    }
}
let camera = CameraSource(options: options, delegate: self)

You will also need to forward UIWindowScene events from your UIWindowSceneDelegate to keep TVIUserInterfaceTracker up to date as the scene changes.

// Forward UIWindowScene events
func windowScene(_ windowScene: UIWindowScene,
                 didUpdate previousCoordinateSpace: UICoordinateSpace,
                 interfaceOrientation previousInterfaceOrientation: UIInterfaceOrientation,
                 traitCollection previousTraitCollection: UITraitCollection) {
    UserInterfaceTracker.sceneInterfaceOrientationDidChange(windowScene)
}

Removal of Deprecated Items

The deprecated TVIVideoCapturer APIs have been removed:

  • TVIVideoCapturer
  • TVICameraCapturer
  • TVIScreenCapturer
  • TVIVideoConstraints
  • TVILocalVideoTrack.capturer
  • TVILocalVideoTrack.constraints
  • TVILocalVideoTrack.trackWithCapturer:
  • TVILocalVideoTrack.trackWithCapturer:enabled:constraints:name:

Refer to our Video Source APIs document for more information on working with the Video Source APIs introduced in 2.6.0.

The TVIAudioOptions that are no longer supported by WebRTC have been removed.

  • TVIAudioOptions.levelControl
  • TVIAudioOptions.levelControlInitialPeakLevelDBFS
  • TVIAudioOptionsBuilder.levelControl
  • TVIAudioOptionsBuilder.levelControlInitialPeakLevelDBFS

The TVIAudioSessionActivated() and TVIAudioSessionDeactivated() methods have been removed as the Video SDK no longer needs to terminate the signaling connection when an application is backgrounded.

The TVIVideoRenderer.optionalPixelFormats property has been removed. TVIVideoRenderer is expected to deal with video in any of the valid TVIPixelFormats. If the renderer cannot handle a frame it should drop that frame. There will be no more automatic conversion to I420 for renderers that do not support a particular format.

Improved Objective-C API

In 3.x we have refactored the TVILocalParticipantDelegate and TVIRemoteParticipantDelegate methods to be consistent with the did naming convention used in the Swift APIs. Listed below are the changes to the Objective-C APIs:

TwilioVideoSDK

New +[TwilioVideoSDK sdkVersion]
Previous +[TwilioVideo version]

TVILocalParticipantDelegate

New -[TVILocalParticipantDelegate localParticipant:didPublishAudioTrack:]
Previous -[TVILocalParticipantDelegate localParticipant:publishedAudioTrack:]
New -[TVILocalParticipantDelegate localParticipant:didFailToPublishAudioTrack:withError:]
Previous -[TVILocalParticipantDelegate localParticipant:failedToPublishAudioTrack:withError:]
New -[TVILocalParticipantDelegate localParticipant:didPublishDataTrack:]
Previous -[TVILocalParticipantDelegate localParticipant:publishedDataTrack:]
New -[TVILocalParticipantDelegate localParticipant:didFailToPublishDataTrack:withError:]
Previous -[TVILocalParticipantDelegate localParticipant:failedToPublishDataTrack:withError:]
New -[TVILocalParticipantDelegate localParticipant:didPublishVideoTrack:]
Previous -[TVILocalParticipantDelegate localParticipant:publishedVideoTrack:]
New -[TVILocalParticipantDelegate localParticipant:didFailToPublishVideoTrack:withError:]
Previous -[TVILocalParticipantDelegate localParticipant:failedToPublishVideoTrack:withError:]

TVIRemoteParticipantDelegate

New -[TVIRemoteParticipantDelegate remoteParticipant:didPublishVideoTrack:]
Previous -[TVIRemoteParticipantDelegate remoteParticipant:publishedVideoTrack:]
New -[TVIRemoteParticipantDelegate remoteParticipant:didUnpublishVideoTrack:]
Previous -[TVIRemoteParticipantDelegate remoteParticipant:unpublishedVideoTrack:]
New -[TVIRemoteParticipantDelegate remoteParticipant:didPublishAudioTrack:]
Previous -[TVIRemoteParticipantDelegate remoteParticipant:publishedAudioTrack:]
New -[TVIRemoteParticipantDelegate remoteParticipant:didUnpublishAudioTrack:]
Previous -[TVIRemoteParticipantDelegate remoteParticipant:unpublishedAudioTrack:]
New -[TVIRemoteParticipantDelegate remoteParticipant:didPublishDataTrack:]
Previous -[TVIRemoteParticipantDelegate remoteParticipant:publishedDataTrack:]
New -[TVIRemoteParticipantDelegate remoteParticipant:didUnpublishDataTrack:]
Previous -[TVIRemoteParticipantDelegate remoteParticipant:unpublishedDataTrack:]
New -[TVIRemoteParticipantDelegate remoteParticipant:didEnableVideoTrack:]
Previous -[TVIRemoteParticipantDelegate remoteParticipant:enabledVideoTrack:]
New -[TVIRemoteParticipantDelegate remoteParticipant:didDisableVideoTrack:]
Previous -[TVIRemoteParticipantDelegate remoteParticipant:disabledVideoTrack:]
New -[TVIRemoteParticipantDelegate remoteParticipant:didEnableAudioTrack:]
Previous -[TVIRemoteParticipantDelegate remoteParticipant:enabledAudioTrack:]
New -[TVIRemoteParticipantDelegate remoteParticipant:didDisableAudioTrack:]
Previous -[TVIRemoteParticipantDelegate remoteParticipant:disabledAudioTrack:]
New -[TVIRemoteParticipantDelegate didSubscribeToVideoTrack:publication:forParticipant:]
Previous -[TVIRemoteParticipantDelegate subscribedToVideoTrack:publication:forParticipant:]
New -[TVIRemoteParticipantDelegate didFailToSubscribeToVideoTrack:error:forParticipant:]
Previous -[TVIRemoteParticipantDelegate failedToSubscribeToVideoTrack:error:forParticipant:]
New -[TVIRemoteParticipantDelegate didUnsubscribeFromVideoTrack:publication:forParticipant:]
Previous -[TVIRemoteParticipantDelegate unsubscribedFromVideoTrack:publication:forParticipant:]
New -[TVIRemoteParticipantDelegate didSubscribeToAudioTrack:publication:forParticipant:]
Previous -[TVIRemoteParticipantDelegate subscribedToAudioTrack:publication:forParticipant:]
New -[TVIRemoteParticipantDelegate didFailToSubscribeToAudioTrack:error:forParticipant:]
Previous -[TVIRemoteParticipantDelegate failedToSubscribeToAudioTrack:error:forParticipant:]
New -[TVIRemoteParticipantDelegate didUnsubscribeFromAudioTrack:publication:forParticipant:]
Previous -[TVIRemoteParticipantDelegate unsubscribedFromAudioTrack:publication:forParticipant:]
New -[TVIRemoteParticipantDelegate didSubscribeToDataTrack:publication:forParticipant:]
Previous -[TVIRemoteParticipantDelegate subscribedToDataTrack:publication:forParticipant:]
New -[TVIRemoteParticipantDelegate didFailToSubscribeToDataTrack:error:forParticipant:]
Previous -[TVIRemoteParticipantDelegate failedToSubscribeToDataTrack:error:forParticipant:]
New -[TVIRemoteParticipantDelegate didUnsubscribeFromDataTrack:publication:forParticipant:]
Previous -[TVIRemoteParticipantDelegate unsubscribedFromDataTrack:publication:forParticipant:]

Improved Swift API

In 3.x we have revisited the way the Programmable Video iOS SDK is exposed in Swift to make developing Swift applications more idiomatic. Numerous changes were made across the entire surface area of the SDK which will require modifications in your current project. Among the high level changes:

  • The TVI prefix has been removed from all exposed types.
  • Many of the delegate and class function declarations have been renamed to provide better clarity of their intent.
  • The TwilioVideo class has been renamed to TwilioVideoSDK. This was necessary to allow type clashes to be resolved by qualifying the type name with the module name. For instance, if your application also declares a Room type, it will be necessary to distinguish the SDK's Room type by prefixing it with module name, TwilioVideo.Room. In previous versions of the iOS SDK, this would fail because Swift would recognize that there was a TwilioVideo class and it would attempt to find the Room type declared there. This is a known issue in Swift where type qualification will fail if a module contains a type of the same name.

For example, consider an application, MyApp, that contains its own implementation of a RemoteParticipant class. To differentiate between the RemoteParticipant class from the application and from the SDK, you would prefix the type definition with the module name:

var remoteParticipantFromApp: MyApp.RemoteParticipant?
var remoteParticipantFromSDK: TwilioVideo.RemoteParticipant?

Listed below are the major changes to the Swift APIs:

TwilioVideoSDK

New TwilioVideoSDK.Error
Previous TVIError
New TwilioVideoSDK.ErrorDomain
Previous kTVIErrorDomain
New TwilioVideoSDK.LogLevel
Previous TVILogLevel
New TwilioVideoSDK.LogModule
Previous TVILogModule
New TwilioVideoSDK.sdkVersion
Previous TwilioVideo.version
New class func connect(options: ConnectOptions,
delegate: RoomDelegate?) -> Room
Previous class func connect(with options: TVIConnectOptions,
delegate: TVIRoomDelegate?) -> TVIRoom

AudioDevice

New public func AudioDeviceFormatChanged(context: AudioDeviceContext)
Previous public func TVIAudioDeviceFormatChanged(_ context: TVIAudioDeviceContext)
New public func AudioDeviceWriteCaptureData(context: AudioDeviceContext,
data: UnsafeMutablePointer<Int8>,
sizeInBytes: Int)
Previous public func TVIAudioDeviceWriteCaptureData(_ context: TVIAudioDeviceContext,
_ data: UnsafeMutablePointer<Int8>,
_ sizeInBytes: Int)
New public func AudioDeviceReadRenderData(context: AudioDeviceContext,
data: UnsafeMutablePointer<Int8>,
sizeInBytes: Int)
Previous public func TVIAudioDeviceReadRenderData(_ context: TVIAudioDeviceContext,
_ data: UnsafeMutablePointer<Int8>,
_ sizeInBytes: Int)
New public typealias AudioDeviceWorkerBlock = () -> Void
Previous public typealias TVIAudioDeviceWorkerBlock = () -> Void
New public func AudioDeviceExecuteWorkerBlock(context: AudioDeviceContext,
block: @escaping AudioDeviceWorkerBlock)
Previous public func TVIAudioDeviceExecuteWorkerBlock(_ context: TVIAudioDeviceContext,
_ block: @escaping TVIAudioDeviceWorkerBlock)

AudioDeviceRenderer

New func startRendering(context: AudioDeviceContext) -> Bool
Previous func startRendering(_ context: TVIAudioDeviceContext) -> Bool

AudioDeviceCapturer

New func startCapturing(context: AudioDeviceContext) -> Bool
Previous func startCapturing(_ context: TVIAudioDeviceContext) -> Bool

AudioFormat

New AudioFormat.SampleRate8000
Previous TVIAudioSampleRate8000
New AudioFormat.SampleRate16000
Previous TVIAudioSampleRate16000
New AudioFormat.SampleRate24000
Previous TVIAudioSampleRate24000
New AudioFormat.SampleRate32000
Previous TVIAudioSampleRate32000
New AudioFormat.SampleRate44100
Previous TVIAudioSampleRate44100
New AudioFormat.SampleRate48000
Previous TVIAudioSampleRate48000
New AudioFormat.ChannelsMono
Previous TVIAudioChannelsMono
New AudioFormat.ChannelsStereo
Previous TVIAudioChannelsStereo

AudioOptionsBuilder

New AudioOptionsBuilder.Block
Previous TVIAudioOptionsBuilderBlock

CameraSource

New CameraSource.ErrorDomain
Previous kTVICameraSourceErrorDomain
New CameraSource.Error
Previous TVICameraSourceError
New CameraSource.StartedBlock
Previous TVICameraSourceStartedBlock
New CameraSource.StoppedBlock
Previous TVICameraSourceStoppedBlock
New func startCapture(device: AVCaptureDevice)
Previous func startCapture(with device: AVCaptureDevice)
New func startCapture(device: AVCaptureDevice,
completion: CameraSource.StartedBlock? = nil)
Previous func startCapture(with device: AVCaptureDevice,
completion: TVICameraSourceStartedBlock? = nil)
New func startCapture(device: AVCaptureDevice,
format: VideoFormat,
completion: CameraSource.StartedBlock? = nil)
Previous func startCapture(with device: AVCaptureDevice,
format: TVIVideoFormat,
completion: TVICameraSourceStartedBlock? = nil)
New func selectCaptureDevice(_ device: AVCaptureDevice)
Previous func select(_ device: AVCaptureDevice)
New func selectCaptureDevice(_ device: AVCaptureDevice,
completion: CameraSource.StartedBlock? = nil)
Previous func select(_ device: AVCaptureDevice,
completion: TVICameraSourceStartedBlock? = nil)
New func selectCaptureDevice(_ device: AVCaptureDevice,
format: VideoFormat,
completion: CameraSource.StartedBlock? = nil)
Previous func select(_ device: AVCaptureDevice,
format: TVIVideoFormat,
completion: TVICameraSourceStartedBlock? = nil)
New class func captureDevice(position: AVCaptureDevice.Position) -> AVCaptureDevice?
Previous class func captureDevice(for position: AVCaptureDevice.Position) -> AVCaptureDevice?
New class func captureDevice(position: AVCaptureDevice.Position,
deviceType: AVCaptureDevice.DeviceType) -> AVCaptureDevice?
Previous class func captureDevice(for position: AVCaptureDevice.Position,
type deviceType: AVCaptureDevice.DeviceType) -> AVCaptureDevice?
New class func supportedFormats(captureDevice: AVCaptureDevice) -> NSOrderedSet
Previous class func supportedFormats(for captureDevice: AVCaptureDevice) -> NSOrderedSet

CameraSourceDelegate

New func cameraSourceInterruptionEnded(source: CameraSource)
Previous func cameraSourceInterruptionEnded(_ source: TVICameraSource)
New func cameraSourceWasInterrupted(source: CameraSource,
reason: AVCaptureSession.InterruptionReason)
Previous func cameraSourceWasInterrupted(_ source: TVICameraSource,
reason: AVCaptureSession.InterruptionReason)
New func cameraSourceDidFail(source: CameraSource,
error: Error)
Previous func cameraSource(_ source: TVICameraSource,
didFailWithError error: Error)

CameraSourceOptionsBuilder

New CameraSourceOptionsBuilder.Block
Previous TVICameraSourceOptionsBuilderBlock

ConnectOptionsBuilder

New ConnectOptionsBuilder.Block
Previous TVIConnectOptionsBuilderBlock

DataTrackOptions

New DataTrackOptions.DefaultMaxPacketLifeTime
Previous kTVIDataTrackOptionsDefaultMaxPacketLifeTime
New DataTrackOptions.DefaultMaxRetransmits
Previous kTVIDataTrackOptionsDefaultMaxRetransmits

DataTrackOptionsBuilder

New DataTrackOptionsBuilder.Block
Previous TVIDataTrackOptionsBuilderBlock

DefaultAudioDevice

New DefaultAudioDevice.IOBufferDurationSimulator
Previous kTVIDefaultAudioDeviceIOBufferDurationSimulator
New DefaultAudioDevice.SampleRateSimulator
Previous kTVIDefaultAudioDeviceSampleRateSimulator
New DefaultAudioDevice.AVAudioSessionConfigurationBlock
Previous TVIAVAudioSessionConfigurationBlock
New DefaultAudioDevice.DefaultAVAudioSessionConfigurationBlock
Previous kDefaultAVAudioSessionConfigurationBlock

IceCandidatePairStats

New IceCandidatePairStats.State
Previous TVIIceCandidatePairState

IceOptions

New IceOptions.IceTransportPolicy
Previous TVIIceTransportPolicy

IceOptionsBuilder

New IceOptionsBuilder.Block
Previous TVIIceOptionsBuilderBlock

IsacCodec

New IsacCodec.SampleRate
Previous TVIIsacCodecSampleRate

LocalParticipantDelegate

New func localParticipantDidPublishAudioTrack(participant: LocalParticipant,
audioTrackPublication: LocalAudioTrackPublication)
Previous func localParticipant(_ participant: TVILocalParticipant,
publishedAudioTrack: TVILocalAudioTrackPublication)
New func localParticipantDidFailToPublishAudioTrack(participant: LocalParticipant,
audioTrack: LocalAudioTrack,
error: Error)
Previous func localParticipant(_ participant: TVILocalParticipant,
failedToPublishAudioTrack audioTrack: TVILocalAudioTrack,
withError error: Error)
New func localParticipantDidPublishDataTrack(participant: LocalParticipant,
dataTrackPublication: LocalDataTrackPublication)
Previous func localParticipant(_ participant: TVILocalParticipant,
publishedDataTrack: TVILocalDataTrackPublication)
New func localParticipantDidFailToPublishDataTrack(participant: LocalParticipant,
dataTrack: LocalDataTrack,
error: Error)
Previous func localParticipant(_ participant: TVILocalParticipant,
failedToPublishDataTrack dataTrack: TVILocalDataTrack,
withError error: Error)
New func localParticipantDidPublishVideoTrack(participant: LocalParticipant,
videoTrackPublication: LocalVideoTrackPublication)
Previous func localParticipant(_ participant: TVILocalParticipant,
publishedVideoTrack: TVILocalVideoTrackPublication)
New func localParticipantDidFailToPublishVideoTrack(participant: LocalParticipant,
videoTrack: LocalVideoTrack,
error: Error)
Previous func localParticipant(_ participant: TVILocalParticipant,
failedToPublishVideoTrack videoTrack: TVILocalVideoTrack,
withError error: Error)
New func localParticipantNetworkQualityLevelDidChange(participant: LocalParticipant,
networkQualityLevel: NetworkQualityLevel)
Previous func localParticipant(_ participant: TVILocalParticipant,
didChange networkQualityLevel: TVINetworkQualityLevel)

RemoteDataTrackDelegate

New func remoteDataTrackDidReceiveString(remoteDataTrack: RemoteDataTrack,
message: String)
Previous func remoteDataTrack(_ remoteDataTrack: TVIRemoteDataTrack,
didReceive message: String)
New func remoteDataTrackDidReceiveData(remoteDataTrack: RemoteDataTrack,
message: Data)
Previous func remoteDataTrack(_ remoteDataTrack: TVIRemoteDataTrack,
didReceive message: Data)

RemoteParticipantDelegate

New func remoteParticipantDidPublishVideoTrack(participant: RemoteParticipant,
publication: RemoteVideoTrackPublication)
Previous func remoteParticipant(_ participant: TVIRemoteParticipant,
publishedVideoTrack publication: TVIRemoteVideoTrackPublication)
New func remoteParticipantDidUnpublishVideoTrack(participant: RemoteParticipant,
publication: RemoteVideoTrackPublication)
Previous func remoteParticipant(_ participant: TVIRemoteParticipant,
unpublishedVideoTrack publication: TVIRemoteVideoTrackPublication)
New func remoteParticipantDidPublishAudioTrack(participant: RemoteParticipant,
publication: RemoteAudioTrackPublication)
Previous func remoteParticipant(_ participant: TVIRemoteParticipant,
publishedAudioTrack publication: TVIRemoteAudioTrackPublication)
New func remoteParticipantDidUnpublishAudioTrack(participant: RemoteParticipant,
publication: RemoteAudioTrackPublication)
Previous func remoteParticipant(_ participant: TVIRemoteParticipant,
unpublishedAudioTrack publication: TVIRemoteAudioTrackPublication)
New func remoteParticipantDidPublishDataTrack(participant: RemoteParticipant,
publication: RemoteDataTrackPublication)
Previous func remoteParticipant(_ participant: TVIRemoteParticipant,
publishedDataTrack publication: TVIRemoteDataTrackPublication)
New func remoteParticipantDidUnpublishDataTrack(participant: RemoteParticipant,
publication: RemoteDataTrackPublication)
Previous func remoteParticipant(_ participant: TVIRemoteParticipant,
unpublishedDataTrack publication: TVIRemoteDataTrackPublication)
New func remoteParticipantDidEnableVideoTrack(participant: RemoteParticipant,
publication: RemoteVideoTrackPublication)
Previous func remoteParticipant(_ participant: TVIRemoteParticipant,
enabledVideoTrack publication: TVIRemoteVideoTrackPublication)
New func remoteParticipantDidDisableVideoTrack(participant: RemoteParticipant,
publication: RemoteVideoTrackPublication)
Previous func remoteParticipant(_ participant: TVIRemoteParticipant,
disabledVideoTrack publication: TVIRemoteVideoTrackPublication)
New func remoteParticipantDidEnableAudioTrack(participant: RemoteParticipant,
publication: RemoteAudioTrackPublication)
Previous func remoteParticipant(_ participant: TVIRemoteParticipant,
enabledAudioTrack publication: TVIRemoteAudioTrackPublication)
New func remoteParticipantDidDisableAudioTrack(participant: RemoteParticipant,
publication: RemoteAudioTrackPublication)
Previous func remoteParticipant(_ participant: TVIRemoteParticipant,
disabledAudioTrack publication: TVIRemoteAudioTrackPublication)
New func didSubscribeToVideoTrack(videoTrack: RemoteVideoTrack,
publication: RemoteVideoTrackPublication,
participant: RemoteParticipant)
Previous func subscribed(to videoTrack: TVIRemoteVideoTrack,
publication: TVIRemoteVideoTrackPublication,
for participant: TVIRemoteParticipant)
New func didFailToSubscribeToVideoTrack(publication: RemoteVideoTrackPublication,
error: Error,
participant: RemoteParticipant)
Previous func failedToSubscribe(toVideoTrack publication: TVIRemoteVideoTrackPublication,
error: Error,
for participant: TVIRemoteParticipant)
New func didUnsubscribeFromVideoTrack(videoTrack: RemoteVideoTrack,
publication: RemoteVideoTrackPublication,
participant: RemoteParticipant)
Previous func unsubscribed(from videoTrack: TVIRemoteVideoTrack,
publication: TVIRemoteVideoTrackPublication,
for participant: TVIRemoteParticipant)
New func didSubscribeToAudioTrack(audioTrack: RemoteAudioTrack,
publication: RemoteAudioTrackPublication,
participant: RemoteParticipant)
Previous func subscribed(to audioTrack: TVIRemoteAudioTrack,
publication: TVIRemoteAudioTrackPublication,
for participant: TVIRemoteParticipant)
New func didFailToSubscribeToAudioTrack(publication: RemoteAudioTrackPublication,
error: Error,
participant: RemoteParticipant)
Previous func failedToSubscribe(toAudioTrack publication: TVIRemoteAudioTrackPublication,
error: Error,
for participant: TVIRemoteParticipant)
New func didUnsubscribeFromAudioTrack(audioTrack: RemoteAudioTrack,
publication: RemoteAudioTrackPublication,
participant: RemoteParticipant)
Previous func unsubscribed(from audioTrack: TVIRemoteAudioTrack,
publication: TVIRemoteAudioTrackPublication,
for participant: TVIRemoteParticipant)
New func didSubscribeToDataTrack(dataTrack: RemoteDataTrack,
publication: RemoteDataTrackPublication,
participant: RemoteParticipant)
Previous func subscribed(to dataTrack: TVIRemoteDataTrack,
publication: TVIRemoteDataTrackPublication,
for participant: TVIRemoteParticipant)
New func didFailToSubscribeToDataTrack(publication: RemoteDataTrackPublication,
error: Error,
participant: RemoteParticipant)
Previous func failedToSubscribe(toDataTrack publication: TVIRemoteDataTrackPublication,
error: Error,
for participant: TVIRemoteParticipant)
New func didUnsubscribeFromDataTrack(dataTrack: RemoteDataTrack,
publication: RemoteDataTrackPublication,
participant: RemoteParticipant)
Previous func unsubscribed(from dataTrack: TVIRemoteDataTrack,
publication: TVIRemoteDataTrackPublication,
for participant: TVIRemoteParticipant)

Room

New Room.State
Previous TVIRoomState
New Room.GetStatsBlock
Previous TVIRoomGetStatsBlock
New func getRemoteParticipant(sid: String) -> RemoteParticipant?
Previous func getRemoteParticipant(withSid sid: String) -> TVIRemoteParticipant?
New func getStats(_ block: @escaping Room.GetStatsBlock)
Previous func getStatsWith(_ block: @escaping TVIRoomGetStatsBlock)

RoomDelegate

New func roomDidConnect(room: Room)
Previous func didConnect(to room: TVIRoom)
New func roomDidFailToConnect(room: Room,
error: Error)
Previous func room(_ room: TVIRoom,
didFailToConnectWithError error: Error)
New func roomDidDisconnect(room: Room,
error: Error?)
Previous func room(_ room: TVIRoom,
didDisconnectWithError error: Error?)
New func roomIsReconnecting(room: Room,
error: Error)
Previous func room(_ room: TVIRoom,
isReconnectingWithError error: Error)
New func roomDidReconnect(room: Room)
Previous func didReconnect(to room: TVIRoom)
New func participantDidConnect(room: Room,
participant: RemoteParticipant)
Previous func room(_ room: TVIRoom,
participantDidConnect participant: TVIRemoteParticipant)
New func participantDidDisconnect(room: Room,
participant: RemoteParticipant)
Previous func room(_ room: TVIRoom,
participantDidDisconnect participant: TVIRemoteParticipant)
New func roomDidStartRecording(room: Room)
Previous func roomDidStartRecording(_ room: TVIRoom)
New func roomDidStopRecording(room: Room)
Previous func roomDidStopRecording(_ room: TVIRoom)
New func dominantSpeakerDidChange(room: Room,
participant: RemoteParticipant?)
Previous func room(_ room: TVIRoom,
dominantSpeakerDidChange participant: TVIRemoteParticipant?)

Track

New Track.State
Previous TVITrackState

VideoOrientation

New VideoOrientation.makeTransform(orientation: VideoOrientation) -> CGAffineTransform
Previous TVIVideoOrientationMakeTransform(_ orientation: TVIVideoOrientation) -> CGAffineTransform
New VideoOrientation.isRotated(orientation: VideoOrientation) -> Bool
Previous TVIVideoOrientationIsRotated(_ orientation: TVIVideoOrientation) -> Bool
New VideoOrientation.isValid(orientation: VideoOrientation) -> Bool
Previous TVIVideoOrientationIsValid(_ orientation: TVIVideoOrientation) -> Bool

VideoView

New VideoView.RenderingType
Previous TVIVideoRenderingType

VideoViewDelegate

New func videoViewDidReceiveData(view: VideoView)
Previous func videoViewDidReceiveData(_ view: TVIVideoView)
New func videoViewDimensionsDidChange(view: VideoView,
dimensions: CMVideoDimensions)
Previous func videoView(_ view: TVIVideoView,
videoDimensionsDidChange dimensions: CMVideoDimensions)
New func videoViewOrientationDidChange(view: VideoView,
dimensions orientation: VideoOrientation)
Previous func videoView(_ view: TVIVideoView,
videoOrientationDidChange orientation: TVIVideoOrientation)
Rate this page:

Need some help?

We all do sometimes; code is hard. Get help now from our support team, or lean on the wisdom of the crowd by visiting Twilio's Stack Overflow Collective or browsing the Twilio tag on Stack Overflow.

Loading Code Sample...
        
        
        

        Thank you for your feedback!

        Please select the reason(s) for your feedback. The additional information you provide helps us improve our documentation:

        Sending your feedback...
        🎉 Thank you for your feedback!
        Something went wrong. Please try again.

        Thanks for your feedback!

        thanks-feedback-gif