react-native-tpstreams 0.1.15 → 0.2.0
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 +1 -1
- package/README.md +20 -418
- package/Tpstreams.podspec +3 -25
- package/android/build.gradle +14 -42
- package/android/src/main/AndroidManifest.xml +1 -3
- package/android/src/main/java/com/tpstreams/TPStreamsRNModule.kt +18 -0
- package/android/src/main/java/com/tpstreams/{TpstreamsPackage.kt → TPStreamsRNPackage.kt} +10 -5
- package/android/src/main/java/com/tpstreams/TPStreamsRNPlayerView.kt +53 -0
- package/android/src/main/java/com/tpstreams/TPStreamsRNPlayerViewManager.kt +46 -0
- package/ios/TpstreamsView.h +14 -0
- package/ios/TpstreamsView.mm +71 -0
- package/ios/TpstreamsViewManager.mm +19 -0
- package/lib/module/TPStreamsPlayerViewNativeComponent.ts +9 -0
- package/lib/module/index.js +9 -3
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/package.json +1 -0
- package/lib/typescript/src/TPStreamsPlayerViewNativeComponent.d.ts +9 -0
- package/lib/typescript/src/TPStreamsPlayerViewNativeComponent.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +6 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/package.json +42 -76
- package/src/TPStreamsPlayerViewNativeComponent.ts +9 -0
- package/src/index.tsx +9 -7
- package/android/generated/java/com/tpstreams/NativeTpstreamsSpec.java +0 -37
- package/android/generated/jni/CMakeLists.txt +0 -36
- package/android/generated/jni/RNTpstreamsSpec-generated.cpp +0 -32
- package/android/generated/jni/RNTpstreamsSpec.h +0 -31
- package/android/generated/jni/react/renderer/components/RNTpstreamsSpec/RNTpstreamsSpecJSI-generated.cpp +0 -28
- package/android/generated/jni/react/renderer/components/RNTpstreamsSpec/RNTpstreamsSpecJSI.h +0 -71
- package/android/libs/extracted-aar/META-INF/com/android/build/gradle/aar-metadata.properties +0 -4
- package/android/src/main/AndroidManifestNew.xml +0 -2
- package/android/src/main/java/com/tpstreams/FragmentModule.kt +0 -225
- package/android/src/main/java/com/tpstreams/PlayerFragment.kt +0 -234
- package/android/src/main/java/com/tpstreams/TpStreamsPlayerView.kt +0 -102
- package/android/src/main/java/com/tpstreams/TpStreamsPlayerViewManager.kt +0 -55
- package/android/src/main/java/com/tpstreams/TpstreamsModule.kt +0 -168
- package/android/src/main/res/layout/fragment_player.xml +0 -29
- package/android/src/main/res/xml/network_security_config.xml +0 -8
- package/ios/Tpstreams.h +0 -6
- package/ios/Tpstreams.mm +0 -18
- package/ios/generated/RNTpstreamsSpec/RNTpstreamsSpec-generated.mm +0 -39
- package/ios/generated/RNTpstreamsSpec/RNTpstreamsSpec.h +0 -63
- package/ios/generated/RNTpstreamsSpecJSI-generated.cpp +0 -28
- package/ios/generated/RNTpstreamsSpecJSI.h +0 -71
- package/lib/commonjs/NativeTpstreams.js +0 -9
- package/lib/commonjs/NativeTpstreams.js.map +0 -1
- package/lib/commonjs/index.js +0 -10
- package/lib/commonjs/index.js.map +0 -1
- package/lib/commonjs/types.js +0 -2
- package/lib/commonjs/types.js.map +0 -1
- package/lib/module/NativeTpstreams.js +0 -5
- package/lib/module/NativeTpstreams.js.map +0 -1
- package/lib/module/types.js +0 -2
- package/lib/module/types.js.map +0 -1
- package/lib/typescript/commonjs/package.json +0 -1
- package/lib/typescript/commonjs/src/NativeTpstreams.d.ts +0 -7
- package/lib/typescript/commonjs/src/NativeTpstreams.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/index.d.ts +0 -5
- package/lib/typescript/commonjs/src/index.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/types.d.ts +0 -11
- package/lib/typescript/commonjs/src/types.d.ts.map +0 -1
- package/lib/typescript/module/src/NativeTpstreams.d.ts +0 -7
- package/lib/typescript/module/src/NativeTpstreams.d.ts.map +0 -1
- package/lib/typescript/module/src/index.d.ts +0 -5
- package/lib/typescript/module/src/index.d.ts.map +0 -1
- package/lib/typescript/module/src/types.d.ts +0 -11
- package/lib/typescript/module/src/types.d.ts.map +0 -1
- package/react-native.config.js +0 -12
- package/src/NativeTpstreams.ts +0 -8
- package/src/types.ts +0 -10
- /package/lib/{typescript/module → module}/package.json +0 -0
|
@@ -1,168 +0,0 @@
|
|
|
1
|
-
package com.tpstreams
|
|
2
|
-
|
|
3
|
-
import android.os.Handler
|
|
4
|
-
import android.os.Looper
|
|
5
|
-
import com.facebook.react.bridge.ReactApplicationContext
|
|
6
|
-
import com.facebook.react.module.annotations.ReactModule
|
|
7
|
-
import com.facebook.react.bridge.ReactContextBaseJavaModule
|
|
8
|
-
import com.facebook.react.bridge.ReactMethod
|
|
9
|
-
import com.tpstream.player.TPStreamsSDK
|
|
10
|
-
import com.facebook.react.bridge.Promise
|
|
11
|
-
import com.facebook.react.bridge.Arguments
|
|
12
|
-
import com.facebook.react.modules.core.DeviceEventManagerModule
|
|
13
|
-
import com.facebook.react.bridge.ReactContext
|
|
14
|
-
|
|
15
|
-
@ReactModule(name = TpstreamsModule.NAME)
|
|
16
|
-
class TpstreamsModule(reactContext: ReactApplicationContext) :
|
|
17
|
-
ReactContextBaseJavaModule(reactContext) {
|
|
18
|
-
private val listeners = mutableSetOf<String>()
|
|
19
|
-
|
|
20
|
-
init {
|
|
21
|
-
companionReactContext = reactContext
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
override fun getName(): String {
|
|
25
|
-
return NAME
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
@ReactMethod
|
|
29
|
-
fun addListener(eventName: String?) {
|
|
30
|
-
eventName?.let {
|
|
31
|
-
listeners.add(it)
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
@ReactMethod
|
|
36
|
-
fun removeListeners(count: Int) {
|
|
37
|
-
for (i in 0 until count) {
|
|
38
|
-
if (listeners.isNotEmpty()) {
|
|
39
|
-
listeners.remove(listeners.first())
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
@ReactMethod
|
|
45
|
-
fun initializeTPSPlayer(orgId: String) {
|
|
46
|
-
TPStreamsSDK.initialize(TPStreamsSDK.Provider.TPStreams, orgId)
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
@ReactMethod
|
|
50
|
-
fun release() {
|
|
51
|
-
runOnMainThread {
|
|
52
|
-
getPlayerFragment()?.release()
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
@ReactMethod
|
|
57
|
-
fun play() {
|
|
58
|
-
runOnMainThread {
|
|
59
|
-
getPlayerFragment()?.play()
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
@ReactMethod
|
|
64
|
-
fun pause() {
|
|
65
|
-
runOnMainThread {
|
|
66
|
-
getPlayerFragment()?.pause()
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
@ReactMethod
|
|
71
|
-
fun seekTo(position: Double) {
|
|
72
|
-
runOnMainThread {
|
|
73
|
-
getPlayerFragment()?.seekTo(position.toLong())
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
@ReactMethod
|
|
78
|
-
fun getCurrentTime(promise: Promise) {
|
|
79
|
-
runOnMainThread {
|
|
80
|
-
getPlayerFragment()?.let {
|
|
81
|
-
promise.resolve(it.getCurrentTime().toDouble())
|
|
82
|
-
} ?: promise.reject("PLAYER_NOT_READY", "Player is not initialized")
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
@ReactMethod
|
|
87
|
-
fun getDuration(promise: Promise) {
|
|
88
|
-
runOnMainThread {
|
|
89
|
-
getPlayerFragment()?.let {
|
|
90
|
-
promise.resolve(it.getDuration().toDouble())
|
|
91
|
-
} ?: promise.reject("PLAYER_NOT_READY", "Player is not initialized")
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
@ReactMethod
|
|
96
|
-
fun getBufferedTime(promise: Promise) {
|
|
97
|
-
runOnMainThread {
|
|
98
|
-
getPlayerFragment()?.let {
|
|
99
|
-
promise.resolve(it.getBufferedTime().toDouble())
|
|
100
|
-
} ?: promise.reject("PLAYER_NOT_READY", "Player is not initialized")
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
@ReactMethod
|
|
105
|
-
fun getPlaybackState(promise: Promise) {
|
|
106
|
-
runOnMainThread {
|
|
107
|
-
getPlayerFragment()?.let {
|
|
108
|
-
promise.resolve(it.getPlaybackState())
|
|
109
|
-
} ?: promise.reject("PLAYER_NOT_READY", "Player is not initialized")
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
@ReactMethod
|
|
114
|
-
fun getPlayWhenReady(promise: Promise) {
|
|
115
|
-
runOnMainThread {
|
|
116
|
-
getPlayerFragment()?.let {
|
|
117
|
-
promise.resolve(it.getPlayWhenReady())
|
|
118
|
-
} ?: promise.reject("PLAYER_NOT_READY", "Player is not initialized")
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
@ReactMethod
|
|
123
|
-
fun setPlayWhenReady(playWhenReady: Boolean) {
|
|
124
|
-
runOnMainThread {
|
|
125
|
-
getPlayerFragment()?.setPlayWhenReady(playWhenReady)
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
@ReactMethod
|
|
130
|
-
fun getPlaybackSpeed(promise: Promise) {
|
|
131
|
-
runOnMainThread {
|
|
132
|
-
getPlayerFragment()?.let {
|
|
133
|
-
promise.resolve(it.getPlaybackSpeed().toDouble())
|
|
134
|
-
} ?: promise.reject("PLAYER_NOT_READY", "Player is not initialized")
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
@ReactMethod
|
|
139
|
-
fun setPlaybackSpeed(speed: Float) {
|
|
140
|
-
runOnMainThread {
|
|
141
|
-
getPlayerFragment()?.setPlaybackSpeed(speed.toFloat())
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
@ReactMethod
|
|
146
|
-
fun setNewAccessToken(token: String) {
|
|
147
|
-
runOnMainThread {
|
|
148
|
-
getPlayerFragment()?.setNewAccessToken(token)
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
private fun getPlayerFragment(): PlayerFragment? {
|
|
153
|
-
return PlayerFragment.instance?.takeIf { it.player != null }
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
private fun runOnMainThread(action: () -> Unit) {
|
|
157
|
-
companionReactContext?.runOnUiQueueThread(action)
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
companion object {
|
|
161
|
-
const val NAME = "Tpstreams"
|
|
162
|
-
var companionReactContext: ReactApplicationContext? = null
|
|
163
|
-
fun sendEvent(eventName: String, params: Any?) {
|
|
164
|
-
companionReactContext?.getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter::class.java)
|
|
165
|
-
?.emit(eventName, params)
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
-
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
|
3
|
-
xmlns:tools="http://schemas.android.com/tools"
|
|
4
|
-
android:layout_width="match_parent"
|
|
5
|
-
android:layout_height="match_parent"
|
|
6
|
-
android:layout_marginTop="64dp"
|
|
7
|
-
xmlns:app="http://schemas.android.com/apk/res-auto"
|
|
8
|
-
tools:context=".PlayerFragment">
|
|
9
|
-
|
|
10
|
-
<androidx.constraintlayout.widget.ConstraintLayout
|
|
11
|
-
android:layout_width="match_parent"
|
|
12
|
-
android:layout_height="wrap_content">
|
|
13
|
-
|
|
14
|
-
<androidx.fragment.app.FragmentContainerView
|
|
15
|
-
android:id="@+id/tpstream_player_fragment"
|
|
16
|
-
android:name="com.tpstream.player.ui.TpStreamPlayerFragment"
|
|
17
|
-
android:layout_width="match_parent"
|
|
18
|
-
android:layout_height="0dp"
|
|
19
|
-
android:keepScreenOn="true"
|
|
20
|
-
app:layout_constraintDimensionRatio="H,16:9"
|
|
21
|
-
app:layout_constraintBottom_toBottomOf="parent"
|
|
22
|
-
app:layout_constraintEnd_toEndOf="parent"
|
|
23
|
-
app:layout_constraintStart_toStartOf="parent"
|
|
24
|
-
app:layout_constraintTop_toTopOf="parent"
|
|
25
|
-
tools:layout="@layout/fragment_tp_stream_player" />
|
|
26
|
-
|
|
27
|
-
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
28
|
-
|
|
29
|
-
</FrameLayout>
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
-
<network-security-config>
|
|
3
|
-
<domain-config cleartextTrafficPermitted="true">
|
|
4
|
-
<domain includeSubdomains="true">localhost</domain>
|
|
5
|
-
<domain includeSubdomains="true">10.0.2.2</domain>
|
|
6
|
-
<domain includeSubdomains="true">http://127.0.0.1</domain>
|
|
7
|
-
</domain-config>
|
|
8
|
-
</network-security-config>
|
package/ios/Tpstreams.h
DELETED
package/ios/Tpstreams.mm
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
#import "Tpstreams.h"
|
|
2
|
-
|
|
3
|
-
@implementation Tpstreams
|
|
4
|
-
RCT_EXPORT_MODULE()
|
|
5
|
-
|
|
6
|
-
- (NSNumber *)multiply:(double)a b:(double)b {
|
|
7
|
-
NSNumber *result = @(a * b);
|
|
8
|
-
|
|
9
|
-
return result;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
- (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:
|
|
13
|
-
(const facebook::react::ObjCTurboModule::InitParams &)params
|
|
14
|
-
{
|
|
15
|
-
return std::make_shared<facebook::react::NativeTpstreamsSpecJSI>(params);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
@end
|
|
@@ -1,39 +0,0 @@
|
|
|
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: GenerateModuleObjCpp
|
|
8
|
-
*
|
|
9
|
-
* We create an umbrella header (and corresponding implementation) here since
|
|
10
|
-
* Cxx compilation in BUCK has a limitation: source-code producing genrule()s
|
|
11
|
-
* must have a single output. More files => more genrule()s => slower builds.
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
#import "RNTpstreamsSpec.h"
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
@implementation NativeTpstreamsSpecBase
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
- (void)setEventEmitterCallback:(EventEmitterCallbackWrapper *)eventEmitterCallbackWrapper
|
|
21
|
-
{
|
|
22
|
-
_eventEmitterCallback = std::move(eventEmitterCallbackWrapper->_eventEmitterCallback);
|
|
23
|
-
}
|
|
24
|
-
@end
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
namespace facebook::react {
|
|
28
|
-
|
|
29
|
-
static facebook::jsi::Value __hostFunction_NativeTpstreamsSpecJSI_multiply(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
|
|
30
|
-
return static_cast<ObjCTurboModule&>(turboModule).invokeObjCMethod(rt, NumberKind, "multiply", @selector(multiply:b:), args, count);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
NativeTpstreamsSpecJSI::NativeTpstreamsSpecJSI(const ObjCTurboModule::InitParams ¶ms)
|
|
34
|
-
: ObjCTurboModule(params) {
|
|
35
|
-
|
|
36
|
-
methodMap_["multiply"] = MethodMetadata {2, __hostFunction_NativeTpstreamsSpecJSI_multiply};
|
|
37
|
-
|
|
38
|
-
}
|
|
39
|
-
} // namespace facebook::react
|
|
@@ -1,63 +0,0 @@
|
|
|
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: GenerateModuleObjCpp
|
|
8
|
-
*
|
|
9
|
-
* We create an umbrella header (and corresponding implementation) here since
|
|
10
|
-
* Cxx compilation in BUCK has a limitation: source-code producing genrule()s
|
|
11
|
-
* must have a single output. More files => more genrule()s => slower builds.
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
#ifndef __cplusplus
|
|
15
|
-
#error This file must be compiled as Obj-C++. If you are importing it, you must change your file extension to .mm.
|
|
16
|
-
#endif
|
|
17
|
-
|
|
18
|
-
// Avoid multiple includes of RNTpstreamsSpec symbols
|
|
19
|
-
#ifndef RNTpstreamsSpec_H
|
|
20
|
-
#define RNTpstreamsSpec_H
|
|
21
|
-
|
|
22
|
-
#import <Foundation/Foundation.h>
|
|
23
|
-
#import <RCTRequired/RCTRequired.h>
|
|
24
|
-
#import <RCTTypeSafety/RCTConvertHelpers.h>
|
|
25
|
-
#import <RCTTypeSafety/RCTTypedModuleConstants.h>
|
|
26
|
-
#import <React/RCTBridgeModule.h>
|
|
27
|
-
#import <React/RCTCxxConvert.h>
|
|
28
|
-
#import <React/RCTManagedPointer.h>
|
|
29
|
-
#import <ReactCommon/RCTTurboModule.h>
|
|
30
|
-
#import <optional>
|
|
31
|
-
#import <vector>
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
NS_ASSUME_NONNULL_BEGIN
|
|
35
|
-
|
|
36
|
-
@protocol NativeTpstreamsSpec <RCTBridgeModule, RCTTurboModule>
|
|
37
|
-
|
|
38
|
-
- (NSNumber *)multiply:(double)a
|
|
39
|
-
b:(double)b;
|
|
40
|
-
|
|
41
|
-
@end
|
|
42
|
-
|
|
43
|
-
@interface NativeTpstreamsSpecBase : NSObject {
|
|
44
|
-
@protected
|
|
45
|
-
facebook::react::EventEmitterCallback _eventEmitterCallback;
|
|
46
|
-
}
|
|
47
|
-
- (void)setEventEmitterCallback:(EventEmitterCallbackWrapper *)eventEmitterCallbackWrapper;
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
@end
|
|
51
|
-
|
|
52
|
-
namespace facebook::react {
|
|
53
|
-
/**
|
|
54
|
-
* ObjC++ class for module 'NativeTpstreams'
|
|
55
|
-
*/
|
|
56
|
-
class JSI_EXPORT NativeTpstreamsSpecJSI : public ObjCTurboModule {
|
|
57
|
-
public:
|
|
58
|
-
NativeTpstreamsSpecJSI(const ObjCTurboModule::InitParams ¶ms);
|
|
59
|
-
};
|
|
60
|
-
} // namespace facebook::react
|
|
61
|
-
|
|
62
|
-
NS_ASSUME_NONNULL_END
|
|
63
|
-
#endif // RNTpstreamsSpec_H
|
|
@@ -1,28 +0,0 @@
|
|
|
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: GenerateModuleCpp.js
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
#include "RNTpstreamsSpecJSI.h"
|
|
11
|
-
|
|
12
|
-
namespace facebook::react {
|
|
13
|
-
|
|
14
|
-
static jsi::Value __hostFunction_NativeTpstreamsCxxSpecJSI_multiply(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
15
|
-
return static_cast<NativeTpstreamsCxxSpecJSI *>(&turboModule)->multiply(
|
|
16
|
-
rt,
|
|
17
|
-
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber(),
|
|
18
|
-
count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asNumber()
|
|
19
|
-
);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
NativeTpstreamsCxxSpecJSI::NativeTpstreamsCxxSpecJSI(std::shared_ptr<CallInvoker> jsInvoker)
|
|
23
|
-
: TurboModule("Tpstreams", jsInvoker) {
|
|
24
|
-
methodMap_["multiply"] = MethodMetadata {2, __hostFunction_NativeTpstreamsCxxSpecJSI_multiply};
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
} // namespace facebook::react
|
|
@@ -1,71 +0,0 @@
|
|
|
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: GenerateModuleH.js
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
#pragma once
|
|
11
|
-
|
|
12
|
-
#include <ReactCommon/TurboModule.h>
|
|
13
|
-
#include <react/bridging/Bridging.h>
|
|
14
|
-
|
|
15
|
-
namespace facebook::react {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
class JSI_EXPORT NativeTpstreamsCxxSpecJSI : public TurboModule {
|
|
19
|
-
protected:
|
|
20
|
-
NativeTpstreamsCxxSpecJSI(std::shared_ptr<CallInvoker> jsInvoker);
|
|
21
|
-
|
|
22
|
-
public:
|
|
23
|
-
virtual double multiply(jsi::Runtime &rt, double a, double b) = 0;
|
|
24
|
-
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
template <typename T>
|
|
28
|
-
class JSI_EXPORT NativeTpstreamsCxxSpec : public TurboModule {
|
|
29
|
-
public:
|
|
30
|
-
jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override {
|
|
31
|
-
return delegate_.create(rt, propName);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
std::vector<jsi::PropNameID> getPropertyNames(jsi::Runtime& runtime) override {
|
|
35
|
-
return delegate_.getPropertyNames(runtime);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
static constexpr std::string_view kModuleName = "Tpstreams";
|
|
39
|
-
|
|
40
|
-
protected:
|
|
41
|
-
NativeTpstreamsCxxSpec(std::shared_ptr<CallInvoker> jsInvoker)
|
|
42
|
-
: TurboModule(std::string{NativeTpstreamsCxxSpec::kModuleName}, jsInvoker),
|
|
43
|
-
delegate_(reinterpret_cast<T*>(this), jsInvoker) {}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
private:
|
|
47
|
-
class Delegate : public NativeTpstreamsCxxSpecJSI {
|
|
48
|
-
public:
|
|
49
|
-
Delegate(T *instance, std::shared_ptr<CallInvoker> jsInvoker) :
|
|
50
|
-
NativeTpstreamsCxxSpecJSI(std::move(jsInvoker)), instance_(instance) {
|
|
51
|
-
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
double multiply(jsi::Runtime &rt, double a, double b) override {
|
|
55
|
-
static_assert(
|
|
56
|
-
bridging::getParameterCount(&T::multiply) == 3,
|
|
57
|
-
"Expected multiply(...) to have 3 parameters");
|
|
58
|
-
|
|
59
|
-
return bridging::callFromJs<double>(
|
|
60
|
-
rt, &T::multiply, jsInvoker_, instance_, std::move(a), std::move(b));
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
private:
|
|
64
|
-
friend class NativeTpstreamsCxxSpec;
|
|
65
|
-
T *instance_;
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
Delegate delegate_;
|
|
69
|
-
};
|
|
70
|
-
|
|
71
|
-
} // namespace facebook::react
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _reactNative = require("react-native");
|
|
8
|
-
var _default = exports.default = _reactNative.TurboModuleRegistry.getEnforcing('Tpstreams');
|
|
9
|
-
//# sourceMappingURL=NativeTpstreams.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNative","require","_default","exports","default","TurboModuleRegistry","getEnforcing"],"sourceRoot":"../../src","sources":["NativeTpstreams.ts"],"mappings":";;;;;;AACA,IAAAA,YAAA,GAAAC,OAAA;AAAmD,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAMpCC,gCAAmB,CAACC,YAAY,CAAO,WAAW,CAAC","ignoreList":[]}
|
package/lib/commonjs/index.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _reactNative = require("react-native");
|
|
8
|
-
const TpStreamsPlayerView = (0, _reactNative.requireNativeComponent)('TpStreamsPlayerView');
|
|
9
|
-
var _default = exports.default = TpStreamsPlayerView;
|
|
10
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNative","require","TpStreamsPlayerView","requireNativeComponent","_default","exports","default"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;;;;;AACA,IAAAA,YAAA,GAAAC,OAAA;AAEA,MAAMC,mBAAmB,GAAG,IAAAC,mCAAsB,EAChD,qBACF,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEaJ,mBAAmB","ignoreList":[]}
|
package/lib/commonjs/types.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sourceRoot":"../../src","sources":["types.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["TurboModuleRegistry","getEnforcing"],"sourceRoot":"../../src","sources":["NativeTpstreams.ts"],"mappings":";;AACA,SAASA,mBAAmB,QAAQ,cAAc;AAMlD,eAAeA,mBAAmB,CAACC,YAAY,CAAO,WAAW,CAAC","ignoreList":[]}
|
package/lib/module/types.js
DELETED
package/lib/module/types.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sourceRoot":"../../src","sources":["types.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"type":"commonjs"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"NativeTpstreams.d.ts","sourceRoot":"","sources":["../../../../src/NativeTpstreams.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAGhD,MAAM,WAAW,IAAK,SAAQ,WAAW;IACvC,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CACxC;;AAED,wBAAmE"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAGpD,QAAA,MAAM,mBAAmB,4DAExB,CAAC;AAEF,eAAe,mBAAmB,CAAC;AACnC,YAAY,EAAE,oBAAoB,EAAE,CAAC"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export type TpStreamsPlayerProps = {
|
|
2
|
-
videoId: string;
|
|
3
|
-
accessToken: string;
|
|
4
|
-
enableDownload?: boolean;
|
|
5
|
-
autoPlay?: boolean;
|
|
6
|
-
startAt?: number;
|
|
7
|
-
offlineLicenseExpireTime?: number;
|
|
8
|
-
downloadMetadata?: Record<string, string>;
|
|
9
|
-
style?: import('react-native').ViewStyle;
|
|
10
|
-
};
|
|
11
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,oBAAoB,GAAG;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC,gBAAgB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC1C,KAAK,CAAC,EAAE,OAAO,cAAc,EAAE,SAAS,CAAC;CAC1C,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"NativeTpstreams.d.ts","sourceRoot":"","sources":["../../../../src/NativeTpstreams.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAGhD,MAAM,WAAW,IAAK,SAAQ,WAAW;IACvC,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CACxC;;AAED,wBAAmE"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAGpD,QAAA,MAAM,mBAAmB,4DAExB,CAAC;AAEF,eAAe,mBAAmB,CAAC;AACnC,YAAY,EAAE,oBAAoB,EAAE,CAAC"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export type TpStreamsPlayerProps = {
|
|
2
|
-
videoId: string;
|
|
3
|
-
accessToken: string;
|
|
4
|
-
enableDownload?: boolean;
|
|
5
|
-
autoPlay?: boolean;
|
|
6
|
-
startAt?: number;
|
|
7
|
-
offlineLicenseExpireTime?: number;
|
|
8
|
-
downloadMetadata?: Record<string, string>;
|
|
9
|
-
style?: import('react-native').ViewStyle;
|
|
10
|
-
};
|
|
11
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,oBAAoB,GAAG;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC,gBAAgB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC1C,KAAK,CAAC,EAAE,OAAO,cAAc,EAAE,SAAS,CAAC;CAC1C,CAAC"}
|
package/react-native.config.js
DELETED
package/src/NativeTpstreams.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { TurboModule } from 'react-native';
|
|
2
|
-
import { TurboModuleRegistry } from 'react-native';
|
|
3
|
-
|
|
4
|
-
export interface Spec extends TurboModule {
|
|
5
|
-
multiply(a: number, b: number): number;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export default TurboModuleRegistry.getEnforcing<Spec>('Tpstreams');
|
package/src/types.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export type TpStreamsPlayerProps = {
|
|
2
|
-
videoId: string;
|
|
3
|
-
accessToken: string;
|
|
4
|
-
enableDownload?: boolean;
|
|
5
|
-
autoPlay?: boolean;
|
|
6
|
-
startAt?: number;
|
|
7
|
-
offlineLicenseExpireTime?: number;
|
|
8
|
-
downloadMetadata?: Record<string, string>;
|
|
9
|
-
style?: import('react-native').ViewStyle;
|
|
10
|
-
};
|
|
File without changes
|