jatecl / WebrtcSharp

Webrtc .Net API

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Audio play automatically when the track is loaded to the stream.

michferrero opened this issue · comments

Hi,

when the WebRTC connection is active between the peer and the application in C#. I load the trace coming from the peer and insert it in the PeerConnection, the audio plays automatically from my application. Is there any way to control this playback? Stop playback and resume it whenever you want?

Thanks everyone.

When adding the trace to the app's conncectionPeer:

connection.TrackAdded += delegate (RtpReceiver rtpReceiver)
            {
                log.Info("Track Added proveniente dal PEER remoto");
                MediaStreamTrack mediaStreamTrack = rtpReceiver.Track;
                AudioTrack audioTrack = (AudioTrack)mediaStreamTrack;

This instruction disables application-side audio playback in C #
audioTrack.Enabled = false;