Kotlin
アクティビティでピクチャー・イン・ピクチャーを有効にする
ビデオ通話をホストするアクティビティで、PiP とサイズ変更属性を設定し、PiP に入るときにアクティビティが再作成されないように設定変更を処理します:
<activity
android:name=".MainActivity"
android:configChanges="screenSize|smallestScreenSize|screenLayout|orientation"
android:exported="true"
android:resizeableActivity="true"
android:supportsPictureInPicture="true"
android:theme="@style/Theme.PictureInPicture">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
| 属性 | 目的 |
|---|---|
supportsPictureInPicture | この活動がPiPに入る可能性があることを宣言する |
resizeableActivity | 多くのデバイスでのマルチウィンドウ/PiPに必要 |
configChanges | PiPのサイズ/方向性の変化に関する活動を破壊することを避ける |
ピクチャー・イン・ピクチャー
Vonage Video SDKを使用してアプリにPicture in Picture機能を追加する方法をご紹介します。
以下の言語で利用可能:
手順
1
はじめに2
はじめに3
新規プロジェクトの作成4
Android SDKの追加5
認証の設定6
アクセス許可の申請7
アクティビティでピクチャー・イン・ピクチャーを有効にする8
動画視聴用のコンテナを提供する9
ピクチャー・イン・ピクチャーの起動10
PiP モードの変更を管理する11
アプリの実行12
結論