AWSKinesisVideoWebRTCStorage

Objective-C

@interface AWSKinesisVideoWebRTCStorage

Swift

class AWSKinesisVideoWebRTCStorage

  • The service configuration used to instantiate this service client.

    Warning

    Once the client is instantiated, do not modify the configuration object. It may cause unspecified behaviors.

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) AWSServiceConfiguration *configuration
  • Returns the singleton service client. If the singleton object does not exist, the SDK instantiates the default service client with defaultServiceConfiguration from [AWSServiceManager defaultServiceManager]. The reference to this object is maintained by the SDK, and you do not need to retain it manually.

    For example, set the default service configuration in - application:didFinishLaunchingWithOptions:

    Swift

    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
       let credentialProvider = AWSCognitoCredentialsProvider(regionType: .USEast1, identityPoolId: "YourIdentityPoolId")
       let configuration = AWSServiceConfiguration(region: .USEast1, credentialsProvider: credentialProvider)
       AWSServiceManager.default().defaultServiceConfiguration = configuration
    
       return true
    

    }

    Objective-C

    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
         AWSCognitoCredentialsProvider *credentialsProvider = [[AWSCognitoCredentialsProvider alloc] initWithRegionType:AWSRegionUSEast1
                                                                                                         identityPoolId:@"YourIdentityPoolId"];
         AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:AWSRegionUSEast1
                                                                              credentialsProvider:credentialsProvider];
         [AWSServiceManager defaultServiceManager].defaultServiceConfiguration = configuration;
    
         return YES;
     }
    

    Then call the following to get the default service client:

    Swift

    let KinesisVideoWebRTCStorage = AWSKinesisVideoWebRTCStorage.default()
    

    Objective-C

    AWSKinesisVideoWebRTCStorage *KinesisVideoWebRTCStorage = [AWSKinesisVideoWebRTCStorage defaultKinesisVideoWebRTCStorage];
    

    Declaration

    Objective-C

    + (nonnull instancetype)defaultKinesisVideoWebRTCStorage;

    Swift

    class func `default`() -> Self

    Return Value

    The default service client.

  • Creates a service client with the given service configuration and registers it for the key.

    For example, set the default service configuration in - application:didFinishLaunchingWithOptions:

    Swift

    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
       let credentialProvider = AWSCognitoCredentialsProvider(regionType: .USEast1, identityPoolId: "YourIdentityPoolId")
       let configuration = AWSServiceConfiguration(region: .USWest2, credentialsProvider: credentialProvider)
       AWSKinesisVideoWebRTCStorage.register(with: configuration!, forKey: "USWest2KinesisVideoWebRTCStorage")
    
       return true
    

    }

    Objective-C

    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
        AWSCognitoCredentialsProvider *credentialsProvider = [[AWSCognitoCredentialsProvider alloc] initWithRegionType:AWSRegionUSEast1
                                                                                                        identityPoolId:@"YourIdentityPoolId"];
        AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:AWSRegionUSWest2
                                                                             credentialsProvider:credentialsProvider];
    
        [AWSKinesisVideoWebRTCStorage registerKinesisVideoWebRTCStorageWithConfiguration:configuration forKey:@"USWest2KinesisVideoWebRTCStorage"];
    
        return YES;
    }
    

    Then call the following to get the service client:

    Swift

    let KinesisVideoWebRTCStorage = AWSKinesisVideoWebRTCStorage(forKey: "USWest2KinesisVideoWebRTCStorage")
    

    Objective-C

    AWSKinesisVideoWebRTCStorage *KinesisVideoWebRTCStorage = [AWSKinesisVideoWebRTCStorage KinesisVideoWebRTCStorageForKey:@"USWest2KinesisVideoWebRTCStorage"];
    

    Warning

    After calling this method, do not modify the configuration object. It may cause unspecified behaviors.

    Declaration

    Objective-C

    + (void)registerKinesisVideoWebRTCStorageWithConfiguration:(id)configuration
                                                        forKey:
                                                            (nonnull NSString *)key;

    Swift

    class func register(withConfiguration configuration: Any!, forKey key: String)

    Parameters

    configuration

    A service configuration object.

    key

    A string to identify the service client.

  • Retrieves the service client associated with the key. You need to call + registerKinesisVideoWebRTCStorageWithConfiguration:forKey: before invoking this method.

    For example, set the default service configuration in - application:didFinishLaunchingWithOptions:

    Swift

    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
       let credentialProvider = AWSCognitoCredentialsProvider(regionType: .USEast1, identityPoolId: "YourIdentityPoolId")
       let configuration = AWSServiceConfiguration(region: .USWest2, credentialsProvider: credentialProvider)
       AWSKinesisVideoWebRTCStorage.register(with: configuration!, forKey: "USWest2KinesisVideoWebRTCStorage")
    
       return true
    

    }

    Objective-C

    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
        AWSCognitoCredentialsProvider *credentialsProvider = [[AWSCognitoCredentialsProvider alloc] initWithRegionType:AWSRegionUSEast1
                                                                                                        identityPoolId:@"YourIdentityPoolId"];
        AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:AWSRegionUSWest2
                                                                             credentialsProvider:credentialsProvider];
    
        [AWSKinesisVideoWebRTCStorage registerKinesisVideoWebRTCStorageWithConfiguration:configuration forKey:@"USWest2KinesisVideoWebRTCStorage"];
    
        return YES;
    }
    

    Then call the following to get the service client:

    Swift

    let KinesisVideoWebRTCStorage = AWSKinesisVideoWebRTCStorage(forKey: "USWest2KinesisVideoWebRTCStorage")
    

    Objective-C

    AWSKinesisVideoWebRTCStorage *KinesisVideoWebRTCStorage = [AWSKinesisVideoWebRTCStorage KinesisVideoWebRTCStorageForKey:@"USWest2KinesisVideoWebRTCStorage"];
    

    Declaration

    Objective-C

    + (nonnull instancetype)KinesisVideoWebRTCStorageForKey:(nonnull NSString *)key;

    Swift

    convenience init(forKey key: String)

    Parameters

    key

    A string to identify the service client.

    Return Value

    An instance of the service client.

  • Removes the service client associated with the key and release it.

    Warning

    Before calling this method, make sure no method is running on this client.

    Declaration

    Objective-C

    + (void)removeKinesisVideoWebRTCStorageForKey:(nonnull NSString *)key;

    Swift

    class func remove(forKey key: String)

    Parameters

    key

    A string to identify the service client.

  • Join the ongoing one way-video and/or multi-way audio WebRTC session as a video producing device for an input channel. If there’s no existing session for the channel, a new streaming session needs to be created, and the Amazon Resource Name (ARN) of the signaling channel must be provided.

    Currently for the SINGLE_MASTER type, a video producing device is able to ingest both audio and video media into a stream, while viewers can only ingest audio. Both a video producing device and viewers can join the session first, and wait for other participants.

    While participants are having peer to peer conversations through webRTC, the ingested media session will be stored into the Kinesis Video Stream. Multiple viewers are able to playback real-time media.

    Customers can also use existing Kinesis Video Streams features like HLS or DASH playback, Image generation, and more with ingested WebRTC media.

    Assume that only one video producing device client can be associated with a session for the channel. If more than one client joins the session of a specific channel as a video producing device, the most recent client request takes precedence.

    See

    AWSKinesisVideoWebRTCStorageJoinStorageSessionInput

    Declaration

    Objective-C

    - (id)joinStorageSession:
        (nonnull AWSKinesisVideoWebRTCStorageJoinStorageSessionInput *)request;

    Swift

    func joinSession(_ request: AWSKinesisVideoWebRTCStorageJoinStorageSessionInput) -> Any!

    Parameters

    request

    A container for the necessary parameters to execute the JoinStorageSession service method.

    Return Value

    An instance of AWSTask. On successful execution, task.result will be nil. On failed execution, task.error may contain an NSError with AWSKinesisVideoWebRTCStorageErrorDomain domain and the following error code: AWSKinesisVideoWebRTCStorageErrorClientLimitExceeded, AWSKinesisVideoWebRTCStorageErrorInvalidArgument, AWSKinesisVideoWebRTCStorageErrorAccessDenied, AWSKinesisVideoWebRTCStorageErrorResourceNotFound.

  • Join the ongoing one way-video and/or multi-way audio WebRTC session as a video producing device for an input channel. If there’s no existing session for the channel, a new streaming session needs to be created, and the Amazon Resource Name (ARN) of the signaling channel must be provided.

    Currently for the SINGLE_MASTER type, a video producing device is able to ingest both audio and video media into a stream, while viewers can only ingest audio. Both a video producing device and viewers can join the session first, and wait for other participants.

    While participants are having peer to peer conversations through webRTC, the ingested media session will be stored into the Kinesis Video Stream. Multiple viewers are able to playback real-time media.

    Customers can also use existing Kinesis Video Streams features like HLS or DASH playback, Image generation, and more with ingested WebRTC media.

    Assume that only one video producing device client can be associated with a session for the channel. If more than one client joins the session of a specific channel as a video producing device, the most recent client request takes precedence.

    See

    AWSKinesisVideoWebRTCStorageJoinStorageSessionInput

    Declaration

    Objective-C

    - (void)
        joinStorageSession:
            (nonnull AWSKinesisVideoWebRTCStorageJoinStorageSessionInput *)request
         completionHandler:(void (^_Nullable)(NSError *_Nullable))completionHandler;

    Swift

    func joinSession(_ request: AWSKinesisVideoWebRTCStorageJoinStorageSessionInput) async throws

    Parameters

    request

    A container for the necessary parameters to execute the JoinStorageSession service method.

    completionHandler

    The completion handler to call when the load request is complete. error - An error object that indicates why the request failed, or nil if the request was successful. On failed execution, error may contain an NSError with AWSKinesisVideoWebRTCStorageErrorDomain domain and the following error code: AWSKinesisVideoWebRTCStorageErrorClientLimitExceeded, AWSKinesisVideoWebRTCStorageErrorInvalidArgument, AWSKinesisVideoWebRTCStorageErrorAccessDenied, AWSKinesisVideoWebRTCStorageErrorResourceNotFound.

  • Join the ongoing one way-video and/or multi-way audio WebRTC session as a viewer for an input channel. If there’s no existing session for the channel, create a new streaming session and provide the Amazon Resource Name (ARN) of the signaling channel (channelArn) and client id (clientId).

    Currently for SINGLE_MASTER type, a video producing device is able to ingest both audio and video media into a stream, while viewers can only ingest audio. Both a video producing device and viewers can join a session first and wait for other participants. While participants are having peer to peer conversations through webRTC, the ingested media session will be stored into the Kinesis Video Stream. Multiple viewers are able to playback real-time media.

    Customers can also use existing Kinesis Video Streams features like HLS or DASH playback, Image generation, and more with ingested WebRTC media. If there’s an existing session with the same clientId that’s found in the join session request, the new request takes precedence.

    See

    AWSKinesisVideoWebRTCStorageJoinStorageSessionAsViewerInput

    Declaration

    Objective-C

    - (id)joinStorageSessionAsViewer:
        (nonnull AWSKinesisVideoWebRTCStorageJoinStorageSessionAsViewerInput *)
            request;

    Swift

    func joinSession(asViewer request: AWSKinesisVideoWebRTCStorageJoinStorageSessionAsViewerInput) -> Any!

    Parameters

    request

    A container for the necessary parameters to execute the JoinStorageSessionAsViewer service method.

    Return Value

    An instance of AWSTask. On successful execution, task.result will be nil. On failed execution, task.error may contain an NSError with AWSKinesisVideoWebRTCStorageErrorDomain domain and the following error code: AWSKinesisVideoWebRTCStorageErrorClientLimitExceeded, AWSKinesisVideoWebRTCStorageErrorInvalidArgument, AWSKinesisVideoWebRTCStorageErrorAccessDenied, AWSKinesisVideoWebRTCStorageErrorResourceNotFound.

  • Join the ongoing one way-video and/or multi-way audio WebRTC session as a viewer for an input channel. If there’s no existing session for the channel, create a new streaming session and provide the Amazon Resource Name (ARN) of the signaling channel (channelArn) and client id (clientId).

    Currently for SINGLE_MASTER type, a video producing device is able to ingest both audio and video media into a stream, while viewers can only ingest audio. Both a video producing device and viewers can join a session first and wait for other participants. While participants are having peer to peer conversations through webRTC, the ingested media session will be stored into the Kinesis Video Stream. Multiple viewers are able to playback real-time media.

    Customers can also use existing Kinesis Video Streams features like HLS or DASH playback, Image generation, and more with ingested WebRTC media. If there’s an existing session with the same clientId that’s found in the join session request, the new request takes precedence.

    See

    AWSKinesisVideoWebRTCStorageJoinStorageSessionAsViewerInput

    Declaration

    Objective-C

    - (void)
        joinStorageSessionAsViewer:
            (nonnull AWSKinesisVideoWebRTCStorageJoinStorageSessionAsViewerInput *)
                request
                 completionHandler:
                     (void (^_Nullable)(NSError *_Nullable))completionHandler;

    Swift

    func joinSession(asViewer request: AWSKinesisVideoWebRTCStorageJoinStorageSessionAsViewerInput) async throws

    Parameters

    request

    A container for the necessary parameters to execute the JoinStorageSessionAsViewer service method.

    completionHandler

    The completion handler to call when the load request is complete. error - An error object that indicates why the request failed, or nil if the request was successful. On failed execution, error may contain an NSError with AWSKinesisVideoWebRTCStorageErrorDomain domain and the following error code: AWSKinesisVideoWebRTCStorageErrorClientLimitExceeded, AWSKinesisVideoWebRTCStorageErrorInvalidArgument, AWSKinesisVideoWebRTCStorageErrorAccessDenied, AWSKinesisVideoWebRTCStorageErrorResourceNotFound.