TWCLocalMediaDelegate Protocol Reference

Conforms to NSObject
Declared in TWCMedia.h

Overview

The TWCLocalMediaDelegate protocol allows you to respond to events from TWCLocalMedia.

– localMedia:didAddVideoTrack:

A video track was added to TWCLocalMedia.

- (void)localMedia:(nonnull TWCLocalMedia *)media didAddVideoTrack:(nonnull TWCVideoTrack *)videoTrack

Parameters

media

The TWCLocalMedia which has a new track.

videoTrack

The TWCVideoTrack which will be shared with Participants.

Discussion

A video track was added to TWCLocalMedia.

If you didn’t already add a renderer when you created the track, now is a good time.

Declared In

TWCMedia.h

– localMedia:didFailToAddVideoTrack:error:

A video track failed to be added to TWCLocalMedia.

- (void)localMedia:(nonnull TWCLocalMedia *)media didFailToAddVideoTrack:(nonnull TWCVideoTrack *)videoTrack error:(nonnull NSError *)error

Parameters

media

The TWCLocalMedia where the track was originally added.

videoTrack

The TWCVideoTrack which is no longer valid.

error

An NSError describing why the track was not added.

Discussion

A video track failed to be added to TWCLocalMedia.

Asynchronous track errors may occur due to invalid TWCVideoConstraints, or other failures in the video subsytem. Check the error that is returned for recovery strategies.

Declared In

TWCMedia.h

– localMedia:didRemoveVideoTrack:

A video track was removed from TWCLocalMedia.

- (void)localMedia:(nonnull TWCLocalMedia *)media didRemoveVideoTrack:(nonnull TWCVideoTrack *)videoTrack

Parameters

media

The TWCLocalMdeia where the track was removed.

videoTrack

The TWCVideoTrack which was removed.

Discussion

A video track was removed from TWCLocalMedia.

Renderers are automatically removed from the track after this call returns.

Declared In

TWCMedia.h