Skip to main content

Upgrade from 5.7.x to 5.8.0

This document outlines the breaking changes introduced in the Diva Player Android 5.8.0 release. These modifications necessitate developers to update their code to ensure compatibility with the new SDK version. The changes encompass class renaming, updates to function signatures, and a significant internal overhaul of the media player component.

These updates are essential for those upgrading from version 5.7.x.

How to Fix the Breaking Changes​

Media3 Migration Dependencies​

The new dependency on Media3 is handled internally by Diva Player. Therefore, any existing dependencies on ExoPlayer (com.deltatre.diva.exoplayer:exoplayer*) in your integration app can be safely removed.

Example of Dependency Removal:

Before​
implementation 'com.deltatre.diva.exoplayer:exoplayer-core:2.19.1.1'
implementation 'com.deltatre.diva.exoplayer:exoplayer-ui:2.19.1.1'
After​
// No need to include ExoPlayer dependencies as Media3 is managed internally by Diva Player

Renaming of DivaBoAdapter Class​

The DivaBoAdapter class has been renamed to support different device integrations:

  • DivaBoAdapterMobile: This class is now used for integrating the library with mobile and tablet devices.
  • DivaBoAdapterTV: This class is designated for integrating the library with TV devices.

Developers must update their code to use the appropriate class name based on the target device.

Example:

Before​
val adapter = DivaBoAdapter()
After​
// Mobile & Tablet
val adapter = DivaBoAdapterMobile()

// TV
val adapter = DivaBoAdapterTV()

Renaming of DivaExtraParams Class​

The DivaExtraParams class has been renamed for mobile and tablet integrations:

  • DivaExtraParamsMobile: This class is now used exclusively for mobile and tablet integrations.
  • DivaExtraParams: The class name remains the same for TV integrations.

Developers targeting mobile and tablet devices must use the new class name.

Example:

Before​
val params = DivaExtraParams()
After​
// Mobile & Tablet
val params = DivaExtraParamsMobile()

// TV
val params = DivaExtraParams()

Updated createDivaFragment Function Signature​

The createDivaFragment function now includes an additional nullable version parameter. This change requires an update to the function call in existing codebases.

New Function Signature:

fun createDivaFragment(
adapterSettingsUrl: String,
langCountryCode: String,
videoId: String,
userExternalId: String = "",
getCurrentUserAccountAccessToken: () -> String,
sharedKey: String?,
conf: DivaExtraParamsMobile,
version: String? = null,
onError: (Exception) -> Unit,
onSuccessExtra: ((BoAdapterExtra) -> Unit)? = null,
onSuccess: (DivaFragment) -> Unit,
)