简体   繁体   English

我如何在 Android koltin 中为 exoPlayer 创建一个 Pip

[英]How can i create a Pip for exoPlayer in Android koltin

I want to create a picture in picture in android kotlin with navigation componenet but i want that show in app and dont close the app how can i do that Does anyone have an example of it?我想在带有导航组件的 android kotlin 中创建画中画,但我希望在应用程序中显示并且不关闭应用程序我该怎么做有人有它的例子吗?

As mentioned in the official documentation.如官方文档中所述。

By default, the system does not automatically support PiP for apps.默认情况下,系统不会自动支持应用程序的画中画。 If you want to support PiP in your app, register your video activity in your manifest by setting android:supportsPictureInPicture to true.如果您想在您的应用中支持画中画,请通过将 android:supportsPictureInPicture 设置为 true 在您的清单中注册您的视频活动。 Also, specify that your activity handles layout configuration changes so that your activity doesn't relaunch when layout changes occur during PiP mode transitions.此外,指定您的活动处理布局配置更改,以便您的活动不会在画中画模式转换期间发生布局更改时重新启动。

<activity android:name="VideoActivity"
android:supportsPictureInPicture="true"
android:configChanges=
    "screenSize|smallestScreenSize|screenLayout|orientation"

Read rest steps from documentation here: Pip support在此处阅读文档中的其余步骤: Pip 支持

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM