-
-
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
[New Arch] Android Fabric #3204
base: master
Are you sure you want to change the base?
[New Arch] Android Fabric #3204
Conversation
private static final String PROP_DRM_LICENSESERVER = "licenseServer"; | ||
private static final String PROP_DRM_HEADERS = "headers"; | ||
private static final String PROP_SRC_HEADERS = "requestHeaders"; | ||
private static final String PROP_RESIZE_MODE = "resizeMode"; | ||
private static final String PROP_REPEAT = "repeat"; | ||
private static final String PROP_SELECTED_AUDIO_TRACK = "selectedAudioTrack"; | ||
private static final String PROP_SELECTED_AUDIO_TRACK_TYPE = "type"; |
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.
these changes change the api ?!
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.
Please look at this commit.
It would change api as you said.
But it's necessary.
For similar case, we can find out "selectedAudioTrack".
This naming change is needed because of CodeGen with "WithDefault".
We use WithDefault type for codegen, but with it, we cannot declare same naming of WithDefault.
* @return A HashMap containing the data that was in the ReadableMap. | ||
* @see 'Adapted from https://github.com/artemyarulin/react-native-eval/blob/master/android/src/main/java/com/evaluator/react/ConversionUtil.java' | ||
*/ | ||
public static Map<String, String> toStringMap(@Nullable ReadableMap readableMap) { |
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.
This function can be extracted to a helper function !
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.
Yeah it's true.
But we're not using it anywhere in the codebase.
So if you are okay, I will remove it.
But it's okay to move that function to another directory such as "helper"
"description": "A <Video /> element for react-native", | ||
"main": "lib/index", |
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.
I think this is an error here ?
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.
Nope. It's correct way.
We should export "src/index.ts"
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.
Oh, my bad.
I didn't know that you export build files.
yep, this should be changed to "lib/index"
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.
I've finished !
src/fabric/VideoNativeComponent.tsx
Outdated
@@ -0,0 +1,322 @@ | |||
import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent'; |
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.
Is there a way to factorize this file with VideoNativeComponent.ts already available on master ?
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.
Yep, I've finished that task.
We won't use 'src/fabric' folder anymore.
@yungblud thank you very much for the maintenance on this PR 🙏 |
@@ -1431,8 +1431,9 @@ public void onPlaybackParametersChanged(PlaybackParameters params) { | |||
|
|||
@Override | |||
public void onVolumeChanged(float volume) { | |||
eventEmitter.volumeChange(volume); | |||
} | |||
// todo |
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.
tado here
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.
I think onVolumeChanged and onAdError are new APIs
So I have to implement it for Fabric.
I will let you know when it's implemented.
} | ||
} | ||
eventEmitter.timedMetadata(metadataArray); | ||
// ArrayList<TimedMetadata> metadataArray = new ArrayList<>(); |
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.
commented code here also
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.
Yep, I cleaned it.
@freeboub Hello. No problem. |
@freeboub |
@freeboub hey, I think I've almost finished your review. |
Thanks for opening a PR!
Since this is a volunteer project and is very active, anything you can do to reduce the amount of time needed to review and merge your PR is appreciated.
The following steps will help get your PR merged quickly:
Update the documentation
For now, I don't know what to be added to README.md
Let me know if you want something to add.
Update the changelog
Provide an example of how to test the change
cd examples/FabricExample yarn yarn android
OR if above command doesn't work, you can directly
If you see build failure with Android Studio, you can try
open -a /Applications/Android\ Studio.app
Focus the PR on only one area
Testing multiple features takes longer than isolated changes and if there is a bug in one feature, prevents the other parts of your PR from getting merged until it gets fixed.
If you're touching multiple different areas that aren't related, break the changes up into multiple PRs.
Describe the changes
In this PR, we've implemented android fabric.
So there are lots of file changes in android directory.
We implemented Kotlin for fabric android.
Major changes
src/fabric
andsrc/oldarch
on android side.finished
(boolean) parameter on seek event for detecting when seek is finished.Deprecated methods (because of codegen doesn't support array callback parameters, see this issue)
React Native New Architecture's codegen doesn't support array callback parameters for native methods.
You can see this kind of comments for above methods on
src/fabric/VideoNativeComponent.tsx
.There are some meaningless file changes.
These files are changed because of simple lint issue. So you can skip that files.