View startStreamingVideo
This file contains 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
private fun startStreamingVideo() { | |
//creating local mediastream | |
val mediaStream = factory?.createLocalMediaStream("ARDAMS") | |
mediaStream?.apply { | |
addTrack(localAudioTrack) | |
addTrack(localVideoTrack) | |
localPeerConnection?.addStream(this) | |
} | |
val sdpMediaConstraints = MediaConstraints() |
View initializePeerConnections
This file contains 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
private fun initializePeerConnections() { | |
localPeerConnection = createPeerConnection(factory, true) | |
remotePeerConnection = createPeerConnection(factory, false); | |
} | |
private fun createPeerConnection(factory: PeerConnectionFactory?, isLocal: Boolean): PeerConnection? { | |
val iceServers = ArrayList<PeerConnection.IceServer>() | |
iceServers.add(PeerConnection.IceServer.builder("stun:stun.l.google.com:19302").createIceServer()) | |
val rtcConfig = RTCConfiguration(iceServers) //new ArrayList<>() | |
val pcObserver: PeerConnection.Observer = object : PeerConnection.Observer { |
View InitializePeerConnections
This file contains 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
private fun initializePeerConnections() { | |
localPeerConnection = createPeerConnection(factory, true) | |
remotePeerConnection = createPeerConnection(factory, false); | |
} | |
private fun createPeerConnection(factory: PeerConnectionFactory?, isLocal: Boolean): PeerConnection? { | |
val iceServers = ArrayList<PeerConnection.IceServer>() | |
iceServers.add(PeerConnection.IceServer.builder("stun:stun.l.google.com:19302").createIceServer()) | |
val rtcConfig = RTCConfiguration(iceServers) //new ArrayList<>() | |
val pcObserver: PeerConnection.Observer = object : PeerConnection.Observer { |
View initializeSurfaceViews
This file contains 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
private fun initializeSurfaceViews() { | |
binding?.localGlSurfaceView?.init(rootEglBase?.eglBaseContext, null) | |
binding?.localGlSurfaceView?.setEnableHardwareScaler(true) | |
binding?.localGlSurfaceView?.setMirror(true) | |
binding.remoteGlSurfaceView.init(rootEglBase.getEglBaseContext(), null); | |
binding.remoteGlSurfaceView.setEnableHardwareScaler(true); | |
binding.remoteGlSurfaceView.setMirror(true); | |
} |
View activity_main.xml
This file contains 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
<?xml version="1.0" encoding="utf-8"?> | |
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:app="http://schemas.android.com/apk/res-auto" | |
xmlns:tools="http://schemas.android.com/tools" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
tools:context=".MainActivity"> | |
<org.webrtc.SurfaceViewRenderer | |
android:id="@+id/local_gl_surface_view" |
View CreateVideoTrackFromCameraAndShowIt.kt
This file contains 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
private fun createVideoTrackFromCameraAndShowIt() { | |
val videoCapturer: VideoCapturer? = createVideoCapturer() | |
//Create a VideoSource instance | |
videoCapturer?.let { | |
surfaceTextureHelper = SurfaceTextureHelper.create("CaptureThread", rootEglBase!!.eglBaseContext) | |
videoSource = factory?.createVideoSource(videoCapturer.isScreencast) | |
videoCapturer.initialize(surfaceTextureHelper, this, videoSource?.capturerObserver) | |
} | |
localVideoTrack = factory?.createVideoTrack("100", videoSource) |
View InitializePeerConnectionFactory.kt
This file contains 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
private fun initializePeerConnectionFactory() { | |
val rootEglBase = EglBase.create(); | |
//Initialize PeerConnectionFactory globals. | |
val initializationOptions = InitializationOptions.builder(this).createInitializationOptions() | |
PeerConnectionFactory.initialize(initializationOptions) | |
//Create a new PeerConnectionFactory instance - using Hardware encoder and decoder. | |
val options = PeerConnectionFactory.Options() | |
val defaultVideoEncoderFactory = DefaultVideoEncoderFactory(rootEglBase?.eglBaseContext, /* enableIntelVp8Encoder */true, /* enableH264HighProfile */true) |
View layout.xml
This file contains 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
<com.simform.customcomponent.SSCustomEdittextOutlinedBorder | |
android:id="@+id/edtAbout" | |
android:layout_width="0dp" | |
android:layout_height="wrap_content" | |
android:layout_marginTop="@dimen/_10sdp" | |
android:inputType="textMultiLine|textCapSentences" | |
app:custom_component_editText_hint="@string/edt_hint_about" | |
app:custom_component_maxline="3" | |
app:custom_component_minline="3" | |
app:custom_component_maxLength="25" |
View attributes.txt
This file contains 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
+-----------------------------------------+--------------------------------------------+---------------------------------------+ | |
| Attribute | Description | Default | | |
+-----------------------------------------+--------------------------------------------+---------------------------------------+ | |
| app:isErrorEnable | Whether the EditText error is enabled | false | | |
| app:custom_component_title | Set Outlined border title text | R.string.app_name | | |
| app:custom_component_editText_hint | Set EditText hint | R.string.app_name | | |
| app:custom_component_maxline | Set maximum height of the EditText | 1 | | |
| app:custom_component_minline | Set minimum height of the EditText | 1 |
View SystemWindowInsets.kt
This file contains 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
ViewCompat.setOnApplyWindowInsetsListener(nav_view) { v, insets -> | |
// We'll set the views bottom padding to be the same | |
// value as the system gesture insets bottom value | |
v.updatePadding( | |
bottom = insets.systemWindowInsetBottom | |
) | |
// return the insets | |
insets | |
} |
NewerOlder