react-native-tpstreams 0.1.14 → 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.
Files changed (71) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +20 -418
  3. package/Tpstreams.podspec +3 -25
  4. package/android/build.gradle +14 -42
  5. package/android/src/main/AndroidManifest.xml +1 -3
  6. package/android/src/main/java/com/tpstreams/TPStreamsRNModule.kt +18 -0
  7. package/android/src/main/java/com/tpstreams/{TpstreamsPackage.kt → TPStreamsRNPackage.kt} +10 -5
  8. package/android/src/main/java/com/tpstreams/TPStreamsRNPlayerView.kt +53 -0
  9. package/android/src/main/java/com/tpstreams/TPStreamsRNPlayerViewManager.kt +46 -0
  10. package/ios/TpstreamsView.h +14 -0
  11. package/ios/TpstreamsView.mm +71 -0
  12. package/ios/TpstreamsViewManager.mm +19 -0
  13. package/lib/module/TPStreamsPlayerViewNativeComponent.ts +9 -0
  14. package/lib/module/index.js +9 -3
  15. package/lib/module/index.js.map +1 -1
  16. package/lib/typescript/package.json +1 -0
  17. package/lib/typescript/src/TPStreamsPlayerViewNativeComponent.d.ts +9 -0
  18. package/lib/typescript/src/TPStreamsPlayerViewNativeComponent.d.ts.map +1 -0
  19. package/lib/typescript/src/index.d.ts +6 -0
  20. package/lib/typescript/src/index.d.ts.map +1 -0
  21. package/package.json +42 -76
  22. package/src/TPStreamsPlayerViewNativeComponent.ts +9 -0
  23. package/src/index.tsx +9 -7
  24. package/android/generated/java/com/tpstreams/NativeTpstreamsSpec.java +0 -37
  25. package/android/generated/jni/CMakeLists.txt +0 -36
  26. package/android/generated/jni/RNTpstreamsSpec-generated.cpp +0 -32
  27. package/android/generated/jni/RNTpstreamsSpec.h +0 -31
  28. package/android/generated/jni/react/renderer/components/RNTpstreamsSpec/RNTpstreamsSpecJSI-generated.cpp +0 -28
  29. package/android/generated/jni/react/renderer/components/RNTpstreamsSpec/RNTpstreamsSpecJSI.h +0 -71
  30. package/android/libs/extracted-aar/META-INF/com/android/build/gradle/aar-metadata.properties +0 -4
  31. package/android/src/main/AndroidManifestNew.xml +0 -2
  32. package/android/src/main/java/com/tpstreams/FragmentModule.kt +0 -192
  33. package/android/src/main/java/com/tpstreams/PlayerFragment.kt +0 -226
  34. package/android/src/main/java/com/tpstreams/TpStreamsPlayerView.kt +0 -93
  35. package/android/src/main/java/com/tpstreams/TpStreamsPlayerViewManager.kt +0 -49
  36. package/android/src/main/java/com/tpstreams/TpstreamsModule.kt +0 -168
  37. package/android/src/main/res/layout/fragment_player.xml +0 -29
  38. package/android/src/main/res/xml/network_security_config.xml +0 -8
  39. package/ios/Tpstreams.h +0 -6
  40. package/ios/Tpstreams.mm +0 -18
  41. package/ios/generated/RNTpstreamsSpec/RNTpstreamsSpec-generated.mm +0 -39
  42. package/ios/generated/RNTpstreamsSpec/RNTpstreamsSpec.h +0 -63
  43. package/ios/generated/RNTpstreamsSpecJSI-generated.cpp +0 -28
  44. package/ios/generated/RNTpstreamsSpecJSI.h +0 -71
  45. package/lib/commonjs/NativeTpstreams.js +0 -9
  46. package/lib/commonjs/NativeTpstreams.js.map +0 -1
  47. package/lib/commonjs/index.js +0 -10
  48. package/lib/commonjs/index.js.map +0 -1
  49. package/lib/commonjs/types.js +0 -2
  50. package/lib/commonjs/types.js.map +0 -1
  51. package/lib/module/NativeTpstreams.js +0 -5
  52. package/lib/module/NativeTpstreams.js.map +0 -1
  53. package/lib/module/types.js +0 -2
  54. package/lib/module/types.js.map +0 -1
  55. package/lib/typescript/commonjs/package.json +0 -1
  56. package/lib/typescript/commonjs/src/NativeTpstreams.d.ts +0 -7
  57. package/lib/typescript/commonjs/src/NativeTpstreams.d.ts.map +0 -1
  58. package/lib/typescript/commonjs/src/index.d.ts +0 -5
  59. package/lib/typescript/commonjs/src/index.d.ts.map +0 -1
  60. package/lib/typescript/commonjs/src/types.d.ts +0 -10
  61. package/lib/typescript/commonjs/src/types.d.ts.map +0 -1
  62. package/lib/typescript/module/src/NativeTpstreams.d.ts +0 -7
  63. package/lib/typescript/module/src/NativeTpstreams.d.ts.map +0 -1
  64. package/lib/typescript/module/src/index.d.ts +0 -5
  65. package/lib/typescript/module/src/index.d.ts.map +0 -1
  66. package/lib/typescript/module/src/types.d.ts +0 -10
  67. package/lib/typescript/module/src/types.d.ts.map +0 -1
  68. package/react-native.config.js +0 -12
  69. package/src/NativeTpstreams.ts +0 -8
  70. package/src/types.ts +0 -9
  71. /package/lib/{typescript/module → module}/package.json +0 -0
