Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slider working incorrect when rotate View!!! #30

Closed
dungle27 opened this issue Jun 1, 2020 · 5 comments
Closed

Slider working incorrect when rotate View!!! #30

dungle27 opened this issue Jun 1, 2020 · 5 comments

Comments

@dungle27
Copy link

dungle27 commented Jun 1, 2020

Hello!
Currently I have issue:
when rotate parent View (Video & MediaControls) use transform: [{ rotate: '90deg' }]
Slider working incorrect...
please help me fix this problem!

====================
<View style={isFullScreen ? styles.video_player : {}}>
<Video
onEnd={onEnd}
onLoad={onLoad}
onLoadStart={onLoadStart}
onProgress={onProgress}
paused={paused}
ref={ref => (videoRef.current = ref)}
resizeMode="contain"
onFullScreen={isFullScreen}
source={{ uri: mainUrl }}
repeat={true}
style={isFullScreen ? styles.video_land : styles.video_poirt}

                                    />
                                    <MediaControls
                                        isFullScreen={isFullScreen}
                                        duration={duration}
                                        isLoading={isLoading}
                                        mainColor="black"
                                        onFullScreen={noop}
                                        onPaused={onPaused}
                                        onReplay={onReplay}
                                        onSeek={onSeek}
                                        onSeeking={onSeeking}
                                        playerState={playerState}
                                        progress={currentTime}
                                    >
                                   
                                    </MediaControls>

                                </View>

==========================
const styles = {
video_player: { width: heightDevice - 2 * HEIGHT_STATUSBAR, height: widthDevice, transform: [{ rotate: '-90deg' }] },
video_poirt: { width: widthDevice - 6, height: (isTab ? 360 : 280) },
video_land: { width: heightDevice - 2 * HEIGHT_STATUSBAR, height: widthDevice }
}

@charliesbot
Copy link
Owner

could you give me more details? Working incorrectly is pretty vague. What is the behavior that you see? Any video / image to follow up?

@dungle27
Copy link
Author

dungle27 commented Jun 2, 2020

Thanks to reply!
In image 1:slider working perfect and smooth but when I click fullVideo button it will render a screen (please refer image 2)
In Image 2, when I drag slider then slider working incorrect. It can't drag smooth.
Code in comment above...please help me fix this problem. Is it relate vertical slider??

==============
20200602_094100
20200602_094034

@charliesbot
Copy link
Owner

Could you give me more details? From the pictures, I can see it renders correctly. what is failing? Is it slow?

Also, in which OS is working differently? iOS, Android, or both?

@dungle27
Copy link
Author

dungle27 commented Jun 2, 2020

yes, render view is correct but when drag slider it not smooth
Sometime, I dragged the slider to the left but it moved to the right.
I tested on android.
You can try it with my code.

@charliesbot
Copy link
Owner

@dungle27, please notice that this library is just a UI overlay on top of any player. That means that I don't control how the controls behave, that's on your end. I don't handle any video player state, I just got the props based on what the events that you use.

I added more cases in the example project (PR -> #32) that may help you to debug your case.

Eg, in this issue your mention that the controls don't loop. If you enable the repeat option, that means you don't need the state ENDED, as you will never reach it. Based on that, I just removed that line in the onEnd event.

About the rotating issue, what you may do instead of rotating the components by yourself, you might change the orientation of the device. In the past I used https://github.com/yamill/react-native-orientation to change to landscape when the user taps on the fullscreen button.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants