@react-native-ohos/audio-toolkit 2.0.4-rc.2 → 2.0.4-rc.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/CHANGELOG.md +2 -136
  2. package/LICENSE +22 -22
  3. package/{harmony/audio_toolkit/OAT.xml → OAT.xml} +47 -37
  4. package/README.md +11 -17
  5. package/ReactNativeAudioToolkit.podspec +18 -18
  6. package/harmony/audio_toolkit/build-profile.json5 +7 -7
  7. package/harmony/audio_toolkit/hvigorfile.ts +1 -1
  8. package/harmony/audio_toolkit/index.ets +26 -25
  9. package/harmony/audio_toolkit/oh-package.json5 +12 -12
  10. package/harmony/audio_toolkit/src/main/cpp/AudioToolkitPackage.h +9 -13
  11. package/harmony/audio_toolkit/src/main/cpp/CMakeLists.txt +3 -2
  12. package/harmony/audio_toolkit/src/main/cpp/generated/RNOH/generated/{BaseAudioToolkitPackage.h → BaseReactNativeAudioToolkitPackage.h} +69 -76
  13. package/harmony/audio_toolkit/src/main/cpp/generated/RNOH/generated/turbo_modules/RCTAudioPlayer.cpp +23 -23
  14. package/harmony/audio_toolkit/src/main/cpp/generated/RNOH/generated/turbo_modules/RCTAudioPlayer.h +16 -16
  15. package/harmony/audio_toolkit/src/main/cpp/generated/RNOH/generated/turbo_modules/RCTAudioRecorder.cpp +20 -20
  16. package/harmony/audio_toolkit/src/main/cpp/generated/RNOH/generated/turbo_modules/RCTAudioRecorder.h +16 -16
  17. package/harmony/audio_toolkit/src/main/cpp/generated/react/renderer/components/{audio_toolkit → react_native_audio_toolkit}/ComponentDescriptors.h +22 -24
  18. package/harmony/audio_toolkit/src/main/cpp/generated/react/renderer/components/{audio_toolkit → react_native_audio_toolkit}/EventEmitters.cpp +18 -16
  19. package/harmony/audio_toolkit/src/main/cpp/generated/react/renderer/components/{audio_toolkit → react_native_audio_toolkit}/EventEmitters.h +19 -17
  20. package/harmony/audio_toolkit/src/main/cpp/generated/react/renderer/components/{audio_toolkit → react_native_audio_toolkit}/Props.cpp +21 -19
  21. package/harmony/audio_toolkit/src/main/cpp/generated/react/renderer/components/{audio_toolkit → react_native_audio_toolkit}/Props.h +20 -18
  22. package/harmony/audio_toolkit/src/main/cpp/generated/react/renderer/components/{audio_toolkit → react_native_audio_toolkit}/ShadowNodes.cpp +19 -17
  23. package/harmony/audio_toolkit/src/main/cpp/generated/react/renderer/components/{audio_toolkit → react_native_audio_toolkit}/ShadowNodes.h +25 -23
  24. package/harmony/audio_toolkit/src/main/cpp/generated/react/renderer/components/{audio_toolkit → react_native_audio_toolkit}/States.cpp +18 -16
  25. package/harmony/audio_toolkit/src/main/cpp/generated/react/renderer/components/{audio_toolkit → react_native_audio_toolkit}/States.h +23 -19
  26. package/harmony/audio_toolkit/src/main/ets/{AudioToolkitPackage.ts → AudioToolkitPackage.ets} +51 -50
  27. package/harmony/audio_toolkit/src/main/ets/Logger.ts +63 -63
  28. package/harmony/audio_toolkit/src/main/ets/RNCAudioPlayerTurboModule.ts +432 -432
  29. package/harmony/audio_toolkit/src/main/ets/RNCAudioRecorderTurboModule.ts +260 -260
  30. package/harmony/audio_toolkit/src/main/ets/generated/components/ts.ts +5 -5
  31. package/harmony/audio_toolkit/src/main/ets/generated/index.ets +5 -5
  32. package/harmony/audio_toolkit/src/main/ets/generated/ts.ts +6 -6
  33. package/harmony/audio_toolkit/src/main/ets/generated/turboModules/RCTAudioPlayer.ts +40 -40
  34. package/harmony/audio_toolkit/src/main/ets/generated/turboModules/RCTAudioRecorder.ts +24 -24
  35. package/harmony/audio_toolkit/src/main/ets/generated/turboModules/ts.ts +6 -6
  36. package/harmony/audio_toolkit/src/main/module.json5 +6 -6
  37. package/harmony/audio_toolkit/src/main/resources/base/element/string.json +7 -7
  38. package/harmony/audio_toolkit/src/main/resources/en_US/element/string.json +7 -7
  39. package/harmony/audio_toolkit/src/main/resources/zh_CN/element/string.json +7 -7
  40. package/harmony/audio_toolkit/{ts.ts → ts.ets} +25 -25
  41. package/harmony/audio_toolkit.har +0 -0
  42. package/package.json +48 -47
  43. package/src/Player.js +329 -329
  44. package/src/PlayerModule.ts +51 -51
  45. package/src/Recorder.js +183 -183
  46. package/src/RecorderModule.ts +83 -83
  47. package/src/index.ts +5 -5
  48. package/COMMITTERS.md +0 -7
  49. package/harmony/audio_toolkit/BuildProfile.ets +0 -17
  50. package/harmony/audio_toolkit/LICENSE +0 -21
  51. package/harmony/audio_toolkit/NOTICE +0 -33
  52. package/harmony/audio_toolkit/README.OpenSource +0 -11
  53. package/harmony/audio_toolkit/README.md +0 -17
