yqritc / Android-ScalableVideoView

Android Texture VideoView having a variety of scale types like the scale types of ImageView such as fitCenter, centerCrop, centerTopCrop and more
Apache License 2.0
1.09k stars 223 forks source link

Scroll auto play/pause #11

Open tuanth89 opened 8 years ago

tuanth89 commented 8 years ago

@yqritc , thank for awesome library. i love it! Can you please add features auto play/pause when scroll like facebook app ?

anvesh523 commented 8 years ago

+1

geogie commented 8 years ago

this videoView can circle??? I want to play CircleView. But I don't know.....

ghost commented 8 years ago

If you're using RecyclerView then in your adapter:

scalableVideoView.setOnFocusChangeListener(new View.OnFocusChangeListener() {
            @Override
            public void onFocusChange(View v, boolean hasFocus) {
                if (hasFocus)
                    scalableVideoView.start();
                else
                    scalableVideoView.pause();
            }
        });
ay1man4 commented 8 years ago

OnFocusChangeListener does not solve this issue.