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:
mode: PeeringMode — the desired peering mode.
- Possible
PeeringModevalues: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
onPeeringModelambda is called on the Main thread. - May return a
nullablevalue (null) if the Teleport SDK has not yet been initialized.
- The
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.