Hi, I am integrating cast in my application and having a single base code for both mobile and tv, while launching the application on mobile it is working as expected but on launching the same apk on TV it is crashing.
I tried the same with the Bitmovin sample code
it is crashing for TV.
Any help will be appreciated.
Hi @kalyani.singh , thanks for raising this issue and apologies for late reply. The issue that you seem to be facing is because when Casting feature is used i.e. when Casting dependencies are added, the player looks for Android GMS services which may not be available of Android TV devices. One way to fix is this is to separate your Android Mobile and Android TV projects and not add Casting dependencies in TV project.
Another way to do this for common project is as follows.
- No call to
BitmovinCastManager should be done from application for TV application.
- The Bitmovin player needs to be created with Cast disabled for TV app. Code snippet below.
var remoteControlConfig = RemoteControlConfig()
remoteControlConfig.isCastEnabled = false
var playerConfig = PlayerConfig(remoteControlConfig=remoteControlConfig)
player = Player.create(this, playerConfig)
binding.bitmovinPlayerView.player = player
- If you are using
com.bitmovin.player.PlayerView in your app’s layout, add below 2 lines to it.
Below is the updated
activity_player.xml compared to the one in BasicCastingKotlin sample app.
<?xml version="1.0" encoding="utf-8"?>
Hope this helps you solve the issue.