-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: slightly better injection of AudioCpntext
- Loading branch information
Maciej Makowski
committed
Jul 19, 2024
1 parent
fc190c8
commit 573e2b8
Showing
4 changed files
with
29 additions
and
16 deletions.
There are no files selected for viewing
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
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
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
10 changes: 8 additions & 2 deletions
10
android/src/main/java/com/audiocontext/nativemodules/AudioContextModule.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,24 @@ | ||
package com.audiocontext.nativemodules | ||
|
||
import com.audiocontext.context.AudioContext | ||
import com.facebook.jni.HybridData | ||
import com.facebook.react.bridge.ReactApplicationContext | ||
import com.facebook.react.bridge.ReactContextBaseJavaModule | ||
import com.facebook.react.bridge.ReactMethod | ||
|
||
class AudioContextModule(private val reactContext: ReactApplicationContext) : ReactContextBaseJavaModule(reactContext) { | ||
|
||
override fun getName(): String { | ||
return "AudioContextModule" | ||
return NAME | ||
} | ||
|
||
@ReactMethod(isBlockingSynchronousMethod = true) | ||
fun initAudioContext() { | ||
AudioContext(reactContext) | ||
val audioContext = AudioContext(reactContext) | ||
audioContext.install() | ||
} | ||
|
||
companion object { | ||
const val NAME: String = "AudioContextModule" | ||
} | ||
} |