This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.hms.quickline.presentation.call.webrtc.util | |
| import android.app.Application | |
| import org.webrtc.* | |
| class PeerConnectionUtil( | |
| context: Application, | |
| eglBaseContext: EglBase.Context | |
| ) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.hms.quickline.presentation.call.webrtc.observer | |
| import org.webrtc.SdpObserver | |
| import org.webrtc.SessionDescription | |
| class SdpObserverImpl( | |
| private val onCreateSuccessCallback: (SessionDescription) -> Unit = {}, | |
| private val onSetSuccessCallback: () -> Unit = {}, | |
| private val onCreateFailureCallback: (String) -> Unit = {}, | |
| private val onSetFailureCallback: (String) -> Unit = {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.hms.quickline.presentation.call.webrtc.observer | |
| import org.webrtc.* | |
| open class PeerConnectionObserver( | |
| private val onIceCandidateCallback: (IceCandidate) -> Unit = {}, | |
| private val onAddStreamCallback: (MediaStream) -> Unit = {}, | |
| private val onTrackCallback: (RtpTransceiver) -> Unit = {}, | |
| private val onDataChannelCallback: (DataChannel) -> Unit = {}, | |
| ) : PeerConnection.Observer { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.hms.quickline.presentation.call.webrtc.listener | |
| import org.webrtc.IceCandidate | |
| import org.webrtc.SessionDescription | |
| class SignalingListenerObserver( | |
| private val onConnectionEstablishedCallback: () -> Unit = {}, | |
| private val onOfferReceivedCallback: (SessionDescription) -> Unit = {}, | |
| private val onAnswerReceivedCallback: (SessionDescription) -> Unit = {}, | |
| private val onIceCandidateReceivedCallback: (IceCandidate) -> Unit = {}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.hms.quickline.presentation.call.webrtc.listener | |
| import org.webrtc.IceCandidate | |
| import org.webrtc.SessionDescription | |
| interface SignalingListener { | |
| fun onConnectionEstablished() | |
| fun onOfferReceived(description: SessionDescription) | |
| fun onAnswerReceived(description: SessionDescription) | |
| fun onIceCandidateReceived(iceCandidate: IceCandidate) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.hms.quickline.presentation.call | |
| import android.media.MediaPlayer | |
| import android.os.Bundle | |
| import android.os.Handler | |
| import android.os.Looper | |
| import android.os.SystemClock | |
| import android.util.Log | |
| import androidx.appcompat.app.AppCompatActivity | |
| import androidx.core.view.isVisible |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.hms.quickline.presentation.call.webrtc | |
| import android.content.Context | |
| import android.util.Log | |
| import com.hms.quickline.core.util.Constants | |
| import com.hms.quickline.core.util.Constants.MEETING_ID | |
| import com.hms.quickline.core.util.Constants.UID | |
| import com.hms.quickline.data.model.CallsSdp | |
| import com.hms.quickline.data.model.ObjectTypeInfoHelper | |
| import com.hms.quickline.data.model.Users |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.hms.quickline.presentation.call.webrtc | |
| import android.util.Log | |
| import com.hms.quickline.presentation.call.webrtc.listener.SignalingListener | |
| import com.hms.quickline.core.util.Constants | |
| import com.hms.quickline.data.model.CallsCandidates | |
| import com.hms.quickline.data.model.CallsSdp | |
| import com.huawei.agconnect.cloud.database.* | |
| import com.huawei.agconnect.cloud.database.exceptions.AGConnectCloudDBException | |
| import kotlinx.coroutines.* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.hms.quickline.presentation.call.webrtc | |
| import android.app.Application | |
| import android.util.Log | |
| import com.hms.quickline.core.util.Constants | |
| import com.hms.quickline.core.util.Constants.LOCAL_STREAM_ID | |
| import com.hms.quickline.core.util.Constants.LOCAL_TRACK_ID | |
| import com.hms.quickline.core.util.Constants.VIDEO_FPS | |
| import com.hms.quickline.core.util.Constants.VIDEO_HEIGHT | |
| import com.hms.quickline.core.util.Constants.VIDEO_WIDTH |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| fun call() { | |
| peerConnection?.createOffer( | |
| SdpObserverImpl( | |
| onCreateSuccessCallback = { sdp -> | |
| Log.d(TAG, "offer: onCreateSuccessCallback called") | |
| peerConnection?.setLocalDescription(SdpObserverImpl( | |
| onSetSuccessCallback = { | |
| Log.d(TAG, "offer: onSetSuccess called") |