---
# System prepended metadata

title: New SDK

---

BVPlaybackLink

## Expected methods
- fun updatePlaybackToken(token: String): Unit
- fun startSession(): Unit
- fun endSession(): Unit
- suspend fun getResourceInfo(): ResourceInfo
- fun release(): Unit
- val errorEvent: Flow<BVPlaybackLinkError>
    

### Entity

```kotlin=
data class ResourceInfo(
    val id: String,
    val type: String
)
```
    
### Error
```kotlin=
data object ResponseParseError : BVPlaybackLinkError()

data object ConnectionError : BVPlaybackLinkError()

data object TimeoutError : BVPlaybackLinkError()

data class ClientError(
    val code: Int,
    val message: String
) : BVPlaybackLinkError()

data class UnknownError(
    val e: Throwable
) : BVPlaybackLinkError()
```

## Usage
```kotlin=
// 1
val playbackLink = BVPlaybackLink.Builder().build()
playbackLink.updatePlaybackToken(token)
val resourceInfo = playbackLink.getResourceInfo()


val player = Player.Builder(
        PlayerConfig(
            licensekey = "XXXXXX",
            serviceConfig = V2
        )
    )
    .setAnalyticsConfig(
        AnalyticsConfig(
            // 2
            resourceId = resourceInfo.id,
            resourceType = resourceInfo.type
        )
    )

    
// load content to playback
player.load(MediaConfig)
playbackLink.startSession()             // 3

// exit playback OR error occurs
player.stop()
player.release()

playbackLink.endSession()               // 4
playbackLink.release()

```