androidx / androidx/media

Smooth transition to player (which is in an itemview) in the next activity contaning recyclerview

Open
#1,284 0 comments 0 reactions 1 assignee View on GitHub

@marcbaechinger is already working on this.

Since May 1, 2024.

needs triage question
Dominant language
Java
Stars
3k
Forks
955
Avg merge
12d 14h
Merged PRs (30d)
2

Description

I have a RecyclerView in first Fragment which has PlayerView to play videos from url at the appropriate visible position (& pauses when the visible view is away from the visible position).

From here, clicking in the video I start next activity (similar to instagram when we click a reel video in feed) which has RecyclerView with pagersnaphelper. Here I pass the clicked video's data, current position & added it the list so it continues playing from there. I add remaining videos from API to the list.

Initially, both pages have its own pool of Players. In Instagram Android when we click a video there is a small buffering in between, the app I am developing also had that. The requirement is to be without that & expects behaviour like in iOS Instagram where the video seamlessly goes to fullscreen without interruption.

To make it like that, I have assigned the clicked PlayerView's player to a global variable & in next activity adapter binding if position is 0 I assign the global Player instead of creating a new one. I applied shared element transition also, but still there is a bit of interruption when assigning the shared Player to a PlayerView in the itemview.

But I found that when the next activity has a single PlayerView there is no noticeable interruption, anything I can do to achieve same in PlayerView is in itemview?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.