Interface KinesisVideoClient

    • Method Detail

      • isInitialized

        boolean isInitialized()
        Returns whether the client has been initialized
        Returns:
        true if initialized. false otherwise.
      • listSupportedConfigurations

        List<MediaSourceConfiguration.Builder<? extends MediaSourceConfiguration>> listSupportedConfigurations()
        List few known media sources available to the application. The configurations returned are expected to be working as is. The returned list is not exhaustive, some working configurations will likely be missing from the list.
        Returns:
        list of configuration builders to allow further configuration
      • registerMediaSource

        void registerMediaSource​(MediaSource mediaSource)
                          throws KinesisVideoException
        Register a media source. The media source will be binding to kinesis video producer stream to send out data from media source. Sync call to create the stream and bind to media source.
        Parameters:
        mediaSource - media source binding to kinesis video producer stream
        Throws:
        KinesisVideoException - if unable to register media source.
      • registerMediaSourceAsync

        void registerMediaSourceAsync​(MediaSource mediaSource)
                               throws KinesisVideoException
        Register a media source ASYNC. The media source will be binding to kinesis video producer stream via CreateStream and send out data from media source. Async call to create the stream and bind to media source.
        Parameters:
        mediaSource - media source binding to kinesis video producer stream
        Throws:
        KinesisVideoException - if unable to register media source.
      • unregisterMediaSource

        void unregisterMediaSource​(MediaSource mediaSource)
                            throws KinesisVideoException
        Un-Register a media source. The media source will stop binding to kinesis video producer stream and it cannot send data via producer stream afterwards until register again. Sync call and could be block for 15 seconds if error happens when stopping stream.
        Parameters:
        mediaSource - media source to stop binding to kinesis video producer stream
        Throws:
        KinesisVideoException - if unable to unregister media source.
      • freeMediaSource

        void freeMediaSource​(@Nonnull
                             MediaSource mediaSource)
                      throws KinesisVideoException
        Free a media source. Async call to clean up resources if error happens.
        Parameters:
        mediaSource - media source binding to kinesis video producer stream to be freed
        Throws:
        KinesisVideoException - if unable to free media source.
      • createMediaSource

        MediaSource createMediaSource​(String streamName,
                                      MediaSourceConfiguration mediaSourceConfiguration)
                               throws KinesisVideoException
        Try create a media source. Use the mediaSourceConfiguration to determine, the media source type, create the instance, and ensure that it is configured with working parameters
        Parameters:
        streamName - Stream name for the media source
        mediaSourceConfiguration - , configuration to create specific media source
        Returns:
        configured and working media source
        Throws:
        UnsupportedConfigurationException - is thrown when the configuration is not supported, e.g. camera resolution or encoding
        UnknownMediaSourceException - is thrown when the media source type is unknown and cannot be created
        KinesisVideoException