react-native-tpstreams 1.0.8-debug.1 → 1.1.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/android/gradle.properties +1 -1
- package/android/src/main/java/com/tpstreams/TPStreamsRNPlayerView.kt +15 -1
- package/ios/TPStreamsDownloadModule.swift +1 -1
- package/ios/TPStreamsRNPlayerView.swift +13 -4
- package/ios/TPStreamsRNPlayerViewManager.swift +1 -1
- package/package.json +1 -1
- package/android/app/build/generated/source/codegen/java/com/facebook/react/viewmanagers/TPStreamsRNPlayerViewManagerDelegate.java +0 -87
- package/android/app/build/generated/source/codegen/java/com/facebook/react/viewmanagers/TPStreamsRNPlayerViewManagerInterface.java +0 -34
- package/android/app/build/generated/source/codegen/jni/CMakeLists.txt +0 -36
- package/android/app/build/generated/source/codegen/jni/TPStreamsPlayerViewSpec-generated.cpp +0 -22
- package/android/app/build/generated/source/codegen/jni/TPStreamsPlayerViewSpec.h +0 -24
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/TPStreamsPlayerViewSpec/ComponentDescriptors.cpp +0 -22
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/TPStreamsPlayerViewSpec/ComponentDescriptors.h +0 -24
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/TPStreamsPlayerViewSpec/EventEmitters.cpp +0 -107
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/TPStreamsPlayerViewSpec/EventEmitters.h +0 -81
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/TPStreamsPlayerViewSpec/Props.cpp +0 -32
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/TPStreamsPlayerViewSpec/Props.h +0 -34
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/TPStreamsPlayerViewSpec/ShadowNodes.cpp +0 -17
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/TPStreamsPlayerViewSpec/ShadowNodes.h +0 -32
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/TPStreamsPlayerViewSpec/States.cpp +0 -16
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/TPStreamsPlayerViewSpec/States.h +0 -29
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/TPStreamsPlayerViewSpec/TPStreamsPlayerViewSpecJSI-generated.cpp +0 -17
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/TPStreamsPlayerViewSpec/TPStreamsPlayerViewSpecJSI.h +0 -19
|
@@ -8,6 +8,7 @@ import com.facebook.react.uimanager.ThemedReactContext
|
|
|
8
8
|
import com.facebook.react.uimanager.events.RCTEventEmitter
|
|
9
9
|
import com.tpstreams.player.TPStreamsPlayer
|
|
10
10
|
import com.tpstreams.player.TPStreamsPlayerView
|
|
11
|
+
import com.tpstreams.player.constants.PlaybackError
|
|
11
12
|
import androidx.media3.common.Player
|
|
12
13
|
import androidx.media3.common.PlaybackParameters
|
|
13
14
|
import androidx.media3.common.PlaybackException
|
|
@@ -92,7 +93,7 @@ class TPStreamsRNPlayerView(context: ThemedReactContext) : FrameLayout(context)
|
|
|
92
93
|
}
|
|
93
94
|
|
|
94
95
|
fun setOfflineLicenseExpireTime(expireTime: Long?) {
|
|
95
|
-
this.offlineLicenseExpireTime = expireTime
|
|
96
|
+
this.offlineLicenseExpireTime = sanitizeLicenseDuration(expireTime)
|
|
96
97
|
}
|
|
97
98
|
|
|
98
99
|
fun setNewAccessToken(newToken: String) {
|
|
@@ -129,6 +130,12 @@ class TPStreamsRNPlayerView(context: ThemedReactContext) : FrameLayout(context)
|
|
|
129
130
|
accessTokenCallback = callback
|
|
130
131
|
emitEvent("onAccessTokenExpired", mapOf("videoId" to videoId))
|
|
131
132
|
}
|
|
133
|
+
|
|
134
|
+
override fun onError(error: PlaybackError, message: String) {
|
|
135
|
+
Log.e("TPStreamsRN", "TPStreamsPlayer error: $error - $message")
|
|
136
|
+
val errorCode = ERROR_CODE_PLAYER_CREATION_FAILED + error.ordinal
|
|
137
|
+
sendErrorEvent("Player error", errorCode, message)
|
|
138
|
+
}
|
|
132
139
|
}
|
|
133
140
|
|
|
134
141
|
// Add player event listeners
|
|
@@ -240,4 +247,11 @@ class TPStreamsRNPlayerView(context: ThemedReactContext) : FrameLayout(context)
|
|
|
240
247
|
player = null
|
|
241
248
|
accessTokenCallback = null
|
|
242
249
|
}
|
|
250
|
+
|
|
251
|
+
private fun sanitizeLicenseDuration(value: Long?): Long {
|
|
252
|
+
if (value == null || value <= 0L) {
|
|
253
|
+
return DEFAULT_OFFLINE_LICENSE_EXPIRE_TIME
|
|
254
|
+
}
|
|
255
|
+
return minOf(value, DEFAULT_OFFLINE_LICENSE_EXPIRE_TIME)
|
|
256
|
+
}
|
|
243
257
|
}
|
|
@@ -37,7 +37,7 @@ class TPStreamsDownloadModule: RCTEventEmitter, TPStreamsDownloadDelegate {
|
|
|
37
37
|
|
|
38
38
|
@objc
|
|
39
39
|
func initializeModule() {
|
|
40
|
-
//no-op
|
|
40
|
+
// no-op to force module initialization for setting up the token expiry delegate chain.
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
func setAccessTokenDelegate(_ delegate: TokenRequestDelegate) {
|
|
@@ -16,6 +16,8 @@ class TPStreamsRNPlayerView: UIView {
|
|
|
16
16
|
case ended = 4
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
+
private static let maxOfflineLicenseDuration: Double = 15 * 24 * 60 * 60
|
|
20
|
+
|
|
19
21
|
private var player: TPAVPlayer?
|
|
20
22
|
private var playerViewController: TPStreamPlayerViewController?
|
|
21
23
|
private var playerStatusObserver: NSKeyValueObservation?
|
|
@@ -24,13 +26,17 @@ class TPStreamsRNPlayerView: UIView {
|
|
|
24
26
|
private var playerStateObserver: NSKeyValueObservation?
|
|
25
27
|
private var setupScheduled = false
|
|
26
28
|
private var pendingOfflineCredentialsCompletion: ((String?, Double) -> Void)?
|
|
29
|
+
private var _offlineLicenseExpireTime: Double = TPStreamsRNPlayerView.maxOfflineLicenseDuration
|
|
27
30
|
|
|
28
31
|
@objc var videoId: NSString = ""
|
|
29
32
|
@objc var accessToken: NSString = ""
|
|
30
33
|
@objc var shouldAutoPlay: Bool = true
|
|
31
34
|
@objc var startAt: Double = 0
|
|
32
35
|
@objc var enableDownload: Bool = false
|
|
33
|
-
@objc var offlineLicenseExpireTime: Double
|
|
36
|
+
@objc var offlineLicenseExpireTime: Double {
|
|
37
|
+
get { _offlineLicenseExpireTime }
|
|
38
|
+
set { _offlineLicenseExpireTime = TPStreamsRNPlayerView.sanitizeLicenseDuration(newValue) }
|
|
39
|
+
}
|
|
34
40
|
@objc var showDefaultCaptions: Bool = false
|
|
35
41
|
@objc var downloadMetadata: NSString?
|
|
36
42
|
|
|
@@ -175,9 +181,7 @@ class TPStreamsRNPlayerView: UIView {
|
|
|
175
181
|
.setwatchedProgressTrackColor(.systemBlue)
|
|
176
182
|
.setDownloadMetadata(metadataDict)
|
|
177
183
|
|
|
178
|
-
|
|
179
|
-
configBuilder.setLicenseDurationSeconds(offlineLicenseExpireTime)
|
|
180
|
-
}
|
|
184
|
+
configBuilder.setLicenseDurationSeconds(offlineLicenseExpireTime)
|
|
181
185
|
|
|
182
186
|
if enableDownload {
|
|
183
187
|
configBuilder.showDownloadOption()
|
|
@@ -283,6 +287,11 @@ class TPStreamsRNPlayerView: UIView {
|
|
|
283
287
|
TPStreamsDownloadModule.shared?.setAccessTokenDelegate(self)
|
|
284
288
|
}
|
|
285
289
|
|
|
290
|
+
private static func sanitizeLicenseDuration(_ value: Double) -> Double {
|
|
291
|
+
guard value > 0 else { return maxOfflineLicenseDuration }
|
|
292
|
+
return min(value, maxOfflineLicenseDuration)
|
|
293
|
+
}
|
|
294
|
+
|
|
286
295
|
private func parseMetadataJSON(from jsonString: NSString?) -> [String: Any]? {
|
|
287
296
|
guard let metadataString = jsonString as String? else { return nil }
|
|
288
297
|
|
package/package.json
CHANGED
|
@@ -1,87 +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: GeneratePropsJavaDelegate.js
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
package com.facebook.react.viewmanagers;
|
|
11
|
-
|
|
12
|
-
import android.view.View;
|
|
13
|
-
import androidx.annotation.Nullable;
|
|
14
|
-
import com.facebook.react.bridge.ReadableArray;
|
|
15
|
-
import com.facebook.react.uimanager.BaseViewManager;
|
|
16
|
-
import com.facebook.react.uimanager.BaseViewManagerDelegate;
|
|
17
|
-
import com.facebook.react.uimanager.LayoutShadowNode;
|
|
18
|
-
|
|
19
|
-
public class TPStreamsRNPlayerViewManagerDelegate<T extends View, U extends BaseViewManager<T, ? extends LayoutShadowNode> & TPStreamsRNPlayerViewManagerInterface<T>> extends BaseViewManagerDelegate<T, U> {
|
|
20
|
-
public TPStreamsRNPlayerViewManagerDelegate(U viewManager) {
|
|
21
|
-
super(viewManager);
|
|
22
|
-
}
|
|
23
|
-
@Override
|
|
24
|
-
public void setProperty(T view, String propName, @Nullable Object value) {
|
|
25
|
-
switch (propName) {
|
|
26
|
-
case "videoId":
|
|
27
|
-
mViewManager.setVideoId(view, value == null ? null : (String) value);
|
|
28
|
-
break;
|
|
29
|
-
case "accessToken":
|
|
30
|
-
mViewManager.setAccessToken(view, value == null ? null : (String) value);
|
|
31
|
-
break;
|
|
32
|
-
case "shouldAutoPlay":
|
|
33
|
-
mViewManager.setShouldAutoPlay(view, value == null ? false : (boolean) value);
|
|
34
|
-
break;
|
|
35
|
-
case "startAt":
|
|
36
|
-
mViewManager.setStartAt(view, value == null ? 0f : ((Double) value).doubleValue());
|
|
37
|
-
break;
|
|
38
|
-
case "enableDownload":
|
|
39
|
-
mViewManager.setEnableDownload(view, value == null ? false : (boolean) value);
|
|
40
|
-
break;
|
|
41
|
-
case "showDefaultCaptions":
|
|
42
|
-
mViewManager.setShowDefaultCaptions(view, value == null ? false : (boolean) value);
|
|
43
|
-
break;
|
|
44
|
-
case "downloadMetadata":
|
|
45
|
-
mViewManager.setDownloadMetadata(view, value == null ? null : (String) value);
|
|
46
|
-
break;
|
|
47
|
-
case "offlineLicenseExpireTime":
|
|
48
|
-
mViewManager.setOfflineLicenseExpireTime(view, value == null ? 0f : ((Double) value).doubleValue());
|
|
49
|
-
break;
|
|
50
|
-
default:
|
|
51
|
-
super.setProperty(view, propName, value);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
@Override
|
|
56
|
-
public void receiveCommand(T view, String commandName, @Nullable ReadableArray args) {
|
|
57
|
-
switch (commandName) {
|
|
58
|
-
case "play":
|
|
59
|
-
mViewManager.play(view);
|
|
60
|
-
break;
|
|
61
|
-
case "pause":
|
|
62
|
-
mViewManager.pause(view);
|
|
63
|
-
break;
|
|
64
|
-
case "seekTo":
|
|
65
|
-
mViewManager.seekTo(view, args.getDouble(0));
|
|
66
|
-
break;
|
|
67
|
-
case "setPlaybackSpeed":
|
|
68
|
-
mViewManager.setPlaybackSpeed(view, (float) args.getDouble(0));
|
|
69
|
-
break;
|
|
70
|
-
case "getCurrentPosition":
|
|
71
|
-
mViewManager.getCurrentPosition(view);
|
|
72
|
-
break;
|
|
73
|
-
case "getDuration":
|
|
74
|
-
mViewManager.getDuration(view);
|
|
75
|
-
break;
|
|
76
|
-
case "isPlaying":
|
|
77
|
-
mViewManager.isPlaying(view);
|
|
78
|
-
break;
|
|
79
|
-
case "getPlaybackSpeed":
|
|
80
|
-
mViewManager.getPlaybackSpeed(view);
|
|
81
|
-
break;
|
|
82
|
-
case "setNewAccessToken":
|
|
83
|
-
mViewManager.setNewAccessToken(view, args.getString(0));
|
|
84
|
-
break;
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
}
|
|
@@ -1,34 +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: GeneratePropsJavaInterface.js
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
package com.facebook.react.viewmanagers;
|
|
11
|
-
|
|
12
|
-
import android.view.View;
|
|
13
|
-
import androidx.annotation.Nullable;
|
|
14
|
-
import com.facebook.react.uimanager.ViewManagerWithGeneratedInterface;
|
|
15
|
-
|
|
16
|
-
public interface TPStreamsRNPlayerViewManagerInterface<T extends View> extends ViewManagerWithGeneratedInterface {
|
|
17
|
-
void setVideoId(T view, @Nullable String value);
|
|
18
|
-
void setAccessToken(T view, @Nullable String value);
|
|
19
|
-
void setShouldAutoPlay(T view, boolean value);
|
|
20
|
-
void setStartAt(T view, double value);
|
|
21
|
-
void setEnableDownload(T view, boolean value);
|
|
22
|
-
void setShowDefaultCaptions(T view, boolean value);
|
|
23
|
-
void setDownloadMetadata(T view, @Nullable String value);
|
|
24
|
-
void setOfflineLicenseExpireTime(T view, double value);
|
|
25
|
-
void play(T view);
|
|
26
|
-
void pause(T view);
|
|
27
|
-
void seekTo(T view, double positionMs);
|
|
28
|
-
void setPlaybackSpeed(T view, float speed);
|
|
29
|
-
void getCurrentPosition(T view);
|
|
30
|
-
void getDuration(T view);
|
|
31
|
-
void isPlaying(T view);
|
|
32
|
-
void getPlaybackSpeed(T view);
|
|
33
|
-
void setNewAccessToken(T view, String newToken);
|
|
34
|
-
}
|
|
@@ -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/TPStreamsPlayerViewSpec/*.cpp)
|
|
10
|
-
|
|
11
|
-
add_library(
|
|
12
|
-
react_codegen_TPStreamsPlayerViewSpec
|
|
13
|
-
OBJECT
|
|
14
|
-
${react_codegen_SRCS}
|
|
15
|
-
)
|
|
16
|
-
|
|
17
|
-
target_include_directories(react_codegen_TPStreamsPlayerViewSpec PUBLIC . react/renderer/components/TPStreamsPlayerViewSpec)
|
|
18
|
-
|
|
19
|
-
target_link_libraries(
|
|
20
|
-
react_codegen_TPStreamsPlayerViewSpec
|
|
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_TPStreamsPlayerViewSpec
|
|
30
|
-
PRIVATE
|
|
31
|
-
-DLOG_TAG=\"ReactNative\"
|
|
32
|
-
-fexceptions
|
|
33
|
-
-frtti
|
|
34
|
-
-std=c++20
|
|
35
|
-
-Wall
|
|
36
|
-
)
|
package/android/app/build/generated/source/codegen/jni/TPStreamsPlayerViewSpec-generated.cpp
DELETED
|
@@ -1,22 +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 "TPStreamsPlayerViewSpec.h"
|
|
12
|
-
|
|
13
|
-
namespace facebook::react {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
std::shared_ptr<TurboModule> TPStreamsPlayerViewSpec_ModuleProvider(const std::string &moduleName, const JavaTurboModule::InitParams ¶ms) {
|
|
18
|
-
|
|
19
|
-
return nullptr;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
} // namespace facebook::react
|
|
@@ -1,24 +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
|
-
|
|
21
|
-
JSI_EXPORT
|
|
22
|
-
std::shared_ptr<TurboModule> TPStreamsPlayerViewSpec_ModuleProvider(const std::string &moduleName, const JavaTurboModule::InitParams ¶ms);
|
|
23
|
-
|
|
24
|
-
} // namespace facebook::react
|
|
@@ -1,22 +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: GenerateComponentDescriptorCpp.js
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
#include <react/renderer/components/TPStreamsPlayerViewSpec/ComponentDescriptors.h>
|
|
12
|
-
#include <react/renderer/core/ConcreteComponentDescriptor.h>
|
|
13
|
-
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
|
|
14
|
-
|
|
15
|
-
namespace facebook::react {
|
|
16
|
-
|
|
17
|
-
void TPStreamsPlayerViewSpec_registerComponentDescriptorsFromCodegen(
|
|
18
|
-
std::shared_ptr<const ComponentDescriptorProviderRegistry> registry) {
|
|
19
|
-
registry->add(concreteComponentDescriptorProvider<TPStreamsRNPlayerViewComponentDescriptor>());
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
} // namespace facebook::react
|
|
@@ -1,24 +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: GenerateComponentDescriptorH.js
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
#pragma once
|
|
12
|
-
|
|
13
|
-
#include <react/renderer/components/TPStreamsPlayerViewSpec/ShadowNodes.h>
|
|
14
|
-
#include <react/renderer/core/ConcreteComponentDescriptor.h>
|
|
15
|
-
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
|
|
16
|
-
|
|
17
|
-
namespace facebook::react {
|
|
18
|
-
|
|
19
|
-
using TPStreamsRNPlayerViewComponentDescriptor = ConcreteComponentDescriptor<TPStreamsRNPlayerViewShadowNode>;
|
|
20
|
-
|
|
21
|
-
void TPStreamsPlayerViewSpec_registerComponentDescriptorsFromCodegen(
|
|
22
|
-
std::shared_ptr<const ComponentDescriptorProviderRegistry> registry);
|
|
23
|
-
|
|
24
|
-
} // namespace facebook::react
|
|
@@ -1,107 +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: GenerateEventEmitterCpp.js
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
#include <react/renderer/components/TPStreamsPlayerViewSpec/EventEmitters.h>
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
namespace facebook::react {
|
|
15
|
-
|
|
16
|
-
void TPStreamsRNPlayerViewEventEmitter::onCurrentPosition(OnCurrentPosition $event) const {
|
|
17
|
-
dispatchEvent("currentPosition", [$event=std::move($event)](jsi::Runtime &runtime) {
|
|
18
|
-
auto $payload = jsi::Object(runtime);
|
|
19
|
-
$payload.setProperty(runtime, "position", $event.position);
|
|
20
|
-
return $payload;
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
void TPStreamsRNPlayerViewEventEmitter::onDuration(OnDuration $event) const {
|
|
26
|
-
dispatchEvent("duration", [$event=std::move($event)](jsi::Runtime &runtime) {
|
|
27
|
-
auto $payload = jsi::Object(runtime);
|
|
28
|
-
$payload.setProperty(runtime, "duration", $event.duration);
|
|
29
|
-
return $payload;
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
void TPStreamsRNPlayerViewEventEmitter::onIsPlaying(OnIsPlaying $event) const {
|
|
35
|
-
dispatchEvent("isPlaying", [$event=std::move($event)](jsi::Runtime &runtime) {
|
|
36
|
-
auto $payload = jsi::Object(runtime);
|
|
37
|
-
$payload.setProperty(runtime, "isPlaying", $event.isPlaying);
|
|
38
|
-
return $payload;
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
void TPStreamsRNPlayerViewEventEmitter::onPlaybackSpeed(OnPlaybackSpeed $event) const {
|
|
44
|
-
dispatchEvent("playbackSpeed", [$event=std::move($event)](jsi::Runtime &runtime) {
|
|
45
|
-
auto $payload = jsi::Object(runtime);
|
|
46
|
-
$payload.setProperty(runtime, "speed", $event.speed);
|
|
47
|
-
return $payload;
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
void TPStreamsRNPlayerViewEventEmitter::onPlayerStateChanged(OnPlayerStateChanged $event) const {
|
|
53
|
-
dispatchEvent("playerStateChanged", [$event=std::move($event)](jsi::Runtime &runtime) {
|
|
54
|
-
auto $payload = jsi::Object(runtime);
|
|
55
|
-
$payload.setProperty(runtime, "playbackState", $event.playbackState);
|
|
56
|
-
return $payload;
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
void TPStreamsRNPlayerViewEventEmitter::onIsPlayingChanged(OnIsPlayingChanged $event) const {
|
|
62
|
-
dispatchEvent("isPlayingChanged", [$event=std::move($event)](jsi::Runtime &runtime) {
|
|
63
|
-
auto $payload = jsi::Object(runtime);
|
|
64
|
-
$payload.setProperty(runtime, "isPlaying", $event.isPlaying);
|
|
65
|
-
return $payload;
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
void TPStreamsRNPlayerViewEventEmitter::onPlaybackSpeedChanged(OnPlaybackSpeedChanged $event) const {
|
|
71
|
-
dispatchEvent("playbackSpeedChanged", [$event=std::move($event)](jsi::Runtime &runtime) {
|
|
72
|
-
auto $payload = jsi::Object(runtime);
|
|
73
|
-
$payload.setProperty(runtime, "speed", $event.speed);
|
|
74
|
-
return $payload;
|
|
75
|
-
});
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
void TPStreamsRNPlayerViewEventEmitter::onIsLoadingChanged(OnIsLoadingChanged $event) const {
|
|
80
|
-
dispatchEvent("isLoadingChanged", [$event=std::move($event)](jsi::Runtime &runtime) {
|
|
81
|
-
auto $payload = jsi::Object(runtime);
|
|
82
|
-
$payload.setProperty(runtime, "isLoading", $event.isLoading);
|
|
83
|
-
return $payload;
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
void TPStreamsRNPlayerViewEventEmitter::onError(OnError $event) const {
|
|
89
|
-
dispatchEvent("error", [$event=std::move($event)](jsi::Runtime &runtime) {
|
|
90
|
-
auto $payload = jsi::Object(runtime);
|
|
91
|
-
$payload.setProperty(runtime, "message", $event.message);
|
|
92
|
-
$payload.setProperty(runtime, "code", $event.code);
|
|
93
|
-
$payload.setProperty(runtime, "details", $event.details);
|
|
94
|
-
return $payload;
|
|
95
|
-
});
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
void TPStreamsRNPlayerViewEventEmitter::onAccessTokenExpired(OnAccessTokenExpired $event) const {
|
|
100
|
-
dispatchEvent("accessTokenExpired", [$event=std::move($event)](jsi::Runtime &runtime) {
|
|
101
|
-
auto $payload = jsi::Object(runtime);
|
|
102
|
-
$payload.setProperty(runtime, "videoId", $event.videoId);
|
|
103
|
-
return $payload;
|
|
104
|
-
});
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
} // namespace facebook::react
|
|
@@ -1,81 +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: GenerateEventEmitterH.js
|
|
9
|
-
*/
|
|
10
|
-
#pragma once
|
|
11
|
-
|
|
12
|
-
#include <react/renderer/components/view/ViewEventEmitter.h>
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
namespace facebook::react {
|
|
16
|
-
class TPStreamsRNPlayerViewEventEmitter : public ViewEventEmitter {
|
|
17
|
-
public:
|
|
18
|
-
using ViewEventEmitter::ViewEventEmitter;
|
|
19
|
-
|
|
20
|
-
struct OnCurrentPosition {
|
|
21
|
-
double position;
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
struct OnDuration {
|
|
25
|
-
double duration;
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
struct OnIsPlaying {
|
|
29
|
-
bool isPlaying;
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
struct OnPlaybackSpeed {
|
|
33
|
-
Float speed;
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
struct OnPlayerStateChanged {
|
|
37
|
-
int playbackState;
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
struct OnIsPlayingChanged {
|
|
41
|
-
bool isPlaying;
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
struct OnPlaybackSpeedChanged {
|
|
45
|
-
double speed;
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
struct OnIsLoadingChanged {
|
|
49
|
-
bool isLoading;
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
struct OnError {
|
|
53
|
-
std::string message;
|
|
54
|
-
int code;
|
|
55
|
-
std::string details;
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
struct OnAccessTokenExpired {
|
|
59
|
-
std::string videoId;
|
|
60
|
-
};
|
|
61
|
-
void onCurrentPosition(OnCurrentPosition value) const;
|
|
62
|
-
|
|
63
|
-
void onDuration(OnDuration value) const;
|
|
64
|
-
|
|
65
|
-
void onIsPlaying(OnIsPlaying value) const;
|
|
66
|
-
|
|
67
|
-
void onPlaybackSpeed(OnPlaybackSpeed value) const;
|
|
68
|
-
|
|
69
|
-
void onPlayerStateChanged(OnPlayerStateChanged value) const;
|
|
70
|
-
|
|
71
|
-
void onIsPlayingChanged(OnIsPlayingChanged value) const;
|
|
72
|
-
|
|
73
|
-
void onPlaybackSpeedChanged(OnPlaybackSpeedChanged value) const;
|
|
74
|
-
|
|
75
|
-
void onIsLoadingChanged(OnIsLoadingChanged value) const;
|
|
76
|
-
|
|
77
|
-
void onError(OnError value) const;
|
|
78
|
-
|
|
79
|
-
void onAccessTokenExpired(OnAccessTokenExpired value) const;
|
|
80
|
-
};
|
|
81
|
-
} // namespace facebook::react
|
|
@@ -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: GeneratePropsCpp.js
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
#include <react/renderer/components/TPStreamsPlayerViewSpec/Props.h>
|
|
12
|
-
#include <react/renderer/core/PropsParserContext.h>
|
|
13
|
-
#include <react/renderer/core/propsConversions.h>
|
|
14
|
-
|
|
15
|
-
namespace facebook::react {
|
|
16
|
-
|
|
17
|
-
TPStreamsRNPlayerViewProps::TPStreamsRNPlayerViewProps(
|
|
18
|
-
const PropsParserContext &context,
|
|
19
|
-
const TPStreamsRNPlayerViewProps &sourceProps,
|
|
20
|
-
const RawProps &rawProps): ViewProps(context, sourceProps, rawProps),
|
|
21
|
-
|
|
22
|
-
videoId(convertRawProp(context, rawProps, "videoId", sourceProps.videoId, {})),
|
|
23
|
-
accessToken(convertRawProp(context, rawProps, "accessToken", sourceProps.accessToken, {})),
|
|
24
|
-
shouldAutoPlay(convertRawProp(context, rawProps, "shouldAutoPlay", sourceProps.shouldAutoPlay, {false})),
|
|
25
|
-
startAt(convertRawProp(context, rawProps, "startAt", sourceProps.startAt, {0.0})),
|
|
26
|
-
enableDownload(convertRawProp(context, rawProps, "enableDownload", sourceProps.enableDownload, {false})),
|
|
27
|
-
showDefaultCaptions(convertRawProp(context, rawProps, "showDefaultCaptions", sourceProps.showDefaultCaptions, {false})),
|
|
28
|
-
downloadMetadata(convertRawProp(context, rawProps, "downloadMetadata", sourceProps.downloadMetadata, {})),
|
|
29
|
-
offlineLicenseExpireTime(convertRawProp(context, rawProps, "offlineLicenseExpireTime", sourceProps.offlineLicenseExpireTime, {0.0}))
|
|
30
|
-
{}
|
|
31
|
-
|
|
32
|
-
} // namespace facebook::react
|
|
@@ -1,34 +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: GeneratePropsH.js
|
|
9
|
-
*/
|
|
10
|
-
#pragma once
|
|
11
|
-
|
|
12
|
-
#include <react/renderer/components/view/ViewProps.h>
|
|
13
|
-
#include <react/renderer/core/PropsParserContext.h>
|
|
14
|
-
|
|
15
|
-
namespace facebook::react {
|
|
16
|
-
|
|
17
|
-
class TPStreamsRNPlayerViewProps final : public ViewProps {
|
|
18
|
-
public:
|
|
19
|
-
TPStreamsRNPlayerViewProps() = default;
|
|
20
|
-
TPStreamsRNPlayerViewProps(const PropsParserContext& context, const TPStreamsRNPlayerViewProps &sourceProps, const RawProps &rawProps);
|
|
21
|
-
|
|
22
|
-
#pragma mark - Props
|
|
23
|
-
|
|
24
|
-
std::string videoId{};
|
|
25
|
-
std::string accessToken{};
|
|
26
|
-
bool shouldAutoPlay{false};
|
|
27
|
-
double startAt{0.0};
|
|
28
|
-
bool enableDownload{false};
|
|
29
|
-
bool showDefaultCaptions{false};
|
|
30
|
-
std::string downloadMetadata{};
|
|
31
|
-
double offlineLicenseExpireTime{0.0};
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
} // namespace facebook::react
|
|
@@ -1,17 +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: GenerateShadowNodeCpp.js
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
#include <react/renderer/components/TPStreamsPlayerViewSpec/ShadowNodes.h>
|
|
12
|
-
|
|
13
|
-
namespace facebook::react {
|
|
14
|
-
|
|
15
|
-
extern const char TPStreamsRNPlayerViewComponentName[] = "TPStreamsRNPlayerView";
|
|
16
|
-
|
|
17
|
-
} // namespace facebook::react
|
|
@@ -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: GenerateShadowNodeH.js
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
#pragma once
|
|
12
|
-
|
|
13
|
-
#include <react/renderer/components/TPStreamsPlayerViewSpec/EventEmitters.h>
|
|
14
|
-
#include <react/renderer/components/TPStreamsPlayerViewSpec/Props.h>
|
|
15
|
-
#include <react/renderer/components/TPStreamsPlayerViewSpec/States.h>
|
|
16
|
-
#include <react/renderer/components/view/ConcreteViewShadowNode.h>
|
|
17
|
-
#include <jsi/jsi.h>
|
|
18
|
-
|
|
19
|
-
namespace facebook::react {
|
|
20
|
-
|
|
21
|
-
JSI_EXPORT extern const char TPStreamsRNPlayerViewComponentName[];
|
|
22
|
-
|
|
23
|
-
/*
|
|
24
|
-
* `ShadowNode` for <TPStreamsRNPlayerView> component.
|
|
25
|
-
*/
|
|
26
|
-
using TPStreamsRNPlayerViewShadowNode = ConcreteViewShadowNode<
|
|
27
|
-
TPStreamsRNPlayerViewComponentName,
|
|
28
|
-
TPStreamsRNPlayerViewProps,
|
|
29
|
-
TPStreamsRNPlayerViewEventEmitter,
|
|
30
|
-
TPStreamsRNPlayerViewState>;
|
|
31
|
-
|
|
32
|
-
} // namespace facebook::react
|
|
@@ -1,16 +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: GenerateStateCpp.js
|
|
9
|
-
*/
|
|
10
|
-
#include <react/renderer/components/TPStreamsPlayerViewSpec/States.h>
|
|
11
|
-
|
|
12
|
-
namespace facebook::react {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
} // namespace facebook::react
|
|
@@ -1,29 +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: GenerateStateH.js
|
|
8
|
-
*/
|
|
9
|
-
#pragma once
|
|
10
|
-
|
|
11
|
-
#ifdef ANDROID
|
|
12
|
-
#include <folly/dynamic.h>
|
|
13
|
-
#endif
|
|
14
|
-
|
|
15
|
-
namespace facebook::react {
|
|
16
|
-
|
|
17
|
-
class TPStreamsRNPlayerViewState {
|
|
18
|
-
public:
|
|
19
|
-
TPStreamsRNPlayerViewState() = default;
|
|
20
|
-
|
|
21
|
-
#ifdef ANDROID
|
|
22
|
-
TPStreamsRNPlayerViewState(TPStreamsRNPlayerViewState const &previousState, folly::dynamic data){};
|
|
23
|
-
folly::dynamic getDynamic() const {
|
|
24
|
-
return {};
|
|
25
|
-
};
|
|
26
|
-
#endif
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
} // namespace facebook::react
|
|
@@ -1,17 +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 "TPStreamsPlayerViewSpecJSI.h"
|
|
11
|
-
|
|
12
|
-
namespace facebook::react {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
} // namespace facebook::react
|
|
@@ -1,19 +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
|
-
|
|
19
|
-
} // namespace facebook::react
|