# Fullscreen and Picture-in-Picture

While Vindral Live player has support for running in fullscreen mode and Picture-in-Picture (PiP) mode, there are some caveats to be aware of.

The [Vindral Player](https://docs.vindral.com/web-sdk/api/player/interfaces/Player.md) is a web component-based player with built-in buttons for fullscreen and picture-in-picture (PiP). When integrating the Vindral Web SDK, you'll need to handle the features yourself.

> **Info**
>
> If you are using WebCodecs or another canvas-rendered playback path, `streamToMediaElementEnabled: true` is required for Picture-in-Picture support and is the recommended way to retain media-element fullscreen/PiP behavior in non-MSE playback. See [WebCodecs & Offscreen Renderer](https://docs.vindral.com/playback/websdk/webcodecs-offscreen-renderer.md) for the decoder and rendering-path tradeoffs. On iPhone, this path also keeps audio playing in the background; see [Background playback](https://docs.vindral.com/playback/websdk/background-playback.md).

## Picture-in-Picture

[Vindral SDK provides a Picture-in-Picture helper](https://docs.vindral.com/web-sdk/api/web-sdk/classes/Vindral.md#pictureinpicture) that you can use to query for support and toggle PiP mode programmatically. If you have requirements on look and feel of the PiP window, you can use the Picture-in-Picture API directly instead.
Read more about the [Picture-in-Picture API](https://developer.mozilla.org/en-US/docs/Web/API/Picture-in-Picture_API) and make sure to understand the limitations and requirements for using it.

If playback stays on a canvas without the media-element bridge, PiP is not available.

One such limitation is that some Android devices, for instance, require fullscreen to be active before PiP can be activated automatically through the Picture-in-Picture API (home screen button). This is not a limitation in Vindral Web SDK, but a limitation in the Picture-in-Picture API itself.

## Fullscreen

When integrating the Vindral Web SDK, you need to handle fullscreen mode yourself, you can use the Fullscreen API directly. Read more about the [Fullscreen API](https://developer.mozilla.org/en-US/docs/Web/API/Fullscreen_API) and make sure to understand the limitations and requirements for using it.

If you are building on the canvas-rendered playback path and want fullscreen/PiP behavior through a standard media element, enable `streamToMediaElementEnabled`.

## Native

Android WebView does not support the Picture-in-Picture API, so an Android app has to use Android's own Picture-in-Picture mode instead. See [Native Android](https://docs.vindral.com/playback/native/native-android.md).

Have a look at the [native examples](https://github.com/RealSprint/vindral-examples-webview) for information regarding how to toggle fullscreen and PiP on native iOS/Android.
