OtvSdkClient

open class OtvSdkClient : Closeable

Entry point for authenticating and maintaining a session with the OpenTV IAS service.

Parameters

config

connection settings used to build login/refresh requests

context

required application context used to open SDK persistence storage

Constructors

Link copied to clipboard
constructor(config: OtvSdkConfig, context: Context)

Properties

Link copied to clipboard

Reports whether this device supports voice input and translation.

Link copied to clipboard

On-device (ML Kit) translation to English. Pass it as com.nagra.opentvsdk.a2a.SessionConfig.translator to translate chat messages; language models download on first use.

Link copied to clipboard

Invoked after every refresh attempt, with the new access token on success or the failure cause on error. May be called from any thread.

Functions

Link copied to clipboard

Registers a refresh listener that is notified after every refresh attempt.

Link copied to clipboard
open override fun close()

Closes the SDK client, releasing any resources.

Link copied to clipboard

Performs a DAS login, automatically determining the DRM type based on the presence of a CONNECT opvault resource. The file name should be "connect_opvault" and placed in the "res/raw" directory of the application. If Connect login fails, it will fall back to Widevine login.

fun dasLogin(drmType: String, isL3: Boolean, opVault: ByteArray?): String

Performs a DAS login

Link copied to clipboard

Returns the current access token when it is present and not expired.

Link copied to clipboard

Returns the SDK version string.

Link copied to clipboard
suspend fun getValidAccessToken(forceRefresh: Boolean = false): String?

Returns a currently valid access token.

Link copied to clipboard

Returns whether the refresh expiry timestamp has passed or there is no record of a valid session.

Link copied to clipboard
fun login(username: String, password: String): String

Authenticates with the OpenTV IAS service and returns an access token.

Link copied to clipboard

Unregisters a previously registered refresh listener.

Link copied to clipboard

Signs out of the current IAS session and clears the local session state.