PIP Mode Support
This API is available in Flower Android SDK version 2.8.0 and later.
Flower SDK can correctly handle Picture-in-Picture behavior when ads are displayed as overlay on top of existing content (for example, VOD midroll cases when Flower Player is not used). To ensure proper behavior during PiP mode transitions, the application should notify the SDK about Picture-in-Picture state changes using the following API:
FlowerSdk.notifyPictureInPictureModeChanged(isInPictureInPictureMode: Boolean)
Below is an Android source code example:
Java
public class YourActivity extends Activity {
...
@Override
public void onPictureInPictureModeChanged(boolean isInPictureInPictureMode, @Nullable Configuration newConfig) {
super.onPictureInPictureModeChanged(isInPictureInPictureMode, newConfig);
// TODO GUIDE: Notify Flower SDK about Picture-in-Picture mode changes
FlowerSdk.notifyPictureInPictureModeChanged(isInPictureInPictureMode);
}
...
}
Kotlin
class YourActivity : Activity() {
...
override fun onPictureInPictureModeChanged(isInPictureInPictureMode: Boolean, newConfig: Configuration?) {
super.onPictureInPictureModeChanged(isInPictureInPictureMode, newConfig)
// TODO GUIDE: Notify Flower SDK about Picture-in-Picture mode changes
FlowerSdk.notifyPictureInPictureModeChanged(isInPictureInPictureMode)
}
...
}