PiP Feature

Last Updated on : 2024-11-18 02:37:59download

Picture-in-picture (PiP) is available in two types: system PiP and in-app PiP. If the system PiP feature does not work correctly, the in-app PiP feature automatically turns on.

  • To use PiP, you need to update the SDK and UI BizBundle to version 5.17.0 or later.
  • If you have already implemented the system PiP feature, do not use the PiP feature from the UI BizBundle to prevent any issues.

System PiP

To use the system PiP feature, ensure the following conditions are met:

  • The device system version is iOS 15.0 or later.
  • The background audio permission is enabled for the app project.

Function configuration

Configure the PiP feature entry on the Tuya Developer Platform. The steps are as follows:

  1. Log in to Tuya Developer Platform, and click Product > Development to enter the Product Development page. Find your product and click Develop in the Operation column.

  2. Click Device Interaction > Panel Control, select your panel, and click Edit Panel.

    PiP Feature
  3. Click Configure Functions, enable FloatingWindow, and click Save.

    PiP Feature

Permission configuration

  1. Open the project settings.

  2. Select the main target of your project under TARGETS and then click Signing & Capabilities > + Capability.

    PiP Feature
  3. Click Background Modes and select Audio, AirPlay, and Picture in Picture to enable background audio and PiP.

    The configuration is as shown in the image below:

    PiP Feature
  4. In thing_custom_config.json, set need_backgroud_audio to true to ensure PiP loads correctly.

App Store review guidelines

The background audio permission is subject to strict review by the App Store. To avoid rejection when submitting your app after enabling PiP, provide the following description:

  • Necessity description: State that PiP enhances the video experience by working in the background.
  • Direction for use: Include detailed instructions on how to use PiP.
  • Video demonstration: Record a video showing how PiP works, upload it to YouTube, and include the link in the review notes.

In-app PiP

The in-app PiP feature displays videos using a custom UI and turns off automatically when the app goes into the background. If the device system version is not supported or configuration issues occur, the in-app PiP will turn on automatically.