Skip to content

TeleportApi Methods

The TeleportApi class provides the main interface for interacting with the Teleport SDK in your Android application. The available methods are described below.

Available Methods

fun setPeeringMode(mode: PeeringMode)

Sets the peering mode for the SDK.

  • Parameters:
  • Possible PeeringMode values: OFF, DOWNLOAD, UPLOAD, FULL.

Important

If the Teleport SDK is not initialized at the time this method is called, the passed PeeringMode value will be ignored. Ensure that the SDK is initialized before setting the peering mode.

fun getPeeringMode(onPeeringMode: (PeeringMode?) -> Unit)

Retrieves the current peering mode set in the SDK.

  • Parameters:
    • onPeeringMode: (PeeringMode?) -> Unit — a lambda function that will be called with the current peering mode.
  • Features:
    • The onPeeringMode lambda is called on the Main thread.
    • May return a nullable value (null) if the Teleport SDK has not yet been initialized.

fun buffering()

Method to notify the Teleport SDK about a buffering event in the video player.

Purpose

Calling this method helps the Teleport SDK adapt its content delivery strategy to minimize further buffering.

fun release()

Method to stop the SDK's operation and release all associated resources.

Important

This method must be called after releasing player resources (e.g., in onDestroy() of your Activity or Fragment) to prevent memory leaks and incorrect SDK operation.