@@ -0,0 +1,53 @@
1
+ package com.tpstreams
2
+
3
+ import android.util.Log
4
+ import android.widget.FrameLayout
5
+ import com.facebook.react.uimanager.ThemedReactContext
6
+ import com.tpstreams.player.TPStreamsPlayer
7
+ import com.tpstreams.player.TPStreamsPlayerView
8
+
9
+ class TPStreamsRNPlayerView(context: ThemedReactContext) : FrameLayout(context) {
10
+
11
+ private val playerView: TPStreamsPlayerView = TPStreamsPlayerView(context)
12
+ private var player: TPStreamsPlayer? = null
13
+
14
+ private var videoId: String? = null
15
+ private var accessToken: String? = null
16
+
17
+ init {
18
+ addView(playerView, LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT))
19
+ }
20
+
21
+ fun setVideoId(videoId: String?) {
22
+ this.videoId = videoId
23
+ tryCreatePlayer()
24
+ }
25
+
26
+ fun setAccessToken(accessToken: String?) {
27
+ this.accessToken = accessToken
28
+ tryCreatePlayer()
29
+ }
30
+
31
+ private fun tryCreatePlayer() {
32
+ if (videoId.isNullOrEmpty() || accessToken.isNullOrEmpty()) return
33
+ if (player != null) return
34
+
35
+ try {
36
+ player = TPStreamsPlayer.create(context, videoId!!, accessToken!!)
37
+ playerView.player = player
38
+ playerView.showController()
39
+ } catch (e: Exception) {
40
+ Log.e("TPStreamsRN", "Error creating player", e)
41
+ }
42
+ }
43
+
44
+ override fun onDetachedFromWindow() {
45
+ super.onDetachedFromWindow()
46
+ try {
47
+ player?.release()
48
+ } catch (e: Exception) {
49
+ Log.e("TPStreamsRN", "Error releasing player", e)
50
+ }
51
+ player = null
52
+ }
53
+ }
@@ -0,0 +1,46 @@
1
+ package com.tpstreams
2
+
3
+ import com.facebook.react.bridge.ReadableMap
4
+ import com.facebook.react.module.annotations.ReactModule
5
+ import com.facebook.react.uimanager.SimpleViewManager
6
+ import com.facebook.react.uimanager.ThemedReactContext
7
+ import com.facebook.react.uimanager.ViewManagerDelegate
8
+ import com.facebook.react.uimanager.annotations.ReactProp
9
+ import com.facebook.react.viewmanagers.TPStreamsRNPlayerViewManagerInterface
10
+ import com.facebook.react.viewmanagers.TPStreamsRNPlayerViewManagerDelegate
11
+
12
+ @ReactModule(name = TPStreamsRNPlayerViewManager.NAME)
13
+ class TPStreamsRNPlayerViewManager : SimpleViewManager<TPStreamsRNPlayerView>(),
14
+ TPStreamsRNPlayerViewManagerInterface<TPStreamsRNPlayerView> {
15
+ private val mDelegate: ViewManagerDelegate<TPStreamsRNPlayerView>
16
+
17
+ init {
18
+ mDelegate = TPStreamsRNPlayerViewManagerDelegate(this)
19
+ }
20
+
21
+ override fun getDelegate(): ViewManagerDelegate<TPStreamsRNPlayerView>? {
22
+ return mDelegate
23
+ }
24
+
25
+ override fun getName(): String {
26
+ return NAME
27
+ }
28
+
29
+ public override fun createViewInstance(context: ThemedReactContext): TPStreamsRNPlayerView {
30
+ return TPStreamsRNPlayerView(context)
31
+ }
32
+
33
+ @ReactProp(name = "videoId")
34
+ override fun setVideoId(view: TPStreamsRNPlayerView, videoId: String?) {
35
+ view.setVideoId(videoId)
36
+ }
37
+
38
+ @ReactProp(name = "accessToken")
39
+ override fun setAccessToken(view: TPStreamsRNPlayerView, accessToken: String?) {
40
+ view.setAccessToken(accessToken)
41
+ }
42
+
43
+ companion object {
44
+ const val NAME = "TPStreamsRNPlayerView"
45
+ }
46
+ }
@@ -0,0 +1,14 @@
1
+ #import <React/RCTViewComponentView.h>
2
+ #import <UIKit/UIKit.h>
3
+
4
+ #ifndef TpstreamsViewNativeComponent_h
5
+ #define TpstreamsViewNativeComponent_h
6
+
7
+ NS_ASSUME_NONNULL_BEGIN
8
+
9
+ @interface TpstreamsView : RCTViewComponentView
10
+ @end
11
+
12
+ NS_ASSUME_NONNULL_END
13
+
14
+ #endif /* TpstreamsViewNativeComponent_h */
@@ -0,0 +1,71 @@
1
+ #import "TpstreamsView.h"
2
+
3
+ #import <react/renderer/components/TpstreamsViewSpec/ComponentDescriptors.h>
4
+ #import <react/renderer/components/TpstreamsViewSpec/EventEmitters.h>
5
+ #import <react/renderer/components/TpstreamsViewSpec/Props.h>
6
+ #import <react/renderer/components/TpstreamsViewSpec/RCTComponentViewHelpers.h>
7
+
8
+ #import "RCTFabricComponentsPlugins.h"
9
+
10
+ using namespace facebook::react;
11
+
12
+ @interface TpstreamsView () <RCTTpstreamsViewViewProtocol>
13
+
14
+ @end
15
+
16
+ @implementation TpstreamsView {
17
+ UIView * _view;
18
+ }
19
+
20
+ + (ComponentDescriptorProvider)componentDescriptorProvider
21
+ {
22
+ return concreteComponentDescriptorProvider<TpstreamsViewComponentDescriptor>();
23
+ }
24
+
25
+ - (instancetype)initWithFrame:(CGRect)frame
26
+ {
27
+ if (self = [super initWithFrame:frame]) {
28
+ static const auto defaultProps = std::make_shared<const TpstreamsViewProps>();
29
+ _props = defaultProps;
30
+
31
+ _view = [[UIView alloc] init];
32
+
33
+ self.contentView = _view;
34
+ }
35
+
36
+ return self;
37
+ }
38
+
39
+ - (void)updateProps:(Props::Shared const &)props oldProps:(Props::Shared const &)oldProps
40
+ {
41
+ const auto &oldViewProps = *std::static_pointer_cast<TpstreamsViewProps const>(_props);
42
+ const auto &newViewProps = *std::static_pointer_cast<TpstreamsViewProps const>(props);
43
+
44
+ if (oldViewProps.color != newViewProps.color) {
45
+ NSString * colorToConvert = [[NSString alloc] initWithUTF8String: newViewProps.color.c_str()];
46
+ [_view setBackgroundColor:[self hexStringToColor:colorToConvert]];
47
+ }
48
+
49
+ [super updateProps:props oldProps:oldProps];
50
+ }
51
+
52
+ Class<RCTComponentViewProtocol> TpstreamsViewCls(void)
53
+ {
54
+ return TpstreamsView.class;
55
+ }
56
+
57
+ - hexStringToColor:(NSString *)stringToConvert
58
+ {
59
+ NSString *noHashString = [stringToConvert stringByReplacingOccurrencesOfString:@"#" withString:@""];
60
+ NSScanner *stringScanner = [NSScanner scannerWithString:noHashString];
61
+
62
+ unsigned hex;
63
+ if (![stringScanner scanHexInt:&hex]) return nil;
64
+ int r = (hex >> 16) & 0xFF;
65
+ int g = (hex >> 8) & 0xFF;
66
+ int b = (hex) & 0xFF;
67
+
68
+ return [UIColor colorWithRed:r / 255.0f green:g / 255.0f blue:b / 255.0f alpha:1.0f];
69
+ }
70
+
71
+ @end
@@ -0,0 +1,19 @@
1
+ #import <React/RCTViewManager.h>
2
+ #import <React/RCTUIManager.h>
3
+ #import "RCTBridge.h"
4
+
5
+ @interface TpstreamsViewManager : RCTViewManager
6
+ @end
7
+
8
+ @implementation TpstreamsViewManager
9
+
10
+ RCT_EXPORT_MODULE(TpstreamsView)
11
+
12
+ - (UIView *)view
13
+ {
14
+ return [[UIView alloc] init];
15
+ }
16
+
17
+ RCT_EXPORT_VIEW_PROPERTY(color, NSString)
18
+
19
+ @end
@@ -0,0 +1,9 @@
1
+ import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
2
+ import type { ViewProps } from 'react-native';
3
+
4
+ interface NativeProps extends ViewProps {
5
+ videoId?: string;
6
+ accessToken?: string;
7
+ }
8
+
9
+ export default codegenNativeComponent<NativeProps>('TPStreamsRNPlayerView');
@@ -1,6 +1,12 @@
1
1
  "use strict";
