-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
feat: add getCurrentPosition to component's ref #3824
feat: add getCurrentPosition to component's ref #3824
Conversation
Looks good to me, Just one note, I would prefer having the time in msec instead of sec. @KrzysztofMoch @YangJonghun what do you think of this point ? |
android/src/main/java/com/brentvatne/react/VideoManagerModule.kt
Outdated
Show resolved
Hide resolved
As far as I know, |
@YangJonghun you're correct! In situations where the user only needs to get the current position when interacting with custom controls, such as the rewind and forward buttons, it's not necessary to use a callback function that is called every progress update interval. Instead, the user can use this approach that is only called when the user clicks the rewind or forward buttons. When a button is clicked, you can get the current position and then seek forward or backward based on the button that was clicked. |
@seyedmostafahasani |
So now what is your opinion about the response of this function, second or millisecond? |
@seyedmostafahasani |
I completely agree with you about second. |
As C developer I prefer working with integer, but if you are ok for sec, then OK for me ! |
android/src/main/java/com/brentvatne/exoplayer/ReactExoplayerView.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See my comment for android
@freeboub @KrzysztofMoch @seyedmostafahasani |
@YangJonghun I think we can use them with Fabric, but an important point is that these are deprecated methods on the native or JS side. Utilizing deprecated methods on the native or JS side may result in these functions not working correctly. I recommend checking out |
@seyedmostafahasani Currently we use |
@YangJonghun Oh yes, you're right. Thanks for the detailed explanation. I was referring to the deprecated method |
@seyedmostafahasani I guess I'll have to keep it for now and find a tricky way around it. Because we don't know when RN team get rid of findNodeHandle. |
@YangJonghun anytime! I agree with you, we can keep it for now. Also, if I find a better solution, I will share it with you. |
Summary
This function retrieves and returns the precise current position of the video playback, measured in seconds.
Motivation
The goal is to provide users with the ability to access the current position of the video playback. This allows for the creation of custom controls like forward and rewind buttons, enhancing user experience.
Changes
A new function
getCurrentPosition
has been added to the component's ref.Test plan