melihercan / WebRTCme

A cross-platform framework for adding WebRTC support to .NET MAUI, Blazor, and Desktop applications by using a single unified .NET/C# API.
https://github.com/melihercan/WebRTCme
MIT License
230 stars 46 forks source link

Please help regarding usage with .NET 6 / current source #15

Closed Eagle3386 closed 1 year ago

Eagle3386 commented 2 years ago

@melihercan great repo, great project - I'm trying to get things working with MAUI (probably MAUI Blazor at first) & I already saw in your latest code that you're trying to do the same.

However, using VS 2022 17.2 preview 2.0, I had quite a hard time figuring out everything what's needed to upgrade to .NET 6. That's because .NET 5 is out of support in early May this year. After that, I'm pretty stuck with how to launch your project so that I get a working video call in 2 browser tabs/windows without the other party using Android Emulator, iOS/Xamarin, etc. - just a simple peer to peer video call in the browser that I can then consume from a MAUI Blazor app.

Please, help me out on this prior to your next code commit(s) push that you've announced last November in the ReadMe of this repo.

melihercan commented 2 years ago

As I mentioned on the other posts, I'm completely overloaded with commercial projects and don't have time, even on weekends, to add features, fix issues , or improve this project. I'm hopeful that things will calm down in the next weeks so that I can deal with both requested and planned modifications.

Currently the project supports .NET 6 for WEB (Blazor) components.

.NET MAUI is on my to-do list, but I'll need some time to implement it. Aside from that, MAUI is yet to be formally released. You can, however, attempt to include them. There are two things you must do: 1.) Add the MAUI framework libraries to the WebRTCme project. That is the simple part. 2.) Creating bindings from WebRTC native code would be a real challenge. Please take a look how this is currently done for iOS and Android Xamarin projects on WebRTCme. Bindings/Xamarin folder. WebRTCme.Bindings/MAUI shall be added similar way..

Eagle3386 commented 2 years ago

While you've got my full respect for your commercial projects, would you still push your local, current state (if broken, maybe to a separate "unfinished" branch) here on GitHub? Please, Melih! 🥺

Just so that I can take a look on how you've already started to move forward with WebRTCme. Of course, I'll promise to start contributing immediately - after all, that's what open source is all about, right? ;)

melihercan commented 2 years ago

The code in github is up to date (latest). I don't have any local changes.

Eagle3386 commented 2 years ago

But there are https://github.com/melihercan/WebRTCme/blob/ac86ce6c42edfe524409aa7c7f0534a580dab051/WebRTCme/WebRTCme.csproj#L81 & https://github.com/melihercan/WebRTCme/blob/ac86ce6c42edfe524409aa7c7f0534a580dab051/WebRTCme/WebRTCme.csproj#L90 which both reference MAUI projects not available here on GitHub? 🤔

melihercan commented 2 years ago

Yes I once started to test MAUI for WebRTC native bindings, but at that time it didn't work. So I deleted them. You can get them from my old commits.

Bohdandn commented 2 years ago

@Eagle3386 I've also tried to create bindings for MAUI, Android works, iOS fails - https://github.com/Bohdandn/MAUI.WebRTC.Demo

Eagle3386 commented 2 years ago

Sorry for the late reply, @Bohdandn - been busy with work.. 🙈

Since I'm on the MAUI side of .NET life (MAUI Blazor, to be precise), I chose to go down the IJsInterop path. That means I kept all that video inputs detection/switching, participants handling (except the actual announcing which is done via SignalR) &, of course, adding/removing the actual streams from the HTML UI container in a JavaScript file. Via lazy-loading, the aforementioned IJsInterop derived class offers async/await conform, ValueTask based methods for calls from my Razor components/pages.

But that's just because at the time I had to choose that "path" I talked about earlier, it seemed to me that non-Blazor MAUI wasn't capable of interacting with WebRTC otherwise. If that changed meanwhile, I simply don't know - but since I refuse to do NodeJS & there's, at least to my knowledge, still no native .NET implementation for WebRTC available (IIRC, the MAUI repo had an issue where this was discussed, but postponed at least until after .NET 7's release), I consider my MAUI Blazor approach the best for the time being for anyone who dislikes the existing alternatives. 😉

Bohdandn commented 2 years ago

Thank you @Eagle3386 for your reply! I'm using Xamarin forms and planning migration to MAUI. MAUI Blazor and other web view based solutions are not an option for me because iOS prior to 14.3 doesn't support WebRTC in web view - https://blog.bitsrc.io/ios-14-3-brings-webrtc-to-wkwebview-closing-gap-on-ios-accessibility-90a83fa6bda2 that is an issue for me. Good news - it seems Xamarin team has fixed framework binding issue and we will get update soon -https://github.com/xamarin/xamarin-macios/issues/15289.

melihercan commented 2 years ago

Started adding MAUI support...

Bohdandn commented 2 years ago

@melihercan Your current MAUI binding library still have the same issue as my demo. I've created issue in ios tooling repo - https://github.com/xamarin/xamarin-macios/issues/16001

melihercan commented 2 years ago

@Bohdandn I don't have this problem and I can build it. Now I don't remember what I did :) but it builds fine as shown below:

