FMLiveSwitchLayoutManager Class Reference

A class that supplies simple video frame layout management. More...

Instance Methods

(FMLiveSwitchLayout *) - addOnLayoutWithBlock
 Adds a handler that is raised when a layout is calculated. More...
 
(void) - addOnLayoutWithBlock:
 Adds a handler that is raised when a layout is calculated. More...
 
(bool) - addRemoteMedia:
 Adds remote media to the layout. More...
 
(bool) - addRemoteViewsWithIds:views:
 Adds remote views to the layout. More...
 
(bool) - addRemoteViewWithId:view:
 Adds a remote view to the layout. More...
 
(void) - addView:
 Adds a view to the container. More...
 
(void) - dispatchToMainThreadWithAction:arg1:arg2:
 Dispatches an action to the main thread. More...
 
(void) - dispatchToMainThreadWithActionBlock:arg1:arg2:
 Dispatches an action to the main thread. More...
 
(id, id- dispatchToMainThreadWithActionBlockAndArg1AndArg2
 Dispatches an action to the main thread. More...
 
(T) - doGetLocalView
 Gets the local view. More...
 
(NSMutableArray *) - doGetRemoteViewsIds
 Gets the remote view IDs. More...
 
(NSMutableArray< T > *) - doGetRemoteViewsWithId:
 Gets the remote views for a given remote view ID. More...
 
(FMLiveSwitchLayout *) - getLayoutWithLayoutWidth:layoutHeight:local:remoteCount:
 Gets a video frame layout. More...
 
(FMLiveSwitchLayout *) - getLayoutWithLayoutWidth:layoutHeight:local:remoteCount:remoteViewIds:
 Gets a video frame layout. More...
 
(FMLiveSwitchLayout *) - getLayoutWithLayoutWidth:layoutHeight:local:remoteCount:remoteViewIds:localVideoSize:remoteVideoSizes:
 Gets a video frame layout. More...
 
(FMLiveSwitchLayout *) - getLayoutWithLayoutWidth:layoutHeight:remoteCount:
 Gets a video frame layout. More...
 
(FMLiveSwitchLayout *) - getLayoutWithLayoutWidth:layoutHeight:remoteCount:remoteViewIds:
 Gets a video frame layout. More...
 
(T) - getLocalView
 Gets the local view from the layout. More...
 
(NSMutableArray *) - getRemoteViewIds
 Gets the IDs of the remote views in the layout. More...
 
(NSMutableArray< T > *) - getRemoteViews
 Gets all remote views from the layout. More...
 
(NSMutableArray< T > *) - getRemoteViewsWithIds:
 Gets remote views from the layout. More...
 
(T) - getRemoteViewWithId:
 Gets a remote view from the layout. More...
 
(instancetype) - init
 Initializes a new instance of the FMLiveSwitchLayoutManager`1 class. More...
 
(instancetype) - initWithPreset:
 Initializes a new instance of the FMLiveSwitchLayoutManager`1 class. More...
 
(void) - layout
 Positions the local and remote views within the layout. More...
 
(void) - layoutOnMainThread
 Positions the local and remote views within the layout after dispatching to the main thread. More...
 
(FMLiveSwitchLayoutOrigin) - layoutOrigin
 Gets the layout origin. More...
 
(void) - removeOnLayout:
 Removes a handler that is raised when a layout is calculated. More...
 
(bool) - removeRemoteMedia:
 Removes remote media from the layout. More...
 
(void) - removeRemoteViews
 Removes all remote views from the layout. More...
 
(bool) - removeRemoteViewsWithIds:
 Removes remote views from the layout. More...
 
(bool) - removeRemoteViewWithId:
 Removes a remote view from the layout. More...
 
(void) - removeView:
 Removes a view from the container. More...
 
(void) - reset
 Removes all remote views from the layout, then removes the local view from the layout. More...
 
(void) - setLayoutOrigin:
 Sets the layout origin. More...
 
(bool) - setLocalMedia:
 Adds the local media to the layout. More...
 
(bool) - setLocalView:
 Adds the local view to the layout. More...
 
(bool) - swapRemoteMediaWithRemoteMediaToRemove:remoteMediaToAdd:
 Swaps remote media in the layout. More...
 
(bool) - swapRemoteViewsWithIdsToRemove:idsToAdd:viewsToAdd:
 Swaps remote views in the layout. More...
 
(bool) - swapRemoteViewWithIdToRemove:idToAdd:viewToAdd:
 Swaps a remote view in the layout. More...
 
(bool) - unsetLocalView
 Removes the local view from the layout. More...
 

Class Methods

(FMLiveSwitchLayoutManager *) + layoutManager
 Initializes a new instance of the FMLiveSwitchLayoutManager`1 class. More...
 
(FMLiveSwitchLayoutManager *) + layoutManagerWithPreset:
 Initializes a new instance of the FMLiveSwitchLayoutManager`1 class. More...
 

Protected Attributes

 __pad0__: FMLiveSwitchLayoutPreset- (void) addOnLayout:(FMLiveSwitchAction1<FMLiveSwitchLayout*>*)value
 

Detailed Description

A class that supplies simple video frame layout management.

Method Documentation

◆ addOnLayoutWithBlock

- (FMLiveSwitchLayout*) addOnLayoutWithBlock

Adds a handler that is raised when a layout is calculated.

◆ addOnLayoutWithBlock:

- (void) addOnLayoutWithBlock: (void(^)(FMLiveSwitchLayout *))  valueBlock

Adds a handler that is raised when a layout is calculated.

◆ addRemoteMedia:

- (bool) addRemoteMedia: (NSObject< FMLiveSwitchIViewableMedia > *)  remoteMedia

Adds remote media to the layout.

Parameters
remoteMediaThe remote media.
Returns
true if successful; otherwise, false.

◆ addRemoteViewsWithIds:views:

- (bool) addRemoteViewsWithIds: (NSMutableArray *)  ids
views: (NSMutableArray *)  views 

Adds remote views to the layout.

Parameters
idsThe remote view IDs.
viewsThe remote views.
Returns
true if successful; otherwise, false. Check the logs for additional information.

◆ addRemoteViewWithId:view:

- (bool) addRemoteViewWithId: (NSString *)  idValue
view: (T)  view 

Adds a remote view to the layout.

Parameters
idValueThe remote view ID.
viewThe remote view.
Returns
true if successful; otherwise, false. Check the logs for additional information.

◆ addView:

- (void) addView: (T)  view

Adds a view to the container.

Parameters
viewThe view to add.

◆ dispatchToMainThreadWithAction:arg1:arg2:

- (void) dispatchToMainThreadWithAction: (FMLiveSwitchAction2< id, id > *)  action
arg1: (id arg1
arg2: (id arg2 

Dispatches an action to the main thread.

Parameters
actionThe action to invoke.
arg1The first argument.
arg2The second argument.

◆ dispatchToMainThreadWithActionBlock:arg1:arg2:

- (void) dispatchToMainThreadWithActionBlock: (void(^)(id, id))  actionBlock
arg1: (id arg1
arg2: (id arg2 

Dispatches an action to the main thread.

Parameters
actionBlockThe action to invoke.
arg1The first argument.
arg2The second argument.

◆ dispatchToMainThreadWithActionBlockAndArg1AndArg2

- (id, id) dispatchToMainThreadWithActionBlockAndArg1AndArg2

Dispatches an action to the main thread.

@inlineparam actionBlock The action to invoke. @inlineparam arg1 The first argument. @inlineparam arg2 The second argument.

◆ doGetLocalView

- T doGetLocalView

Gets the local view.

Returns
The local view.

◆ doGetRemoteViewsIds

- (NSMutableArray*) doGetRemoteViewsIds

Gets the remote view IDs.

Returns
The remote view IDs.

◆ doGetRemoteViewsWithId:

- (NSMutableArray<T>*) doGetRemoteViewsWithId: (NSString *)  idValue

Gets the remote views for a given remote view ID.

Parameters
idValueThe remote view ID.
Returns
The remote views.

◆ getLayoutWithLayoutWidth:layoutHeight:local:remoteCount:

- (FMLiveSwitchLayout*) getLayoutWithLayoutWidth: (int)  layoutWidth
layoutHeight: (int)  layoutHeight
local: (bool)  local
remoteCount: (int)  remoteCount 

Gets a video frame layout.

Parameters
layoutWidthThe total width of the layout.
layoutHeightThe total height of the layout.
localWhether a local frame is needed.
remoteCountThe number of remote frames.
Returns
The video frame layout.

◆ getLayoutWithLayoutWidth:layoutHeight:local:remoteCount:remoteViewIds:

- (FMLiveSwitchLayout*) getLayoutWithLayoutWidth: (int)  layoutWidth
layoutHeight: (int)  layoutHeight
local: (bool)  local
remoteCount: (int)  remoteCount
remoteViewIds: (NSMutableArray *)  remoteViewIds 

Gets a video frame layout.

Parameters
layoutWidthThe total width of the layout.
layoutHeightThe total height of the layout.
localWhether a local frame is needed.
remoteCountThe number of remote frames.
remoteViewIdsThe remote view IDs.
Returns
The video frame layout.

◆ getLayoutWithLayoutWidth:layoutHeight:local:remoteCount:remoteViewIds:localVideoSize:remoteVideoSizes:

- (FMLiveSwitchLayout*) getLayoutWithLayoutWidth: (int)  layoutWidth
layoutHeight: (int)  layoutHeight
local: (bool)  local
remoteCount: (int)  remoteCount
remoteViewIds: (NSMutableArray *)  remoteViewIds
localVideoSize: (FMLiveSwitchSize *)  localVideoSize
remoteVideoSizes: (NSMutableArray *)  remoteVideoSizes 

Gets a video frame layout.

Parameters
layoutWidthThe total width of the layout.
layoutHeightThe total height of the layout.
localWhether a local frame is needed.
remoteCountThe number of remote frames.
remoteViewIdsThe remote view IDs.
localVideoSizeThe local video size.
remoteVideoSizesThe remote video sizes.
Returns
The video frame layout.

◆ getLayoutWithLayoutWidth:layoutHeight:remoteCount:

- (FMLiveSwitchLayout*) getLayoutWithLayoutWidth: (int)  layoutWidth
layoutHeight: (int)  layoutHeight
remoteCount: (int)  remoteCount 

Gets a video frame layout.

Parameters
layoutWidthThe total width of the layout.
layoutHeightThe total height of the layout.
remoteCountThe number of remote frames.
Returns
The video frame layout.

◆ getLayoutWithLayoutWidth:layoutHeight:remoteCount:remoteViewIds:

- (FMLiveSwitchLayout*) getLayoutWithLayoutWidth: (int)  layoutWidth
layoutHeight: (int)  layoutHeight
remoteCount: (int)  remoteCount
remoteViewIds: (NSMutableArray *)  remoteViewIds 

Gets a video frame layout.

Parameters
layoutWidthThe total width of the layout.
layoutHeightThe total height of the layout.
remoteCountThe number of remote frames.
remoteViewIdsThe remote view IDs.
Returns
The video frame layout.

◆ getLocalView

- T getLocalView

Gets the local view from the layout.

Returns
The local view.

◆ getRemoteViewIds

- (NSMutableArray*) getRemoteViewIds

Gets the IDs of the remote views in the layout.

Returns
The remote view IDs.

◆ getRemoteViews

- (NSMutableArray<T>*) getRemoteViews

Gets all remote views from the layout.

Returns
The remote views.

◆ getRemoteViewsWithIds:

- (NSMutableArray<T>*) getRemoteViewsWithIds: (NSMutableArray *)  ids

Gets remote views from the layout.

Parameters
idsThe remote view IDs.
Returns
The remote views.

◆ getRemoteViewWithId:

- T getRemoteViewWithId: (NSString *)  idValue

Gets a remote view from the layout.

Parameters
idValueThe remote view ID.
Returns
The remote view.

◆ init

- (instancetype) init

Initializes a new instance of the FMLiveSwitchLayoutManager`1 class.

◆ initWithPreset:

- (instancetype) initWithPreset: (FMLiveSwitchLayoutPreset *)  preset

Initializes a new instance of the FMLiveSwitchLayoutManager`1 class.

◆ layout

- (void) layout

Positions the local and remote views within the layout.

◆ layoutManager

+ (FMLiveSwitchLayoutManager*) layoutManager

Initializes a new instance of the FMLiveSwitchLayoutManager`1 class.

◆ layoutManagerWithPreset:

+ (FMLiveSwitchLayoutManager*) layoutManagerWithPreset: (FMLiveSwitchLayoutPreset *)  preset

Initializes a new instance of the FMLiveSwitchLayoutManager`1 class.

◆ layoutOnMainThread

- (void) layoutOnMainThread

Positions the local and remote views within the layout after dispatching to the main thread.

◆ layoutOrigin

- (FMLiveSwitchLayoutOrigin) layoutOrigin

Gets the layout origin.

Defaults to TopLeft.

◆ removeOnLayout:

- (void) removeOnLayout: (FMLiveSwitchAction1< FMLiveSwitchLayout * > *)  value

Removes a handler that is raised when a layout is calculated.

◆ removeRemoteMedia:

- (bool) removeRemoteMedia: (NSObject< FMLiveSwitchIViewableMedia > *)  remoteMedia

Removes remote media from the layout.

Parameters
remoteMediaThe remote media.
Returns
true if successful; otherwise, false.

◆ removeRemoteViews

- (void) removeRemoteViews

Removes all remote views from the layout.

◆ removeRemoteViewsWithIds:

- (bool) removeRemoteViewsWithIds: (NSMutableArray *)  ids

Removes remote views from the layout.

Parameters
idsThe remote view IDs.
Returns
true if successful; otherwise, false. Check the logs for additional information.

◆ removeRemoteViewWithId:

- (bool) removeRemoteViewWithId: (NSString *)  idValue

Removes a remote view from the layout.

Parameters
idValueThe remote view ID.
Returns
true if successful; otherwise, false. Check the logs for additional information.

◆ removeView:

- (void) removeView: (T)  view

Removes a view from the container.

Parameters
viewThe view to remove.

◆ reset

- (void) reset

Removes all remote views from the layout, then removes the local view from the layout.

◆ setLayoutOrigin:

- (void) setLayoutOrigin: (FMLiveSwitchLayoutOrigin)  value

Sets the layout origin.

Defaults to TopLeft.

◆ setLocalMedia:

- (bool) setLocalMedia: (NSObject< FMLiveSwitchIViewableMedia > *)  localMedia

Adds the local media to the layout.

Parameters
localMediaThe local media.
Returns
true if successful; otherwise, false.

◆ setLocalView:

- (bool) setLocalView: (T)  view

Adds the local view to the layout.

Parameters
viewThe local view.
Returns
true if successful; otherwise, false. Check the logs for additional information.

◆ swapRemoteMediaWithRemoteMediaToRemove:remoteMediaToAdd:

- (bool) swapRemoteMediaWithRemoteMediaToRemove: (NSObject< FMLiveSwitchIViewableMedia > *)  remoteMediaToRemove
remoteMediaToAdd: (NSObject< FMLiveSwitchIViewableMedia > *)  remoteMediaToAdd 

Swaps remote media in the layout.

Parameters
remoteMediaToRemoveThe remote media to remove.
remoteMediaToAddThe remote media to add.

◆ swapRemoteViewsWithIdsToRemove:idsToAdd:viewsToAdd:

- (bool) swapRemoteViewsWithIdsToRemove: (NSMutableArray *)  idsToRemove
idsToAdd: (NSMutableArray *)  idsToAdd
viewsToAdd: (NSMutableArray *)  viewsToAdd 

Swaps remote views in the layout.

Parameters
idsToRemoveThe remote view IDs to remove.
idsToAddThe remote view IDs to add.
viewsToAddThe remote views to add.
Returns
true if successful; otherwise, false. Check the logs for additional information.

◆ swapRemoteViewWithIdToRemove:idToAdd:viewToAdd:

- (bool) swapRemoteViewWithIdToRemove: (NSString *)  idToRemove
idToAdd: (NSString *)  idToAdd
viewToAdd: (T)  viewToAdd 

Swaps a remote view in the layout.

Parameters
idToRemoveThe remote view ID to remove.
idToAddThe remote view ID to add.
viewToAddThe remote view to add.

◆ unsetLocalView

- (bool) unsetLocalView

Removes the local view from the layout.

Returns
true if successful; otherwise, false. Check the logs for additional information.

Member Data Documentation

◆ __pad0__

- __pad0__
protected