pub async fn add_transceiver_from_track<'a>(
        &'a self,
        track: Arc<dyn TrackLocal + Send + Sync>,
        init: &'a [RTCRtpTransceiverInit],
    ) -> Result<Arc<RTCRtpTransceiver>> {
        if self.internal.is_closed.load(Ordering::SeqCst) {
            return Err(Error::ErrConnectionClosed);
        }

        let direction = match init.len() {
            0 => RTCRtpTransceiverDirection::Sendrecv,
            1 => init[0].direction,
            _ => return Err(Error::ErrPeerConnAddTransceiverFromTrackOnlyAcceptsOne),
        };

        let t = self
            .internal
            .new_transceiver_from_track(direction, track)
            .await?;

        self.internal.add_rtp_transceiver(Arc::clone(&t)).await;

        Ok(t)
    }
/// add_transceiver_from_track Create a new RtpTransceiver(SendRecv or SendOnly) and add it to the set of transceivers.
add_transceiver_from_track Create a new RtpTransceiver(SendRecv or SendOnly) and add it to the set of transceivers.
add_transceiver_from_track Create a new RtpTransceiver ( SendRecv or SendOnly ) and add it to the set of transceivers .
pub async fn add_transceiver_from_track<'a>(
        &'a self,
        track: Arc<dyn TrackLocal + Send + Sync>,
        init: &'a [RTCRtpTransceiverInit],
    ) -> Result<Arc<RTCRtpTransceiver>> {
        if self.internal.is_closed.load(Ordering::SeqCst) {
            return Err(Error::ErrConnectionClosed);
        }
        let direction = match init.len() {
            0 => RTCRtpTransceiverDirection::Sendrecv,
            1 => init[0].direction,
            _ => return Err(Error::ErrPeerConnAddTransceiverFromTrackOnlyAcceptsOne),
        };
        let t = self
            .internal
            .new_transceiver_from_track(direction, track)
            .await?;
        self.internal.add_rtp_transceiver(Arc::clone(&t)).await;
        Ok(t)
    }
pub async fn add_transceiver_from_track < ' a > ( & ' a self , track : Arc < dyn TrackLocal + Send + Sync > , init : & ' a [ RTCRtpTransceiverInit ] , ) -> Result < Arc < RTCRtpTransceiver > > { if self . internal . is_closed . load ( Ordering :: SeqCst ) { return Err ( Error :: ErrConnectionClosed ) ; } let direction = match init . len ( ) { 0 => RTCRtpTransceiverDirection :: Sendrecv , 1 => init [ 0 ] . direction , _ => return Err ( Error :: ErrPeerConnAddTransceiverFromTrackOnlyAcceptsOne ) , } ; let t = self . internal . new_transceiver_from_track ( direction , track ) . await ? ; self . internal . add_rtp_transceiver ( Arc :: clone ( & t ) ) . await ; Ok ( t ) }
add_transceiver_from_track Create a new RtpTransceiver(SendRecv or SendOnly) and add it to the set of transceivers.
add_transceiver_from_track Create a new RtpTransceiver ( SendRecv or SendOnly ) and add it to the set of transceivers .
&'a self
track
Arc<dyn TrackLocal + Send + Sync>
init
&'a [RTCRtpTransceiverInit]