Skip to content
This repository has been archived by the owner on May 16, 2024. It is now read-only.

Commit

Permalink
[MV-364] Fix screencast crashes on Android (#87)
Browse files Browse the repository at this point in the history
  • Loading branch information
graszka22 authored Apr 7, 2023
1 parent def5be6 commit 00a7c80
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,6 @@ dependencies {
api 'com.facebook.react:react-native:+'
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:${versions.coroutines}"
implementation 'com.github.jellyfish-dev:membrane-webrtc-android:4.2.1'
implementation 'com.github.jellyfish-dev:membrane-webrtc-android:4.3.1'
implementation 'com.twilio:audioswitch:1.1.7'
}
Original file line number Diff line number Diff line change
Expand Up @@ -462,9 +462,7 @@ class MembraneModule(reactContext: ReactApplicationContext) :
maxBitrate = screencastMaxBandwidth,
)

localScreencastTrack = room?.createScreencastTrack(mediaProjectionPermission, videoParameters, screencastMetadata) {
stopScreencast()
}
localScreencastTrack = room?.createScreencastTrack(mediaProjectionPermission, videoParameters, screencastMetadata)

localScreencastTrack?.let {
val participant = participants[localParticipantId]
Expand All @@ -478,8 +476,8 @@ class MembraneModule(reactContext: ReactApplicationContext) :
isScreenCastOn = false

localScreencastTrack?.let {
room?.removeTrack(it.id())
participants[localParticipantId]?.removeTrack(it)
room?.removeTrack(it.id())
emitParticipants()
localScreencastTrack = null
}
Expand Down

0 comments on commit 00a7c80

Please sign in to comment.