我已在我的应用中运行ExoPlayer 2.7.2
。我想为它添加Cast功能。如何使用ExoPlayer Cast扩展程序将我的香草ExoPlayer
更改为CastPlayer
?
答案 0 :(得分:0)
Github上有一个demo app for cast in the ExoPlayer repository,它创建一个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 blog post on Medium说明应用程序需要提供哪些演员表。