-
-
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
chore: add setFullScreen to component's ref #3855
chore: add setFullScreen to component's ref #3855
Conversation
…eenPlayer & dismissFullscreenPlayer
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.
We cannot remove existing APIs on 6.X branch, I don't understand why you need this change. Can you please clarify ?
I think we can implement full-screen mode with just this function. We don't need two functions to handle it. Additionally, if we remove these functions, we will eliminate an unnecessary useState from the video component, which prevents re-rendering. Specifically, we will also fix another issue in the library, #3732. The main point is that we handle this logic with just one function. What is your opinion? |
@freeboub what do you think about my points? |
@seyedmostafahasani We cannot change api on V6.X, if we integrate such api change, we will need to bump to V7 and all apps using the package will have to upgrade their integration. as the team have a lot of api changes in mind, we try to keep api interoperability as much as possible. Here is a sample: I just move few props from the root of video to the source object, to avoid upgrade issue, I comment in doc that the old api is deprecated, and point to the new way to proceed. It will allow easy upgrade for apps, we keep in mind that old api (deprecated) can be removed on V7. |
I completely agree with you about deprecating the old API and planning to remove it in V7. I will add deprecation notices for both |
@seyedmostafahasani Thank you for the fix, following code shall be simplified: toggleDecoration() {
this.setState({decoration: !this.state.decoration});
if (this.state.decoration) {
this.video?.dismissFullscreenPlayer();
} else {
this.video?.presentFullscreenPlayer();
}
} |
…reen mode when controls are false
@freeboub I removed the controls condition in the |
I don't use native controls and fullscreen in this library, but I'm not sure if this breaking change is really necessary in this library. |
It is not a breaking change as previous api are still working! It is just a preparation for api clean up ! (Let say for V7) |
@freeboub |
Yes I agree, Fullscreen management is one of the next challenge I think... |
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.
LGTM
…eenPlayer & dismissFullscreenPlayer
Summary
I added
setFullScreen
to handle fullScreen mode without controls.Motivation
The user can use it to handle fullscreen mode with custom controls, specifically refactoring the codebase and fix this issue
Changes
I added a function called
setFullScreen
and deprecated the functionspresentFullscreenPlayer
anddismissFullscreenPlayer
.Test plan