@@ -1,23 +1,23 @@
1
- /**
2
- * This code was generated by "react-native codegen-lib-harmony"
3
- */
4
-
5
- #include "RCTAudioPlayer.h"
6
-
7
- namespace rnoh {
8
- using namespace facebook;
9
-
10
- RCTAudioPlayer::RCTAudioPlayer(const ArkTSTurboModule::Context ctx, const std::string name) : ArkTSTurboModule(ctx, name) {
11
- methodMap_ = {
12
- ARK_METHOD_METADATA(set, 3),
13
- ARK_METHOD_METADATA(prepare, 4),
14
- ARK_METHOD_METADATA(play, 2),
15
- ARK_METHOD_METADATA(pause, 0),
16
- ARK_METHOD_METADATA(stop, 0),
17
- ARK_METHOD_METADATA(destroy, 1),
18
- ARK_METHOD_METADATA(seek, 0),
19
- ARK_METHOD_METADATA(getCurrentTime, 2),
20
- };
21
- }
22
-
23
- } // namespace rnoh
1
+ /**
2
+ * This code was generated by "react-native codegen-lib-harmony"
3
+ */
4
+
5
+ #include "RCTAudioPlayer.h"
6
+
7
+ namespace rnoh {
8
+ using namespace facebook;
9
+
10
+ RCTAudioPlayer::RCTAudioPlayer(const ArkTSTurboModule::Context ctx, const std::string name) : ArkTSTurboModule(ctx, name) {
11
+ methodMap_ = {
12
+ ARK_METHOD_METADATA(set, 3),
13
+ ARK_METHOD_METADATA(prepare, 4),
14
+ ARK_METHOD_METADATA(play, 2),
15
+ ARK_METHOD_METADATA(pause, 0),
16
+ ARK_METHOD_METADATA(stop, 0),
17
+ ARK_METHOD_METADATA(destroy, 1),
18
+ ARK_METHOD_METADATA(seek, 0),
19
+ ARK_METHOD_METADATA(getCurrentTime, 2),
20
+ };
21
+ }
22
+
23
+ } // namespace rnoh
@@ -1,16 +1,16 @@
1
- /**
2
- * This code was generated by "react-native codegen-lib-harmony"
3
- */
4
-
5
- #pragma once
6
-
7
- #include "RNOH/ArkTSTurboModule.h"
8
-
9
- namespace rnoh {
10
-
11
- class JSI_EXPORT RCTAudioPlayer : public ArkTSTurboModule {
12
- public:
13
- RCTAudioPlayer(const ArkTSTurboModule::Context ctx, const std::string name);
14
- };
15
-
16
- } // namespace rnoh
1
+ /**
2
+ * This code was generated by "react-native codegen-lib-harmony"
3
+ */
4
+
5
+ #pragma once
6
+
7
+ #include "RNOH/ArkTSTurboModule.h"
8
+
9
+ namespace rnoh {
10
+
11
+ class JSI_EXPORT RCTAudioPlayer : public ArkTSTurboModule {
12
+ public:
13
+ RCTAudioPlayer(const ArkTSTurboModule::Context ctx, const std::string name);
14
+ };
15
+
16
+ } // namespace rnoh
@@ -1,20 +1,20 @@
1
- /**
2
- * This code was generated by "react-native codegen-lib-harmony"
3
- */
4
-
5
- #include "RCTAudioRecorder.h"
6
-
7
- namespace rnoh {
8
- using namespace facebook;
9
-
10
- RCTAudioRecorder::RCTAudioRecorder(const ArkTSTurboModule::Context ctx, const std::string name) : ArkTSTurboModule(ctx, name) {
11
- methodMap_ = {
12
- ARK_METHOD_METADATA(prepare, 4),
13
- ARK_METHOD_METADATA(record, 2),
14
- ARK_METHOD_METADATA(stop, 2),
15
- ARK_METHOD_METADATA(pause, 2),
16
- ARK_METHOD_METADATA(destroy, 2),
17
- };
18
- }
19
-
20
- } // namespace rnoh
1
+ /**
2
+ * This code was generated by "react-native codegen-lib-harmony"
3
+ */
4
+
5
+ #include "RCTAudioRecorder.h"
6
+
7
+ namespace rnoh {
8
+ using namespace facebook;
9
+
10
+ RCTAudioRecorder::RCTAudioRecorder(const ArkTSTurboModule::Context ctx, const std::string name) : ArkTSTurboModule(ctx, name) {
11
+ methodMap_ = {
12
+ ARK_METHOD_METADATA(prepare, 4),
13
+ ARK_METHOD_METADATA(record, 2),
14
+ ARK_METHOD_METADATA(stop, 2),
15
+ ARK_METHOD_METADATA(pause, 2),
16
+ ARK_METHOD_METADATA(destroy, 2),
17
+ };
18
+ }
19
+
20
+ } // namespace rnoh
@@ -1,16 +1,16 @@
1
- /**
2
- * This code was generated by "react-native codegen-lib-harmony"
3
- */
4
-
5
- #pragma once
6
-
7
- #include "RNOH/ArkTSTurboModule.h"
8
-
9
- namespace rnoh {
10
-
11
- class JSI_EXPORT RCTAudioRecorder : public ArkTSTurboModule {
12
- public:
13
- RCTAudioRecorder(const ArkTSTurboModule::Context ctx, const std::string name);
14
- };
15
-
16
- } // namespace rnoh
1
+ /**
2
+ * This code was generated by "react-native codegen-lib-harmony"
3
+ */
4
+
5
+ #pragma once
6
+
7
+ #include "RNOH/ArkTSTurboModule.h"
8
+
9
+ namespace rnoh {
10
+
11
+ class JSI_EXPORT RCTAudioRecorder : public ArkTSTurboModule {
12
+ public:
13
+ RCTAudioRecorder(const ArkTSTurboModule::Context ctx, const std::string name);
14
+ };
15
+
16
+ } // namespace rnoh
@@ -1,24 +1,22 @@
1
-
2
- /**
3
- * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
4
- *
5
- * Do not edit this file as changes may cause incorrect behavior and will be lost
6
- * once the code is regenerated.
7
- *
8
- * @generated by codegen project: GenerateComponentDescriptorH.js
9
- */
10
-
11
- #pragma once
12
-
13
- #include "ShadowNodes.h"
14
- #include <react/renderer/core/ConcreteComponentDescriptor.h>
15
- #include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
16
-
17
- namespace facebook::react {
18
-
19
-
20
-
21
- void audio_toolkit_registerComponentDescriptorsFromCodegen(
22
- std::shared_ptr<const ComponentDescriptorProviderRegistry> registry);
23
-
24
- } // namespace facebook::react
1
+
2
+ /**
3
+ * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
4
+ *
5
+ * Do not edit this file as changes may cause incorrect behavior and will be lost
6
+ * once the code is regenerated.
7
+ *
8
+ * @generated by codegen project: GenerateComponentDescriptorH.js
9
+ */
10
+
11
+ #pragma once
12
+
13
+ #include <react/renderer/components/react_native_audio_toolkit/ShadowNodes.h>
14
+ #include <react/renderer/core/ConcreteComponentDescriptor.h>
15
+
16
+ namespace facebook {
17
+ namespace react {
18
+
19
+
20
+
21
+ } // namespace react
22
+ } // namespace facebook
@@ -1,16 +1,18 @@
1
-
2
- /**
3
- * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
4
- *
5
- * Do not edit this file as changes may cause incorrect behavior and will be lost
6
- * once the code is regenerated.
7
- *
8
- * @generated by codegen project: GenerateEventEmitterCpp.js
9
- */
10
-
11
- #include "EventEmitters.h"
12
-
13
-
14
- namespace facebook::react {
15
-
16
- } // namespace facebook::react
1
+
2
+ /**
3
+ * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
4
+ *
5
+ * Do not edit this file as changes may cause incorrect behavior and will be lost
6
+ * once the code is regenerated.
7
+ *
8
+ * @generated by codegen project: GenerateEventEmitterCpp.js
9
+ */
10
+
11
+ #include <react/renderer/components/react_native_audio_toolkit/EventEmitters.h>
12
+
13
+
14
+ namespace facebook {
15
+ namespace react {
16
+
17
+ } // namespace react
18
+ } // namespace facebook
@@ -1,17 +1,19 @@
1
-
2
- /**
3
- * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
4
- *
5
- * Do not edit this file as changes may cause incorrect behavior and will be lost
6
- * once the code is regenerated.
7
- *
8
- * @generated by codegen project: GenerateEventEmitterH.js
9
- */
10
- #pragma once
11
-
12
- #include <react/renderer/components/view/ViewEventEmitter.h>
13
-
14
-
15
- namespace facebook::react {
16
-
17
- } // namespace facebook::react
1
+
2
+ /**
3
+ * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
4
+ *
5
+ * Do not edit this file as changes may cause incorrect behavior and will be lost
6
+ * once the code is regenerated.
7
+ *
8
+ * @generated by codegen project: GenerateEventEmitterH.js
9
+ */
10
+ #pragma once
11
+
12
+ #include <react/renderer/components/view/ViewEventEmitter.h>
13
+
14
+
15
+ namespace facebook {
16
+ namespace react {
17
+
18
+ } // namespace react
19
+ } // namespace facebook
@@ -1,19 +1,21 @@
1
-
2
- /**
3
- * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
4
- *
5
- * Do not edit this file as changes may cause incorrect behavior and will be lost
6
- * once the code is regenerated.
7
- *
8
- * @generated by codegen project: GeneratePropsCpp.js
9
- */
10
-
11
- #include "Props.h"
12
- #include <react/renderer/core/PropsParserContext.h>
13
- #include <react/renderer/core/propsConversions.h>
14
-
15
- namespace facebook::react {
16
-
17
-
18
-
19
- } // namespace facebook::react
1
+
2
+ /**
3
+ * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
4
+ *
5
+ * Do not edit this file as changes may cause incorrect behavior and will be lost
6
+ * once the code is regenerated.
7
+ *
8
+ * @generated by codegen project: GeneratePropsCpp.js
9
+ */
10
+
11
+ #include <react/renderer/components/react_native_audio_toolkit/Props.h>
12
+ #include <react/renderer/core/PropsParserContext.h>
13
+ #include <react/renderer/core/propsConversions.h>
14
+
15
+ namespace facebook {
16
+ namespace react {
17
+
18
+
19
+
20
+ } // namespace react
21
+ } // namespace facebook
@@ -1,18 +1,20 @@
1
-
2
- /**
3
- * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
4
- *
5
- * Do not edit this file as changes may cause incorrect behavior and will be lost
6
- * once the code is regenerated.
7
- *
8
- * @generated by codegen project: GeneratePropsH.js
9
- */
10
- #pragma once
11
-
12
-
13
-
14
- namespace facebook::react {
15
-
16
-
17
-
18
- } // namespace facebook::react
1
+
2
+ /**
3
+ * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
4
+ *
5
+ * Do not edit this file as changes may cause incorrect behavior and will be lost
6
+ * once the code is regenerated.
7
+ *
8
+ * @generated by codegen project: GeneratePropsH.js
9
+ */
10
+ #pragma once
11
+
12
+
13
+
14
+ namespace facebook {
15
+ namespace react {
16
+
17
+
18
+
19
+ } // namespace react
20
+ } // namespace facebook
@@ -1,17 +1,19 @@
1
-
2
- /**
3
- * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
4
- *
5
- * Do not edit this file as changes may cause incorrect behavior and will be lost
6
- * once the code is regenerated.
7
- *
8
- * @generated by codegen project: GenerateShadowNodeCpp.js
9
- */
10
-
11
- #include "ShadowNodes.h"
12
-
13
- namespace facebook::react {
14
-
15
-
16
-
17
- } // namespace facebook::react
1
+
2
+ /**
3
+ * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
4
+ *
5
+ * Do not edit this file as changes may cause incorrect behavior and will be lost
6
+ * once the code is regenerated.
7
+ *
8
+ * @generated by codegen project: GenerateShadowNodeCpp.js
9
+ */
10
+
11
+ #include <react/renderer/components/react_native_audio_toolkit/ShadowNodes.h>
12
+
13
+ namespace facebook {
14
+ namespace react {
15
+
16
+
17
+
18
+ } // namespace react
19
+ } // namespace facebook
@@ -1,23 +1,25 @@
1
-
2
- /**
3
- * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
4
- *
5
- * Do not edit this file as changes may cause incorrect behavior and will be lost
6
- * once the code is regenerated.
7
- *
8
- * @generated by codegen project: GenerateShadowNodeH.js
9
- */
10
-
11
- #pragma once
12
-
13
- #include "EventEmitters.h"
14
- #include "Props.h"
15
- #include "States.h"
16
- #include <react/renderer/components/view/ConcreteViewShadowNode.h>
17
- #include <jsi/jsi.h>
18
-
19
- namespace facebook::react {
20
-
21
-
22
-
23
- } // namespace facebook::react
1
+
2
+ /**
3
+ * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
4
+ *
5
+ * Do not edit this file as changes may cause incorrect behavior and will be lost
6
+ * once the code is regenerated.
7
+ *
8
+ * @generated by codegen project: GenerateShadowNodeH.js
9
+ */
10
+
11
+ #pragma once
12
+
13
+ #include <react/renderer/components/react_native_audio_toolkit/EventEmitters.h>
14
+ #include <react/renderer/components/react_native_audio_toolkit/Props.h>
15
+ #include <react/renderer/components/react_native_audio_toolkit/States.h>
16
+ #include <react/renderer/components/view/ConcreteViewShadowNode.h>
17
+ #include <jsi/jsi.h>
18
+
19
+ namespace facebook {
20
+ namespace react {
21
+
22
+
23
+
24
+ } // namespace react
25
+ } // namespace facebook
@@ -1,16 +1,18 @@
1
-
2
- /**
3
- * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
4
- *
5
- * Do not edit this file as changes may cause incorrect behavior and will be lost
6
- * once the code is regenerated.
7
- *
8
- * @generated by codegen project: GenerateStateCpp.js
9
- */
10
- #include "States.h"
11
-
12
- namespace facebook::react {
13
-
14
-
15
-
16
- } // namespace facebook::react
1
+
2
+ /**
3
+ * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
4
+ *
5
+ * Do not edit this file as changes may cause incorrect behavior and will be lost
6
+ * once the code is regenerated.
7
+ *
8
+ * @generated by codegen project: GenerateStateCpp.js
9
+ */
10
+ #include <react/renderer/components/react_native_audio_toolkit/States.h>
11
+
12
+ namespace facebook {
13
+ namespace react {
14
+
15
+
16
+
17
+ } // namespace react
18
+ } // namespace facebook
@@ -1,19 +1,23 @@
1
- /**
2
- * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
3
- *
4
- * Do not edit this file as changes may cause incorrect behavior and will be lost
5
- * once the code is regenerated.
6
- *
7
- * @generated by codegen project: GenerateStateH.js
8
- */
9
- #pragma once
10
-
11
- #ifdef ANDROID
12
- #include <folly/dynamic.h>
13
- #endif
14
-
15
- namespace facebook::react {
16
-
17
-
18
-
19
- } // namespace facebook::react
1
+ /**
2
+ * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
3
+ *
4
+ * Do not edit this file as changes may cause incorrect behavior and will be lost
5
+ * once the code is regenerated.
6
+ *
7
+ * @generated by codegen project: GenerateStateH.js
8
+ */
9
+ #pragma once
10
+
11
+ #ifdef ANDROID
12
+ #include <folly/dynamic.h>
13
+ #include <react/renderer/mapbuffer/MapBuffer.h>
14
+ #include <react/renderer/mapbuffer/MapBufferBuilder.h>
15
+ #endif
16
+
17
+ namespace facebook {
18
+ namespace react {
19
+
20
+
21
+
22
+ } // namespace react
23
+ } // namespace facebook
@@ -1,51 +1,52 @@
1
- /**
2
- * MIT License
3
- *
4
- * Copyright (C) 2023 Huawei Device Co., Ltd.
5
- *
6
- * Permission is hereby granted, free of charge, to any person obtaining a copy
7
- * of this software and associated documentation files (the "Software"), to deal
8
- * in the Software without restriction, including without limitation the rights
9
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
- * copies of the Software, and to permit persons to whom the Software is
11
- * furnished to do so, subject to the following conditions:
12
- *
13
- * The above copyright notice and this permission notice shall be included in all
14
- * copies or substantial portions of the Software.
15
- *
16
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
- * SOFTWARE.
23
- */
24
-
25
- import { RNPackage, TurboModulesFactory } from '@rnoh/react-native-openharmony/ts';
26
- import type { TurboModule, TurboModuleContext } from '@rnoh/react-native-openharmony/ts';
27
- import { RCTAudioPlayerTurboModule } from './RNCAudioPlayerTurboModule';
28
- import { RCTAudioRecorderTurboModule } from './RNCAudioRecorderTurboModule';
29
- export const AUDIO_TYPE: string = 'RCTAudioPlayer1';
30
-
31
- class AudioPlayer1TurboModulesFactory extends TurboModulesFactory {
32
- createTurboModule(name: string): TurboModule | null {
33
- if (name === 'RCTAudioPlayer') {
34
- return new RCTAudioPlayerTurboModule(this.ctx);
35
- }
36
- if (name === 'RCTAudioRecorder') {
37
- return new RCTAudioRecorderTurboModule(this.ctx);
38
- }
39
- return null;
40
- }
41
-
42
- hasTurboModule(name: string): boolean {
43
- return name === 'RCTAudioPlayer' || name === 'RCTAudioRecorder';
44
- }
45
- }
46
-
47
- export class AudioModulesPackage extends RNPackage {
48
- createTurboModulesFactory(ctx: TurboModuleContext): TurboModulesFactory {
49
- return new AudioPlayer1TurboModulesFactory(ctx);
50
- }
1
+ /**
2
+ * MIT License
3
+ *
4
+ * Copyright (C) 2023 Huawei Device Co., Ltd.
5
+ *
6
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ * of this software and associated documentation files (the "Software"), to deal
8
+ * in the Software without restriction, including without limitation the rights
9
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ * copies of the Software, and to permit persons to whom the Software is
11
+ * furnished to do so, subject to the following conditions:
12
+ *
13
+ * The above copyright notice and this permission notice shall be included in all
14
+ * copies or substantial portions of the Software.
15
+ *
16
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ * SOFTWARE.
23
+ */
24
+
25
+ import { RNPackage, TurboModulesFactory } from '@rnoh/react-native-openharmony/ts';
26
+ import { RNOHPackage } from '@rnoh/react-native-openharmony'
27
+ import type { TurboModule, TurboModuleContext } from '@rnoh/react-native-openharmony/ts';
28
+ import { RCTAudioPlayerTurboModule } from './RNCAudioPlayerTurboModule';
29
+ import { RCTAudioRecorderTurboModule } from './RNCAudioRecorderTurboModule';
30
+ export const AUDIO_TYPE: string = 'RCTAudioPlayer1';
31
+
32
+ class AudioPlayer1TurboModulesFactory extends TurboModulesFactory {
33
+ createTurboModule(name: string): TurboModule | null {
34
+ if (name === 'RCTAudioPlayer') {
35
+ return new RCTAudioPlayerTurboModule(this.ctx);
36
+ }
37
+ if (name === 'RCTAudioRecorder') {
38
+ return new RCTAudioRecorderTurboModule(this.ctx);
39
+ }
40
+ return null;
41
+ }
42
+
43
+ hasTurboModule(name: string): boolean {
44
+ return name === 'RCTAudioPlayer' || name === 'RCTAudioRecorder';
45
+ }
46
+ }
47
+
48
+ export class AudioModulesPackage extends RNOHPackage {
49
+ createTurboModulesFactory(ctx: TurboModuleContext): TurboModulesFactory {
50
+ return new AudioPlayer1TurboModulesFactory(ctx);
51
+ }
51
52
  }