2
2
 
3
- import { requireNativeComponent } from 'react-native';
4
- const TpStreamsPlayerView = requireNativeComponent('TpStreamsPlayerView');
5
- export default TpStreamsPlayerView;
3
+ import { NativeModules } from 'react-native';
4
+ export { default as TPStreamsPlayerView } from './TPStreamsPlayerViewNativeComponent';
5
+ export * from './TPStreamsPlayerViewNativeComponent';
6
+ const TPStreamsModule = NativeModules.TPStreams;
7
+ export const TPStreams = {
8
+ initialize: organizationId => {
9
+ TPStreamsModule.initialize(organizationId);
10
+ }
11
+ };
6
12
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["requireNativeComponent","TpStreamsPlayerView"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;AACA,SAASA,sBAAsB,QAAQ,cAAc;AAErD,MAAMC,mBAAmB,GAAGD,sBAAsB,CAChD,qBACF,CAAC;AAED,eAAeC,mBAAmB","ignoreList":[]}
1
+ {"version":3,"names":["NativeModules","default","TPStreamsPlayerView","TPStreamsModule","TPStreams","initialize","organizationId"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;AAAA,SAASA,aAAa,QAAQ,cAAc;AAC5C,SAASC,OAAO,IAAIC,mBAAmB,QAAQ,sCAAsC;AACrF,cAAc,sCAAsC;AAEpD,MAAMC,eAAe,GAAGH,aAAa,CAACI,SAAS;AAE/C,OAAO,MAAMA,SAAS,GAAG;EACvBC,UAAU,EAAGC,cAAsB,IAAW;IAC5CH,eAAe,CAACE,UAAU,CAACC,cAAc,CAAC;EAC5C;AACF,CAAC","ignoreList":[]}
@@ -0,0 +1 @@
1
+ {"type":"module"}
@@ -0,0 +1,9 @@
1
+ /// <reference types="react-native/types/modules/Codegen" />
2
+ import type { ViewProps } from 'react-native';
3
+ interface NativeProps extends ViewProps {
4
+ videoId?: string;
5
+ accessToken?: string;
6
+ }
7
+ declare const _default: import("react-native/Libraries/Utilities/codegenNativeComponent").NativeComponentType<NativeProps>;
8
+ export default _default;
9
+ //# sourceMappingURL=TPStreamsPlayerViewNativeComponent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TPStreamsPlayerViewNativeComponent.d.ts","sourceRoot":"","sources":["../../../src/TPStreamsPlayerViewNativeComponent.ts"],"names":[],"mappings":";AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C,UAAU,WAAY,SAAQ,SAAS;IACrC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;;AAED,wBAA4E"}
@@ -0,0 +1,6 @@
1
+ export { default as TPStreamsPlayerView } from './TPStreamsPlayerViewNativeComponent';
2
+ export * from './TPStreamsPlayerViewNativeComponent';
3
+ export declare const TPStreams: {
4
+ initialize: (organizationId: string) => void;
5
+ };
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AACtF,cAAc,sCAAsC,CAAC;AAIrD,eAAO,MAAM,SAAS;iCACS,MAAM,KAAG,IAAI;CAG3C,CAAC"}
package/package.json CHANGED
@@ -1,21 +1,16 @@
1
1
  {
2
2
  "name": "react-native-tpstreams",
3
- "version": "0.1.14",
4
- "description": "Video Component for TPStreams",
5
- "source": "./src/index.tsx",
6
- "main": "./lib/commonjs/index.js",
7
- "module": "./lib/module/index.js",
3
+ "version": "0.2.0",
4
+ "description": "Video component for TPStreams",
5
+ "main": "./lib/module/index.js",
6
+ "types": "./lib/typescript/src/index.d.ts",
8
7
  "exports": {
9
8
  ".": {
10
- "import": {
11
- "types": "./lib/typescript/module/src/index.d.ts",
12
- "default": "./lib/module/index.js"
13
- },
14
- "require": {
15
- "types": "./lib/typescript/commonjs/src/index.d.ts",
16
- "default": "./lib/commonjs/index.js"
17
- }
18
- }
9
+ "source": "./src/index.tsx",
10
+ "types": "./lib/typescript/src/index.d.ts",
11
+ "default": "./lib/module/index.js"
12
+ },
13
+ "./package.json": "./package.json"
19
14
  },
20
15
  "files": [
21
16
  "src",
@@ -43,7 +38,7 @@
43
38
  "lint": "eslint \"**/*.{js,ts,tsx}\"",
44
39
  "clean": "del-cli android/build example/android/build example/android/app/build example/ios/build lib",
45
40
  "prepare": "bob build",
46
- "release": "release-it"
41
+ "release": "release-it --only-version"
47
42
  },
48
43
  "keywords": [
49
44
  "react-native",
@@ -52,41 +47,42 @@
52
47
  ],
53
48
  "repository": {
54
49
  "type": "git",
55
- "url": "git+https://github.com/testpress/react-native-player-sdk.git"
50
+ "url": "git+https://github.com/testpress/react-native-tpstreams.git"
56
51
  },
57
- "author": "Bharath <bharath@testpress.in> (https://github.com/bharathwaaj)",
52
+ "author": "Testpress <support@testpress.in> (https://github.com/testpress)",
58
53
  "license": "MIT",
59
54
  "bugs": {
60
- "url": "https://github.com/testpress/react-native-player-sdk/issues"
55
+ "url": "https://github.com/testpress/react-native-tpstreams/issues"
61
56
  },
62
- "homepage": "https://github.com/testpress/react-native-player-sdk#readme",
57
+ "homepage": "https://github.com/testpress/react-native-tpstreams#readme",
63
58
  "publishConfig": {
64
59
  "registry": "https://registry.npmjs.org/"
65
60
  },
66
61
  "devDependencies": {
67
- "@commitlint/config-conventional": "^17.0.2",
62
+ "@commitlint/config-conventional": "^19.6.0",
63
+ "@eslint/compat": "^1.2.7",
64
+ "@eslint/eslintrc": "^3.3.0",
65
+ "@eslint/js": "^9.22.0",
68
66
  "@evilmartians/lefthook": "^1.5.0",
69
- "@react-native-community/cli": "15.0.1",
70
- "@react-native/eslint-config": "^0.73.1",
67
+ "@react-native-community/cli": "15.0.0-alpha.2",
68
+ "@react-native/babel-preset": "0.79.2",
69
+ "@react-native/eslint-config": "^0.78.0",
71
70
  "@release-it/conventional-changelog": "^9.0.2",
72
71
  "@types/jest": "^29.5.5",
73
- "@types/react": "^18.2.44",
74
- "commitlint": "^17.0.2",
72
+ "@types/react": "^19.0.0",
73
+ "commitlint": "^19.6.1",
75
74
  "del-cli": "^5.1.0",
76
- "eslint": "^8.51.0",
77
- "eslint-config-prettier": "^9.0.0",
78
- "eslint-plugin-prettier": "^5.0.1",
75
+ "eslint": "^9.22.0",
76
+ "eslint-config-prettier": "^10.1.1",
77
+ "eslint-plugin-prettier": "^5.2.3",
79
78
  "jest": "^29.7.0",
80
79
  "prettier": "^3.0.3",
81
80
  "react": "19.0.0",
82
- "react-native": "0.78.0",
83
- "react-native-builder-bob": "^0.37.0",
81
+ "react-native": "0.79.2",
82
+ "react-native-builder-bob": "^0.40.11",
84
83
  "release-it": "^17.10.0",
85
84
  "turbo": "^1.10.7",
86
- "typescript": "^5.2.2"
87
- },
88
- "resolutions": {
89
- "@types/react": "^18.2.44"
85
+ "typescript": "5.4.5"
90
86
  },
91
87
  "peerDependencies": {
92
88
  "react": "*",
@@ -121,34 +117,12 @@
121
117
  },
122
118
  "plugins": {
123
119
  "@release-it/conventional-changelog": {
124
- "preset": "angular"
125
- }
126
- }
127
- },
128
- "eslintConfig": {
129
- "root": true,
130
- "extends": [
131
- "@react-native",
132
- "prettier"
133
- ],
134
- "rules": {
135
- "react/react-in-jsx-scope": "off",
136
- "prettier/prettier": [
137
- "error",
138
- {
139
- "quoteProps": "consistent",
140
- "singleQuote": true,
141
- "tabWidth": 2,
142
- "trailingComma": "es5",
143
- "useTabs": false
120
+ "preset": {
121
+ "name": "angular"
144
122
  }
145
- ]
123
+ }
146
124
  }
147
125
  },
148
- "eslintIgnore": [
149
- "node_modules/",
150
- "lib/"
151
- ],
152
126
  "prettier": {
153
127
  "quoteProps": "consistent",
154
128
  "singleQuote": true,
@@ -160,13 +134,6 @@
160
134
  "source": "src",
161
135
  "output": "lib",
162
136
  "targets": [
163
- "codegen",
164
- [
165
- "commonjs",
166
- {
167
- "esm": true
168
- }
169
- ],
170
137
  [
171
138
  "module",
172
139
  {
@@ -176,28 +143,27 @@
176
143
  [
177
144
  "typescript",
178
145
  {
179
- "project": "tsconfig.build.json",
180
- "esm": true
146
+ "project": "tsconfig.build.json"
181
147
  }
182
148
  ]
183
149
  ]
184
150
  },
185
151
  "codegenConfig": {
186
- "name": "RNTpstreamsSpec",
187
- "type": "modules",
152
+ "name": "TPStreamsPlayerViewSpec",
153
+ "type": "all",
188
154
  "jsSrcsDir": "src",
189
- "outputDir": {
190
- "ios": "ios/generated",
191
- "android": "android/generated"
192
- },
193
155
  "android": {
194
156
  "javaPackageName": "com.tpstreams"
195
157
  },
196
- "includesGeneratedCode": true
158
+ "ios": {
159
+ "componentProvider": {
160
+ "TPStreamsPlayerView": "TPStreamsPlayerView"
161
+ }
162
+ }
197
163
  },
198
164
  "create-react-native-library": {
199
- "type": "turbo-module",
200
165
  "languages": "kotlin-objc",
201
- "version": "0.48.3"
166
+ "type": "fabric-view",
167
+ "version": "0.50.3"
202
168
  }
203
169
  }
@@ -0,0 +1,9 @@
1
+ import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
2
+ import type { ViewProps } from 'react-native';
3
+
4
+ interface NativeProps extends ViewProps {
5
+ videoId?: string;
6
+ accessToken?: string;
7
+ }
8
+
9
+ export default codegenNativeComponent<NativeProps>('TPStreamsRNPlayerView');
package/src/index.tsx CHANGED
@@ -1,9 +1,11 @@
1
- import type { TpStreamsPlayerProps } from './types';
2
- import { requireNativeComponent } from 'react-native';
1
+ import { NativeModules } from 'react-native';
2
+ export { default as TPStreamsPlayerView } from './TPStreamsPlayerViewNativeComponent';
3
+ export * from './TPStreamsPlayerViewNativeComponent';
3
4
 
4
- const TpStreamsPlayerView = requireNativeComponent<TpStreamsPlayerProps>(
5
- 'TpStreamsPlayerView'
6
- );
5
+ const TPStreamsModule = NativeModules.TPStreams;
7
6
 
8
- export default TpStreamsPlayerView;
9
- export type { TpStreamsPlayerProps };
7
+ export const TPStreams = {
8
+ initialize: (organizationId: string): void => {
9
+ TPStreamsModule.initialize(organizationId);
10
+ },
11
+ };
@@ -1,37 +0,0 @@
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: GenerateModuleJavaSpec.js
9
- *
10
- * @nolint
11
- */
12
-
13
- package com.tpstreams;
14
-
15
- import com.facebook.proguard.annotations.DoNotStrip;
16
- import com.facebook.react.bridge.ReactApplicationContext;
17
- import com.facebook.react.bridge.ReactContextBaseJavaModule;
18
- import com.facebook.react.bridge.ReactMethod;
19
- import com.facebook.react.turbomodule.core.interfaces.TurboModule;
20
- import javax.annotation.Nonnull;
21
-
22
- public abstract class NativeTpstreamsSpec extends ReactContextBaseJavaModule implements TurboModule {
23
- public static final String NAME = "Tpstreams";
24
-
25
- public NativeTpstreamsSpec(ReactApplicationContext reactContext) {
26
- super(reactContext);
27
- }
28
-
29
- @Override
30
- public @Nonnull String getName() {
31
- return NAME;
32
- }
33
-
34
- @ReactMethod(isBlockingSynchronousMethod = true)
35
- @DoNotStrip
36
- public abstract double multiply(double a, double b);
37
- }
@@ -1,36 +0,0 @@
1
- # Copyright (c) Meta Platforms, Inc. and affiliates.
2
- #
3
- # This source code is licensed under the MIT license found in the
4
- # LICENSE file in the root directory of this source tree.
5
-
6
- cmake_minimum_required(VERSION 3.13)
7
- set(CMAKE_VERBOSE_MAKEFILE on)
8
-
9
- file(GLOB react_codegen_SRCS CONFIGURE_DEPENDS *.cpp react/renderer/components/RNTpstreamsSpec/*.cpp)
10
-
11
- add_library(
12
- react_codegen_RNTpstreamsSpec
13
- OBJECT
14
- ${react_codegen_SRCS}
15
- )
16
-
17
- target_include_directories(react_codegen_RNTpstreamsSpec PUBLIC . react/renderer/components/RNTpstreamsSpec)
18
-
19
- target_link_libraries(
20
- react_codegen_RNTpstreamsSpec
21
- fbjni
22
- jsi
23
- # We need to link different libraries based on whether we are building rncore or not, that's necessary
24
- # because we want to break a circular dependency between react_codegen_rncore and reactnative
25
- reactnative
26
- )
27
-
28
- target_compile_options(
29
- react_codegen_RNTpstreamsSpec
30
- PRIVATE
31
- -DLOG_TAG=\"ReactNative\"
32
- -fexceptions
33
- -frtti
34
- -std=c++20
35
- -Wall
36
- )
@@ -1,32 +0,0 @@
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: GenerateModuleJniCpp.js
9
- */
10
-
11
- #include "RNTpstreamsSpec.h"
12
-
13
- namespace facebook::react {
14
-
15
- static facebook::jsi::Value __hostFunction_NativeTpstreamsSpecJSI_multiply(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
16
- static jmethodID cachedMethodId = nullptr;
17
- return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, NumberKind, "multiply", "(DD)D", args, count, cachedMethodId);
18
- }
19
-
20
- NativeTpstreamsSpecJSI::NativeTpstreamsSpecJSI(const JavaTurboModule::InitParams &params)
21
- : JavaTurboModule(params) {
22
- methodMap_["multiply"] = MethodMetadata {2, __hostFunction_NativeTpstreamsSpecJSI_multiply};
23
- }
24
-
25
- std::shared_ptr<TurboModule> RNTpstreamsSpec_ModuleProvider(const std::string &moduleName, const JavaTurboModule::InitParams &params) {
26
- if (moduleName == "Tpstreams") {
27
- return std::make_shared<NativeTpstreamsSpecJSI>(params);
28
- }
29
- return nullptr;
30
- }
31
-
32
- } // namespace facebook::react
@@ -1,31 +0,0 @@
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: GenerateModuleJniH.js
9
- */
10
-
11
- #pragma once
12
-
13
- #include <ReactCommon/JavaTurboModule.h>
14
- #include <ReactCommon/TurboModule.h>
15
- #include <jsi/jsi.h>
16
-
17
- namespace facebook::react {
18
-
19
- /**
20
- * JNI C++ class for module 'NativeTpstreams'
21
- */
22
- class JSI_EXPORT NativeTpstreamsSpecJSI : public JavaTurboModule {
23
- public:
24
- NativeTpstreamsSpecJSI(const JavaTurboModule::InitParams &params);
25
- };
26
-
27
-
28
- JSI_EXPORT
29
- std::shared_ptr<TurboModule> RNTpstreamsSpec_ModuleProvider(const std::string &moduleName, const JavaTurboModule::InitParams &params);
30
-
31
- } // namespace facebook::react
@@ -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