2

我在 react 本机应用程序中使用Zoom SDK来开始和加入会议。我需要在 Zoom SDK 上覆盖一个自定义视图,或者在其上方或下方插入一个自定义视图,以显示其他应用程序控件和设置。该文档似乎没有涵盖这样的用例。

有没有人有这方面的经验,或者关于如何进行的任何建议?

4

1 回答 1

1

我猜你正在寻找画中画 - 画中画。

如果是,我认为,您将需要使用自定义本机代码,因为它对于 iOS 来说相对较新:“在 iOS 13 中,Apple 为 iPad 添加了画中画模式,而在 iOS 14 中,画中画功能是也适用于 iPhone。” https://www.macrumors.com/guide/picture-in-picture/

在 Android 中,它工作了一段时间:https ://developer.android.com/guide/topics/

在编写自定义原生代码或库之前,您还可以从这个现有的仅限 Android 的库中获取灵感:https ://github.com/shaun-chiang/rn-android-pip

并来自 iOS 文档:https ://developer.apple.com/documentation/avkit/adopting_picture_in_picture_in_a_custom_player

如果您不是在寻找画中画支持,您可能需要在 Zoom 组件之上安装 iOS UIView 或 Android View - 但我不确定这样做是否会破坏 ZOOM 的某些 SLA。

在 Android 中,要将片段视图添加到顶部 / 作为叠加层,您需要一些如下代码:

getSupportFragmentManager()
    .beginTransaction()
    .add(android.R.id.content, fragment) - // add view to the RootView 
    .commit();

在 iOS 中可能是这样的:

 UIApplication.shared.keyWindow?.addSubview(myCustomUIView)

如果您正在寻找有关在 React Native 中使用本机组件的教程,我可以推荐:

这适用于 iOS https://pspdfkit.com/blog/2018/how-to-extend-react-native-api/

这适用于 Android(由我编写) https://stefanmajiros.medium.com/integration-of-native-android-fragments-and-views-into-react-native-a4156621543b

于 2021-01-21T20:52:38.583 回答