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

Add support for NativeScript 6, and playback inside modals on Android #47

Merged
merged 1 commit into from Sep 2, 2019

Conversation

EddyVerbruggen
Copy link
Contributor

Hey @triniwiz,

I was trying to show a video inside a modal in a NativeScript 6 app and found that it didn't work for two reasons:

  1. com.google.android.youtube.player.YouTubePlayerFragment extends android.app.Fragment directly, which means it's not compatible with AndroidX (and thus NativeScript 6). However, com.google.android.youtube.player.YouTubePlayerSupportFragment extends android.support.v4.app.Fragment which is.
  2. As mentioned in No View found error #40 the plugin can't resolve the correct view, but by using the right fragment manager we can get around this. It's a private function in NativeScript's core modules, but it seemed like the easiest way to fix this and I don't think it will be removed any time soon (or ever actually).

In case you accept this PR, please also publish a new version to npm because I'm sure more N6-using folks will encounter this issue. A major version bump would be a good idea because I'm not 100% sure it's backward compatible (didn't test it with N5).

Cheers,
Eddy

- NativeScript 6
- Showing the YT player inside modals (was already possible on iOS)
@EddyVerbruggen
Copy link
Contributor Author

Hey @triniwiz would you please consider merging this? I don't mind if not, then I'll know I'll have to ship it some other way in my app. Thx!

@triniwiz triniwiz merged commit a28b06e into triniwiz:master Sep 2, 2019
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

Successfully merging this pull request may close these issues.

None yet

3 participants