【问题标题】:YouTubePlayerView inside RecyclerView itemRecyclerView 项目内的 YouTubePlayerView
【发布时间】:2016-11-28 11:03:17
【问题描述】:

是否可以在滚动 RecyclerView 时使用 Youtube API 自动播放视频?

【问题讨论】:

  • 我正在调查同样的问题。看来YouTubePlayerView 不能在 RecyclerView 单元格中膨胀。这是我收到的错误消息:只能使用扩展 YouTubeBaseActivity 作为其上下文的 Activity 创建 YouTubePlayerView。

标签: android youtube-api android-youtube-api


【解决方案1】:

【讨论】:

  • 但这会在点击后播放视频并打开新活动,是否可以在viewholder内播放?
  • 我认为如果您使用 YouTubePlayerFragment 代替 YouTubePlayerView 生成 YouTubePlayerFragment 实例列表,您可以做到这一点。
  • 这可能会很快遇到性能问题,因为让每个单元格都成为 Fragment 的成本很高。
猜你喜欢
  • 2019-12-01
  • 2019-03-11
  • 2016-09-01
  • 2019-09-03
  • 2018-12-23
  • 2019-08-26
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多