Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Muting local audio and video streams #8

Open
georgeinva2004 opened this issue Oct 5, 2021 · 1 comment
Open

Muting local audio and video streams #8

georgeinva2004 opened this issue Oct 5, 2021 · 1 comment

Comments

@georgeinva2004
Copy link

Your work on this is BRILLIANT!!!! Thank-you.

I'm trying to mute the local audio and video on my Xamarin app. Based on WebRTC documentation found elsewhere, this should work to mute and unmute during each invocation. The localAudioTrack.Enabled propery gets set properly in the debugger, but on the next invocation the Enabled property doesn't retain the setting. Am I doing it the wrong way?

`private void ToggleMute()
{

var userMedia = await WebRTCme.CrossWebRtc.Current.Window().Navigator().MediaDevices.GetUserMedia(_constraints);
var localAudioTrack = userMedia.GetAudioTracks()[0];
localAudioTrack.Enabled = !localAudioTrack.Enabled;

}`

@georgeinva2004
Copy link
Author

On the Blazor side, the above code gives a not implemented exception which I believe is happening in WebRTCme.Blazor.Custom.WebRtc.cs. It looks like it's the conditional compilation below. Is this really necessary for the Blazor implementation?

`
internal class WebRtc : IWebRtc
{
public static IWebRtc Create() => new WebRtc();

    public void Dispose()
    {
    }

#if NETSTANDARD
public IWindow Window(IJSRuntime jsRuntime) => throw new NotImplementedException();
#else
public IWindow Window(IJSRuntime jsRuntime) => WebRTCme.Bindings.Blazor.Api.Window.Create(jsRuntime);
#endif
}
`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant