dotnet / dotnet/maui

Blazor Hybrid Android Throws Exception Not Supported Picture-In-Picture(PIP)

Open
#28,544 4 comments 0 reactions 0 assignees View on GitHub
area-blazor platform/android
Dominant language
C#
Stars
23.3k
Forks
2k
Avg merge
1d 15h
Merged PRs (30d)
290

Description

Application: Messaging Application (Chat and Video Calls) using SignalR and WebRTC
Framework: MAUI Blazor Hybrid

Android OS: 15 - API 35

.Net Version: 9

Is Picture-In-Picture supported in BlazorWebView?

You see i tried to implement a PIP that similar to video calls (Ex. Skype,Messenger,Instagram).

if i missing some declaration and implement please correct me or atleast give documentation for blazor hybrid thank you!

```





@_iceStatus









@code{
private async Task EnabledPIP()
{
await JSRuntime.InvokeVoidAsync("enablePiP");
}
}
```

I would like to execute a remote video at very least (it should be both but it seems pip only trigger one video).

```
async function enablePiP() {
const video = document.getElementById("remoteVideo");
if (video !== null && video.readyState >= 3) {
if (video.requestPictureInPicture) {
await video.requestPictureInPicture().catch(error => {
console.log('PiP failed:', error);
});
}
}
}
```

Added SupportPictureInPicture = true, ResizeableActivity = true in MainActivity.cs

```
[Activity(Theme = "@style/Maui.SplashTheme", MainLauncher = true, LaunchMode = LaunchMode.SingleTop, SupportsPictureInPicture = true, ResizeableActivity = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation | ConfigChanges.UiMode | ConfigChanges.ScreenLayout | ConfigChanges.SmallestScreenSize | ConfigChanges.Density)]
public class MainActivity : MauiAppCompatActivity
```
but unfortunately it still throws Not SupportedError

![Image](https://github.com/user-attachments/assets/abf7a4f3-914e-4118-9f4d-d7097cf5f7cf)

I already posted the same question in community no one answer so i posted here as well.

https://learn.microsoft.com/en-us/answers/questions/2237028/blazor-hybrid-android-ios-not-supported-picture-in

Thank you

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the NotSupportedError on Android API 35 using the BlazorWebView markup, the enablePiP JavaScript function, and the MainActivity.cs attributes shown in the issue. Check whether requestPictureInPicture is supported in this setup and whether one or both video elements can participate. Done means a verified supported path or clear documentation of the limitation and required configuration.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, csharp, javascript
Domain
mobile-dev
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.