Android 如何从ExoPlayer Cast扩展创建CastPlayer?

Android 如何从ExoPlayer Cast扩展创建CastPlayer?,android,exoplayer,exoplayer2.x,Android,Exoplayer,Exoplayer2.x,我的应用程序中已经运行了ExoPlayer 2.7.2。我想给它添加Cast功能。如何使用ExoPlayer Cast扩展将我的vanillaExoPlayer更改为CastPlayer?在Github上有一个创建CastPlayer的插件,如下所示: // set up the cast player castPlayer = new CastPlayer(castContext); castPlayer.addListener(this); castPlayer.setSessionAvai

我的应用程序中已经运行了
ExoPlayer 2.7.2
。我想给它添加Cast功能。如何使用ExoPlayer Cast扩展将我的vanilla
ExoPlayer
更改为
CastPlayer

在Github上有一个创建CastPlayer的插件,如下所示:

// set up the cast player
castPlayer = new CastPlayer(castContext);
castPlayer.addListener(this);
castPlayer.setSessionAvailabilityListener(this);
// set to a PlayerView for controls
castControlView.setPlayer(castPlayer);
如果您的代码是针对
Player
接口编写的,您可以使用
CastPlayer
实例交换本地播放器


A解释了应用程序需要提供哪些演员作品。

Hi@khateeb,你看到这些链接了吗@卡提布,我也得这么做。你实施了吗?你有我能提供的资源吗follow@AkhilaMadari我遵循下面答案中给出的步骤。