Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Adjust example structure (#488)
- Loading branch information
1 parent
227cade
commit 04d95c1
Showing
33 changed files
with
124 additions
and
362 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
16 changes: 8 additions & 8 deletions
16
example/android/app/src/main/kotlin/io/agora/agora_rtc_engine_example/MainActivity.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,34 +1,34 @@ | ||
package io.agora.agora_rtc_engine_example | ||
|
||
import android.os.Bundle | ||
import io.agora.agora_rtc_engine_example.custom_audio_source.CustomAudioPlugin | ||
import io.agora.agora_rtc_engine_example.custom_audio_source.CustomAudioSource | ||
import io.agora.agora_rtc_engine_example.custom_capture_audio.CustomCaptureAudioPlugin | ||
import io.agora.agora_rtc_engine_example.custom_capture_audio.CustomCaptureAudio | ||
import io.agora.rtc.base.RtcEnginePlugin | ||
import io.flutter.embedding.android.FlutterActivity | ||
import io.flutter.embedding.engine.FlutterEngine | ||
import java.lang.ref.WeakReference | ||
|
||
class MainActivity: FlutterActivity() { | ||
|
||
private val customAudioPlugin = CustomAudioPlugin(WeakReference(this)) | ||
private val customCaptureAudioPlugin = CustomCaptureAudioPlugin(WeakReference(this)) | ||
|
||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
|
||
// Register the `CustomAudioPlugin` to interect with the `RtcEngine` | ||
RtcEnginePlugin.register(customAudioPlugin) | ||
// Register the `CustomCaptureAudioPlugin` to interect with the `RtcEngine` | ||
RtcEnginePlugin.register(customCaptureAudioPlugin) | ||
} | ||
|
||
override fun configureFlutterEngine(flutterEngine: FlutterEngine) { | ||
super.configureFlutterEngine(flutterEngine) | ||
// The `CustomAudioSource` is generated by [pigeon](https://pub.dev/packages/pigeon), you can see the | ||
// The `CustomCaptureAudioPlugin` is generated by [pigeon](https://pub.dev/packages/pigeon), you can see the | ||
// the definiton on `example/lib/examples/advanced/custom_audio/custom_audio_source_api.dart` | ||
CustomAudioSource.CustomAudioSourceApi.setup(flutterEngine.dartExecutor, customAudioPlugin) | ||
CustomCaptureAudio.CustomCaptureAudioApi.setup(flutterEngine.dartExecutor, customCaptureAudioPlugin) | ||
} | ||
|
||
override fun onDestroy() { | ||
super.onDestroy() | ||
|
||
RtcEnginePlugin.unregister(customAudioPlugin) | ||
RtcEnginePlugin.unregister(customCaptureAudioPlugin) | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
...stom_audio_source/AudioRecordService.java → ...tom_capture_audio/AudioRecordService.java
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
2 changes: 1 addition & 1 deletion
2
...mple/custom_audio_source/AudioStatus.java → ...ple/custom_capture_audio/AudioStatus.java
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
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
Oops, something went wrong.