@react-native-ohos/react-native-audio-recorder-player 3.6.11-rc.1
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.
- package/LICENSE +21 -0
- package/README.OpenSource +11 -0
- package/README.md +14 -0
- package/RNAudioRecorderPlayer.podspec +21 -0
- package/harmony/audio_recorder_player/LICENSE +21 -0
- package/harmony/audio_recorder_player/ResourceTable.txt +2 -0
- package/harmony/audio_recorder_player/build-profile.json5 +28 -0
- package/harmony/audio_recorder_player/hvigorfile.ts +1 -0
- package/harmony/audio_recorder_player/index.ets +26 -0
- package/harmony/audio_recorder_player/oh-package.json5 +20 -0
- package/harmony/audio_recorder_player/src/main/cpp/CMakeLists.txt +7 -0
- package/harmony/audio_recorder_player/src/main/cpp/RNAudioRecorderPlayerPackage.h +53 -0
- package/harmony/audio_recorder_player/src/main/cpp/RNAudioRecorderPlayerTurboModule.cpp +93 -0
- package/harmony/audio_recorder_player/src/main/cpp/RNAudioRecorderPlayerTurboModule.h +38 -0
- package/harmony/audio_recorder_player/src/main/ets/RNAudioRecorderPlayerPackage.ets +48 -0
- package/harmony/audio_recorder_player/src/main/ets/RNAudioRecorderPlayerTurboModule.ts +303 -0
- package/harmony/audio_recorder_player/src/main/ets/audioPlayer/AudioPlayer.ts +414 -0
- package/harmony/audio_recorder_player/src/main/ets/audioPlayer/types.ts +43 -0
- package/harmony/audio_recorder_player/src/main/ets/index.d.ts +209 -0
- package/harmony/audio_recorder_player/src/main/ets/recorder/Recorder.ts +299 -0
- package/harmony/audio_recorder_player/src/main/ets/recorder/types.ts +61 -0
- package/harmony/audio_recorder_player/src/main/ets/utils/DateTimeUtils.ts +88 -0
- package/harmony/audio_recorder_player/src/main/ets/utils/Logger.ts +45 -0
- package/harmony/audio_recorder_player/src/main/ets/utils/SaveAudioAsset.ts +105 -0
- package/harmony/audio_recorder_player/src/main/module.json5 +9 -0
- package/harmony/audio_recorder_player/src/main/resources/base/element/string.json +8 -0
- package/harmony/audio_recorder_player/src/main/resources/base/media/ic_public_error.svg +10 -0
- package/harmony/audio_recorder_player/src/main/resources/en_US/element/string.json +8 -0
- package/harmony/audio_recorder_player/src/main/resources/zh_CN/element/string.json +8 -0
- package/harmony/audio_recorder_player/ts.ets +27 -0
- package/harmony/audio_recorder_player.har +0 -0
- package/index.d.ts +226 -0
- package/index.ts +524 -0
- package/package.json +69 -0
- package/src/NativeAudioRecorderPlayerModule.ts +42 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2018 dooboolab
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"Name": "react-native-audio-recorder-player",
|
|
4
|
+
"License": "MIT License",
|
|
5
|
+
"License File": "https://github.com/hyochan/react-native-audio-recorder-player/blob/main/LICENSE",
|
|
6
|
+
"Version Number": "3.6.10-0.0.2",
|
|
7
|
+
"Owner" : "xiafeng@huawei.com",
|
|
8
|
+
"Upstream URL": "https://github.com/hyochan/react-native-audio-recorder-player",
|
|
9
|
+
"Description": "audio-recorder-player for react-native"
|
|
10
|
+
}
|
|
11
|
+
]
|
package/README.md
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# @react-native-ohos/react-native-audio-recorder-player
|
|
2
|
+
|
|
3
|
+
This project is based on [react-native-audio-recorder-player](https://github.com/hyochan/react-native-audio-recorder-player)
|
|
4
|
+
|
|
5
|
+
## Documentation
|
|
6
|
+
|
|
7
|
+
- [中文](https://gitee.com/react-native-oh-library/usage-docs/blob/master/zh-cn/react-native-audio-recorder-player.md)
|
|
8
|
+
|
|
9
|
+
- [English](https://gitee.com/react-native-oh-library/usage-docs/blob/master/en/react-native-audio-recorder-player.md)
|
|
10
|
+
|
|
11
|
+
## License
|
|
12
|
+
|
|
13
|
+
This library is licensed under [The MIT License (MIT)](https://github.com/hyochan/react-native-audio-recorder-player/blob/main/LICENSE)
|
|
14
|
+
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
require 'json'
|
|
2
|
+
|
|
3
|
+
package = JSON.parse(File.read(File.join(__dir__, 'package.json')))
|
|
4
|
+
|
|
5
|
+
Pod::Spec.new do |s|
|
|
6
|
+
s.name = "RNAudioRecorderPlayer"
|
|
7
|
+
s.version = package['version']
|
|
8
|
+
s.summary = package['description']
|
|
9
|
+
s.license = package['license']
|
|
10
|
+
|
|
11
|
+
s.authors = package['author']
|
|
12
|
+
s.homepage = package['homepage']
|
|
13
|
+
s.platform = :ios, "11.0"
|
|
14
|
+
s.ios.deployment_target = "10.0"
|
|
15
|
+
|
|
16
|
+
s.source = { :git => "https://github.com/hyochan/react-native-audio-recorder-player.git", :tag => "#{s.version}" }
|
|
17
|
+
s.source_files = "ios/**/*.{h,c,cc,cpp,m,mm,swift}"
|
|
18
|
+
|
|
19
|
+
s.dependency 'React-Core'
|
|
20
|
+
end
|
|
21
|
+
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2017 Atul
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"apiType": "stageMode",
|
|
3
|
+
"buildOption": {
|
|
4
|
+
},
|
|
5
|
+
"buildOptionSet": [
|
|
6
|
+
{
|
|
7
|
+
"name": "release",
|
|
8
|
+
"arkOptions": {
|
|
9
|
+
"obfuscation": {
|
|
10
|
+
"ruleOptions": {
|
|
11
|
+
"enable": true,
|
|
12
|
+
"files": [
|
|
13
|
+
"./obfuscation-rules.txt"
|
|
14
|
+
]
|
|
15
|
+
},
|
|
16
|
+
"consumerFiles": [
|
|
17
|
+
"./consumer-rules.txt"
|
|
18
|
+
]
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
],
|
|
23
|
+
"targets": [
|
|
24
|
+
{
|
|
25
|
+
"name": "default"
|
|
26
|
+
}
|
|
27
|
+
]
|
|
28
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { harTasks } from '@ohos/hvigor-ohos-plugin';
|
|
@@ -0,0 +1,26 @@
|
|
|
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
|
+
import { RNAudioRecorderPlayerPackage } from './src/main/ets/RNAudioRecorderPlayerPackage'
|
|
25
|
+
export default RNAudioRecorderPlayerPackage
|
|
26
|
+
export * from './ts';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"license": "ISC",
|
|
3
|
+
"types": "",
|
|
4
|
+
"devDependencies": {},
|
|
5
|
+
"name": "@react-native-ohos/react-native-audio-recorder-player",
|
|
6
|
+
"description": "",
|
|
7
|
+
"main": "index.ets",
|
|
8
|
+
"version": "3.6.11-rc.1",
|
|
9
|
+
"dependencies": {
|
|
10
|
+
"@rnoh/react-native-openharmony": "file:../libs/react_native_openharmony-5.0.0.500.har"
|
|
11
|
+
},
|
|
12
|
+
"metadata": {
|
|
13
|
+
"sourceRoots": [
|
|
14
|
+
"./src/main"
|
|
15
|
+
]
|
|
16
|
+
},
|
|
17
|
+
"compatibleSdkVersion": '12',
|
|
18
|
+
"compatibleSdkType": "HarmonyOS",
|
|
19
|
+
"obfuscated": false
|
|
20
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
cmake_minimum_required(VERSION 3.13)
|
|
2
|
+
set(CMAKE_VERBOSE_MAKEFILE on)
|
|
3
|
+
|
|
4
|
+
file(GLOB rnoh_audio_recorder_player_SRC CONFIGURE_DEPENDS *.cpp)
|
|
5
|
+
add_library(rnoh_audio_recorder_player SHARED ${rnoh_audio_recorder_player_SRC})
|
|
6
|
+
target_include_directories(rnoh_audio_recorder_player PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
|
|
7
|
+
target_link_libraries(rnoh_audio_recorder_player PUBLIC rnoh)
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
|
|
2
|
+
/**
|
|
3
|
+
* MIT License
|
|
4
|
+
*
|
|
5
|
+
* Copyright (C) 2023 Huawei Device Co., Ltd.
|
|
6
|
+
*
|
|
7
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
8
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
9
|
+
* in the Software without restriction, including without limitation the rights
|
|
10
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
11
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
12
|
+
* furnished to do so, subject to the following conditions:
|
|
13
|
+
*
|
|
14
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
15
|
+
* copies or substantial portions of the Software.
|
|
16
|
+
*
|
|
17
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
18
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
19
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
20
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
21
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
22
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
23
|
+
* SOFTWARE.
|
|
24
|
+
*/
|
|
25
|
+
#ifndef RNAUDIORECORDERPLAYERPACKAGE_H
|
|
26
|
+
#define RNAUDIORECORDERPLAYERPACKAGE_H
|
|
27
|
+
#include "RNOH/Package.h"
|
|
28
|
+
#include "RNAudioRecorderPlayerTurboModule.h"
|
|
29
|
+
|
|
30
|
+
using namespace rnoh;
|
|
31
|
+
using namespace facebook;
|
|
32
|
+
class RNAudioRecorderPlayerFactoryDelegate : public TurboModuleFactoryDelegate {
|
|
33
|
+
public:
|
|
34
|
+
SharedTurboModule createTurboModule(Context ctx, const std::string &name) const override
|
|
35
|
+
{
|
|
36
|
+
if (name == "RNAudioRecorderPlayerTurboModule") {
|
|
37
|
+
return std::make_shared<RNAudioRecorderPlayerTurboModuleSpecJSI>(ctx, name);
|
|
38
|
+
}
|
|
39
|
+
return nullptr;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
namespace rnoh {
|
|
44
|
+
class RNAudioRecorderPlayerPackage : public Package {
|
|
45
|
+
public:
|
|
46
|
+
RNAudioRecorderPlayerPackage(Package::Context ctx) : Package(ctx) {}
|
|
47
|
+
std::unique_ptr<TurboModuleFactoryDelegate> createTurboModuleFactoryDelegate() override
|
|
48
|
+
{
|
|
49
|
+
return std::make_unique<RNAudioRecorderPlayerFactoryDelegate>();
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
} // namespace rnoh
|
|
53
|
+
#endif // RNAUDIORECORDERPLAYERPACKAGE_H
|
|
@@ -0,0 +1,93 @@
|
|
|
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
|
+
#include "RNAudioRecorderPlayerTurboModule.h"
|
|
26
|
+
#include "RNOH/ArkTSTurboModule.h"
|
|
27
|
+
|
|
28
|
+
using namespace rnoh;
|
|
29
|
+
using namespace facebook;
|
|
30
|
+
static jsi::Value hostFunction_RNAudioRecorderPlayerTurboModuleSpecJSI_addRecordBackListener(
|
|
31
|
+
jsi::Runtime &rt, react::TurboModule &turboModule, const jsi::Value *args, size_t count)
|
|
32
|
+
{
|
|
33
|
+
return static_cast<ArkTSTurboModule &>(turboModule).call(rt, "addRecordBackListener", args, count);
|
|
34
|
+
}
|
|
35
|
+
static jsi::Value hostFunction_RNAudioRecorderPlayerTurboModuleSpecJSI_removeRecordBackListener(
|
|
36
|
+
jsi::Runtime &rt, react::TurboModule &turboModule, const jsi::Value *args, size_t count)
|
|
37
|
+
{
|
|
38
|
+
return static_cast<ArkTSTurboModule &>(turboModule).call(rt, "removeRecordBackListener", args, count);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
static jsi::Value hostFunction_RNAudioRecorderPlayerTurboModuleSpecJSI_addPlayBackListener(
|
|
42
|
+
jsi::Runtime &rt, react::TurboModule &turboModule, const jsi::Value *args, size_t count)
|
|
43
|
+
{
|
|
44
|
+
return static_cast<ArkTSTurboModule &>(turboModule).call(rt, "addPlayBackListener", args, count);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
static jsi::Value hostFunction_RNAudioRecorderPlayerTurboModuleSpecJSI_removePlayBackListener(
|
|
48
|
+
jsi::Runtime &rt, react::TurboModule &turboModule, const jsi::Value *args, size_t count)
|
|
49
|
+
{
|
|
50
|
+
return static_cast<ArkTSTurboModule &>(turboModule).call(rt, "removePlayBackListener", args, count);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
static jsi::Value hostFunction_RNAudioRecorderPlayerTurboModuleSpecJSI_addListener(
|
|
54
|
+
jsi::Runtime &rt, react::TurboModule &turboModule, const jsi::Value *args, size_t count)
|
|
55
|
+
{
|
|
56
|
+
return jsi::Value(static_cast<ArkTSTurboModule &>(turboModule).call(rt, "addListener", args, count));
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
static jsi::Value hostFunction_RNAudioRecorderPlayerTurboModuleSpecJSI_removeListeners(
|
|
60
|
+
jsi::Runtime &rt, react::TurboModule &turboModule, const jsi::Value *args, size_t count)
|
|
61
|
+
{
|
|
62
|
+
return jsi::Value(static_cast<ArkTSTurboModule &>(turboModule).call(rt, "removeListeners", args, count));
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
RNAudioRecorderPlayerTurboModuleSpecJSI::RNAudioRecorderPlayerTurboModuleSpecJSI(
|
|
66
|
+
const ArkTSTurboModule::Context ctx, const std::string name)
|
|
67
|
+
: ArkTSTurboModule(ctx, name)
|
|
68
|
+
{
|
|
69
|
+
methodMap_ = {
|
|
70
|
+
ARK_ASYNC_METHOD_METADATA(startRecorder, 3),
|
|
71
|
+
ARK_ASYNC_METHOD_METADATA(pauseRecorder, 0),
|
|
72
|
+
ARK_ASYNC_METHOD_METADATA(resumeRecorder, 0),
|
|
73
|
+
ARK_ASYNC_METHOD_METADATA(stopRecorder, 0),
|
|
74
|
+
ARK_ASYNC_METHOD_METADATA(resumePlayer, 0),
|
|
75
|
+
ARK_ASYNC_METHOD_METADATA(startPlayer, 2),
|
|
76
|
+
ARK_ASYNC_METHOD_METADATA(stopPlayer, 0),
|
|
77
|
+
ARK_ASYNC_METHOD_METADATA(pausePlayer, 0),
|
|
78
|
+
ARK_ASYNC_METHOD_METADATA(seekToPlayer, 1),
|
|
79
|
+
ARK_ASYNC_METHOD_METADATA(setVolume, 1),
|
|
80
|
+
ARK_ASYNC_METHOD_METADATA(setSubscriptionDuration, 1),
|
|
81
|
+
};
|
|
82
|
+
methodMap_["addRecordBackListener"] =
|
|
83
|
+
MethodMetadata{1, hostFunction_RNAudioRecorderPlayerTurboModuleSpecJSI_addRecordBackListener};
|
|
84
|
+
methodMap_["removeRecordBackListener"] =
|
|
85
|
+
MethodMetadata{0, hostFunction_RNAudioRecorderPlayerTurboModuleSpecJSI_removeRecordBackListener};
|
|
86
|
+
methodMap_["addPlayBackListener"] =
|
|
87
|
+
MethodMetadata{1, hostFunction_RNAudioRecorderPlayerTurboModuleSpecJSI_addPlayBackListener};
|
|
88
|
+
methodMap_["removePlayBackListener"] =
|
|
89
|
+
MethodMetadata{0, hostFunction_RNAudioRecorderPlayerTurboModuleSpecJSI_removePlayBackListener};
|
|
90
|
+
methodMap_["addListener"] = MethodMetadata{1, hostFunction_RNAudioRecorderPlayerTurboModuleSpecJSI_addListener};
|
|
91
|
+
methodMap_["removeListeners"] =
|
|
92
|
+
MethodMetadata{1, hostFunction_RNAudioRecorderPlayerTurboModuleSpecJSI_removeListeners};
|
|
93
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
|
|
2
|
+
/**
|
|
3
|
+
* MIT License
|
|
4
|
+
*
|
|
5
|
+
* Copyright (C) 2023 Huawei Device Co., Ltd.
|
|
6
|
+
*
|
|
7
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
8
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
9
|
+
* in the Software without restriction, including without limitation the rights
|
|
10
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
11
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
12
|
+
* furnished to do so, subject to the following conditions:
|
|
13
|
+
*
|
|
14
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
15
|
+
* copies or substantial portions of the Software.
|
|
16
|
+
*
|
|
17
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
18
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
19
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
20
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
21
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
22
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
23
|
+
* SOFTWARE.
|
|
24
|
+
*/
|
|
25
|
+
#ifndef RNAUDIORECORDERPLAYERTURBOMODULE_H
|
|
26
|
+
#define RNAUDIORECORDERPLAYERTURBOMODULE_H
|
|
27
|
+
#include <ReactCommon/TurboModule.h>
|
|
28
|
+
#include "RNOH/ArkTSTurboModule.h"
|
|
29
|
+
|
|
30
|
+
namespace rnoh {
|
|
31
|
+
|
|
32
|
+
class JSI_EXPORT RNAudioRecorderPlayerTurboModuleSpecJSI : public ArkTSTurboModule {
|
|
33
|
+
public:
|
|
34
|
+
RNAudioRecorderPlayerTurboModuleSpecJSI(const ArkTSTurboModule::Context ctx, const std::string name);
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
} // namespace rnoh
|
|
38
|
+
#endif // RNAUDIORECORDERPLAYERTURBOMODULE_H
|
|
@@ -0,0 +1,48 @@
|
|
|
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 type { TurboModule, TurboModuleContext, } from '@rnoh/react-native-openharmony/ts';
|
|
26
|
+
import { RNPackage, TurboModulesFactory, } from '@rnoh/react-native-openharmony/ts';
|
|
27
|
+
import { RNAudioRecorderPlayerTurboModule } from './RNAudioRecorderPlayerTurboModule';
|
|
28
|
+
import {RNOHPackage} from "@rnoh/react-native-openharmony";
|
|
29
|
+
|
|
30
|
+
class RNAudioRecorderPlayerTurboModulesFactory extends TurboModulesFactory {
|
|
31
|
+
createTurboModule(name: string): TurboModule | null {
|
|
32
|
+
if (name === 'RNAudioRecorderPlayerTurboModule') {
|
|
33
|
+
globalThis.uiAbilityContext = this.ctx.uiAbilityContext;
|
|
34
|
+
return new RNAudioRecorderPlayerTurboModule(this.ctx);
|
|
35
|
+
}
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
hasTurboModule(name: string): boolean {
|
|
40
|
+
return name === 'RNAudioRecorderPlayerTurboModule';
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export class RNAudioRecorderPlayerPackage extends RNOHPackage {
|
|
45
|
+
createTurboModulesFactory(ctx: TurboModuleContext): TurboModulesFactory {
|
|
46
|
+
return new RNAudioRecorderPlayerTurboModulesFactory(ctx);
|
|
47
|
+
}
|
|
48
|
+
}
|