PierfrancescoSoffritti / android-youtube-player

YouTube Player library for Android and Chromecast, stable and customizable.
https://pierfrancescosoffritti.github.io/android-youtube-player/
MIT License
3.44k stars 765 forks source link

Scrolling issues #1028

Closed naman5665 closed 1 year ago

naman5665 commented 1 year ago

Question / Problem

I have a bottomsheet and it is filled with a Fragment. The fragment is vertically scrollable. I have added youtubeplayer inside this fragment. Now the problem that I am facing is when I try to scroll components of youtubeplayer(for eg: change in speed,etc), my whole fragment gets scrolled.

Summary

I want when I scroll inside youtube player, whole fragment should not scroll rather only components of youtubeplayer should be scrolled

What I've tried

I have already implemented this code but it is not working

youTubePlayerView.setOnTouchListener((v, event) -> {
                if(event.getAction() == MotionEvent.ACTION_DOWN){
                    scrollView.setOnTouchListener((v2,event2) -> true);
                }else if(event.getAction() == MotionEvent.ACTION_UP){
                    scrollView.setOnTouchListener((v2,event2) -> false);
                }
                return true;
            });
PierfrancescoSoffritti commented 1 year ago

What components inside the YouTube player are you scrolling?

naman5665 commented 1 year ago

WhatsApp Image 2023-07-19 at 12 43 32 PM

This one

PierfrancescoSoffritti commented 1 year ago

Why is your player so small?

I don't know what the answer to your question is, but you need to figure out a way for the recycler view to not intercept the scroll.

I'm closing as this issue is about Android development, not strictly related to the library.

naman5665 commented 1 year ago

Why is your player so small?

I don't know what the answer to your question is, but you need to figure out a way for the recycler view to not intercept the scroll.

I'm closing as this issue is about Android development, not strictly related to the library.

This is small because this is the cropped image of the youtube player Also, I am not using recylerview, but using Scrollview and inside it , it is implemented along with other views/layouts.

bbaoNg97 commented 1 year ago

@naman5665 im facing the same issue 😢 did you find the solution yet?

naman5665 commented 1 year ago

@naman5665 im facing the same issue 😢 did you find the solution yet?

No😞.

PierfrancescoSoffritti commented 1 year ago

The player is still quite small, could you share a full screen screenshot?