dotnet / MobileBlazorBindings

Experimental Mobile Blazor Bindings - Build native and hybrid mobile apps with Blazor
MIT License
1.2k stars 174 forks source link

Webrtc support blazorwebview #304

Open sowsan opened 3 years ago

sowsan commented 3 years ago

Can Blazorwebview support webrtc ? E.g https://appr.tc

Eilon commented 3 years ago

Hi @sowsan can you share more info about what you're trying to do?

toklive commented 3 years ago

I am also trying similar and experimenting with moblieblazor bindings. Idea is to build a simple example like here, https://www.twilio.com/blog/build-video-chat-app-asp-net-core-blazor-webassembly-twilio-video. It is using webrtc behind the scene, So trying to see if a hybrid app using html works or not. thanks for your comments!

pietrodicaprio commented 3 years ago

I believe che "challenge" is in showing the permissions request to the user and then set the feedback on the browser 🤔

sowsan commented 3 years ago

I found these two in stackoverflow talking about how we can achieve it with Xamarin webview

https://stackoverflow.com/questions/59771557/xamarin-requesting-camera-permissions-in-webview https://stackoverflow.com/questions/62295556/xamarin-forms-webview-not-working-with-webrtc

@Eilon - any suggestion on how to use the permission request for web to access camera and microphone with mobilebindings ? here is the simple web to test it : https://appr.tc

Eilon commented 3 years ago

It's not an area I'm familiar with but I'll keep this issue open so that we can have a look. There probably isn't anything specific to this area because it's probably a general issue of running on devices with permissions. I think the StackOverflow issues you point to are probably the best answer because they both link to a blog post written by a Xamarin team member. The same technique probably works for any permission, and it'll all be general Xamarin behaviors that are OS-specific.

Docs:

vincenzonaked commented 3 years ago

I think the problem is in the fact that blazor is run locally on the device with the app: // scheme while in webrtc it is necessary that the entire web app has as its origin https: // I also tried to set the permissions with little success; debugging with chrome shows that navigator.mediaDevices is "undefined" and usually means that it is not available because the source is not in https. Anyone have ideas on possible solutions? In my case the whole app is based on webrtc. WebRtc work only in http://localhost or from https://domain.com

Apart from that Blazor Mobile Binding is a fantastic solution for someone like me who wants to use Blazor (not server side) but without the limitations of Blazor WebAssembly (bad user experience on first start-up, and anyway whenever you need to reload in my case for example when to apply the localization change)