Rebuild started... Restored C:\dev\WebRTCme\WebRTCme.Bindings\Xamarin\WebRTCme.Bindings.Xamarin.iOS\WebRTCme.Bindings.Xamarin.iOS.csproj (in 73 ms). Restored C:\dev\WebRTCme\WebRTCme.Bindings\Xamarin\WebRTCme.Bindings.Xamarin.Android\WebRTCme.Bindings.Xamarin.Android.csproj (in 73 ms). Restored C:\dev\WebRTCme\WebRTCme.Bindings\Desktop\WebRTCme.Bindings.Desktop.macOS\WebRTCme.Bindings.Desktop.macOS.csproj (in 122 ms). Restored C:\dev\WebRTCme\WebRTCme.Connection\MediaSoup\WebRTCme.Connection.MediaSoup.Proxy\WebRTCme.Connection.MediaSoup.Proxy.csproj (in 398 ms). Restored C:\dev\WebRTCme\WebRTCme.DemoApp\Xamarin\WebRTCme.DemoApp.Xamarin.iOS\WebRTCme.DemoApp.Xamarin.iOS.csproj (in 432 ms). Restored C:\dev\WebRTCme\WebRTCme.Bindings\Desktop\WebRTCme.Bindings.Desktop.Windows\WebRTCme.Bindings.Desktop.Windows.csproj (in 543 ms). Restored C:\dev\WebRTCme\WebRTCme.DemoApp\Xamarin\WebRTCme.DemoApp.Xamarin.Android\WebRTCme.DemoApp.Xamarin.Android.csproj (in 556 ms). Restored C:\dev\WebRTCme\WebRTCme.DemoApp\Xamarin\WebRTCme.DemoApp.Xamarin\WebRTCme.DemoApp.Xamarin.csproj (in 570 ms). Restored C:\dev\WebRTCme\WebRTCme.Bindings\Maui\WebRTCme.Bindings.Maui.Android\WebRTCme.Bindings.Maui.Android.csproj (in 2 ms). Restored C:\dev\WebRTCme\WebRTCme.Bindings\Maui\WebRTCme.Bindings.Maui.iOS\WebRTCme.Bindings.Maui.iOS.csproj (in 15 ms). Restored C:\dev\WebRTCme\WebRTCme.Bindings\WebRTCme.Bindings.Blazor\WebRTCme.Bindings.Blazor.csproj (in 37 ms). Restored C:\dev\WebRTCme\WebRTCme.Connection\MediaSoup\WebRTCme.Connection.MediaSoup\WebRTCme.Connection.MediaSoup.csproj (in 48 ms). Restored C:\dev\WebRTCme\WebRTCme.Connection\Signaling\WebRTCme.Connection.Signaling.Proxy\WebRTCme.Connection.Signaling.Proxy.csproj (in 201 ms). Restored C:\dev\WebRTCme\WebRTCme.Middleware\WebRTCme.Middleware.Blazor\WebRTCme.Middleware.Blazor.csproj (in 598 ms). Restored C:\dev\WebRTCme\WebRTCme.Middleware\WebRTCme.Middleware.Xamarin\WebRTCme.Middleware.Xamarin.csproj (in 753 ms). Restored C:\dev\WebRTCme\WebRTCme.Connection\MediaSoup\WebRTCme.Connection.MediaSoup.Server\WebRTCme.Connection.MediaSoup.Server.csproj (in 262 ms). Restored C:\dev\WebRTCme\WebRTCme.Connection\WebRTCme.Connection\WebRTCme.Connection.csproj (in 158 ms). Restored C:\dev\WebRTCme\WebRTCme.Connection\Signaling\WebRTCme.Connection.Signaling\WebRTCme.Connection.Signaling.csproj (in 116 ms). Restored C:\dev\WebRTCme\WebRTCme.Connection\Signaling\WebRTCme.Connection.Signaling.Server\WebRTCme.Connection.Signaling.Server.csproj (in 11 ms). Restored C:\dev\WebRTCme\WebRTCme.Api\WebRTCme.Api.csproj (in 22 ms). Restored C:\dev\WebRTCme\WebRTCme\WebRTCme.csproj (in 739 ms). Restored C:\dev\WebRTCme\WebRTCme.Middleware\WebRTCme.Middleware.Maui\WebRTCme.Middleware.Maui.csproj (in 1.09 sec). Restored C:\dev\WebRTCme\WebRTCme.DemoApp\Blazor\WebRTCme.DemoApp.Blazor\WebRTCme.DemoApp.Blazor.csproj (in 378 ms). Restored C:\dev\WebRTCme\WebRTCme.Middleware\WebRTCme.Middleware\WebRTCme.Middleware.csproj (in 746 ms). Restored C:\dev\WebRTCme\WebRTCme.DemoApp\Blazor\WebRTCme.DemoApp.Blazor.Wasm\WebRTCme.DemoApp.Blazor.Wasm.csproj (in 401 ms). Restored C:\dev\WebRTCme\WebRTCme.DemoApp\WebRTCme.DemoApp.Maui\WebRTCme.DemoApp.Maui.csproj (in 1.2 sec). 1>------ Rebuild All started: Project: WebRTCme.Bindings.Maui.iOS, Configuration: Debug Any CPU ------ 1>Executing SayHello Task to establish a connection to a Remote Server. 1> Properties: 1> SessionId=f810c8edcfbcbeec7076675db50701cde4c4a743a05b89ef069eb5310f24e4be, 1> Addresss=192.168.1.26, 1> SshPort=22, 1> TcpPort=52269, 1> User=melihercan, 1> AppName=WebRTCme.Bindings.Maui.iOS, 1> VisualStudioProcessId=7732, 1> ContinueOnDisconnected=False 1>/Users/melihercan/Library/Caches/Xamarin/XMA/SDKs/dotnet/dotnet /Users/melihercan/Library/Caches/Xamarin/XMA/SDKs/dotnet/packs/Microsoft.iOS.Sdk/15.4.447/tools/lib/bgen/bgen.dll @/Users/melihercan/Library/Caches/Xamarin/mtbs/builds/WebRTCme.Bindings.Maui.iOS/f810c8edcfbcbeec7076675db50701cde4c4a743a05b89ef069eb5310f24e4be/obj/Debug/net6.0-ios/response-file.rsp 1>C:\Program Files\dotnet\packs\Microsoft.iOS.Sdk\15.4.447\tools\msbuild\iOS\Xamarin.Shared.targets(1618,3): warning BI1111: bgen: Interface 'Webrtc.IRTCVideoDecoderFactory' on 'Webrtc.RTCVideoDecoderFactoryH264' is being ignored as it is not a protocol. Did you mean 'RTCVideoDecoderFactory' instead? 1>C:\Program Files\dotnet\packs\Microsoft.iOS.Sdk\15.4.447\tools\msbuild\iOS\Xamarin.Shared.targets(1618,3): warning BI1111: bgen: Interface 'Webrtc.IRTCVideoDecoder' on 'Webrtc.RTCVideoDecoderH264' is being ignored as it is not a protocol. Did you mean 'RTCVideoDecoder' instead? 1>C:\Program Files\dotnet\packs\Microsoft.iOS.Sdk\15.4.447\tools\msbuild\iOS\Xamarin.Shared.targets(1618,3): warning BI1111: bgen: Interface 'Webrtc.IRTCVideoEncoder' on 'Webrtc.RTCVideoEncoderH264' is being ignored as it is not a protocol. Did you mean 'RTCVideoEncoder' instead? 1>C:\dev\WebRTCme\WebRTCme.Bindings\Maui\WebRTCme.Bindings.Maui.iOS\obj\Debug\net6.0-ios\iOS\Webrtc\RTCCertificate.g.cs(94,27,94,31): warning CS8767: Nullability of reference types in type of parameter 'zone' of 'NSObject RTCCertificate.Copy(NSZone zone)' doesn't match implicitly implemented member 'NSObject INSCopying.Copy(NSZone? zone)' (possibly because of nullability attributes). 1>WebRTCme.Bindings.Maui.iOS -> C:\dev\WebRTCme\WebRTCme.Bindings\Maui\WebRTCme.Bindings.Maui.iOS\bin\Debug\net6.0-ios\WebRTCme.Bindings.Maui.iOS.dll 1>Done building project "WebRTCme.Bindings.Maui.iOS.csproj". ========== Rebuild All: 1 succeeded, 0 failed, 0 skipped ==========

Bohdandn commented 2 years ago

In my case library itself compiles successfully as well. If you will reference it by maui app it’s compilation will fail. I’ve also tried to reference your library - same issue. Also output of our libs compilation is different - framework goes in separate directory, not embedded like with xam.

melihercan commented 2 years ago

Well @Bohdandn , in my case I have 2 layers between Maui app and the bindings: WebRTCme and WebRTCme.Middleware. With this configuration all is compiling without any issues. Will this run is another question but at least it builds fine.

Eagle3386 commented 1 year ago

Closing, because I moved on with a 3rd party library (Twilio) for signaling call requests / room handling & whole project structure continues to confuse me way too much in order to consider switching back from it.

Don't get me wrong, it's still awesome that you're trying to build such a library & I'd happily switch to it - but IMHO, that requires a complete cleanup of the project (leftovers, "try & error" parts within the code, etc.).

Finally, after switching to said 3rd party library & completing the app, I left the company for which I developed it.