react-native-tpstreams 1.1.3 → 1.1.4-dev.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/app/build/generated/source/codegen/java/com/facebook/react/viewmanagers/TPStreamsRNPlayerViewManagerDelegate.java +87 -0
- package/android/app/build/generated/source/codegen/java/com/facebook/react/viewmanagers/TPStreamsRNPlayerViewManagerInterface.java +34 -0
- package/android/app/build/generated/source/codegen/jni/CMakeLists.txt +36 -0
- package/android/app/build/generated/source/codegen/jni/TPStreamsPlayerViewSpec-generated.cpp +22 -0
- package/android/app/build/generated/source/codegen/jni/TPStreamsPlayerViewSpec.h +24 -0
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/TPStreamsPlayerViewSpec/ComponentDescriptors.cpp +22 -0
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/TPStreamsPlayerViewSpec/ComponentDescriptors.h +24 -0
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/TPStreamsPlayerViewSpec/EventEmitters.cpp +107 -0
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/TPStreamsPlayerViewSpec/EventEmitters.h +81 -0
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/TPStreamsPlayerViewSpec/Props.cpp +32 -0
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/TPStreamsPlayerViewSpec/Props.h +34 -0
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/TPStreamsPlayerViewSpec/ShadowNodes.cpp +17 -0
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/TPStreamsPlayerViewSpec/ShadowNodes.h +32 -0
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/TPStreamsPlayerViewSpec/States.cpp +16 -0
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/TPStreamsPlayerViewSpec/States.h +29 -0
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/TPStreamsPlayerViewSpec/TPStreamsPlayerViewSpecJSI-generated.cpp +17 -0
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/TPStreamsPlayerViewSpec/TPStreamsPlayerViewSpecJSI.h +19 -0
- package/android/gradle.properties +1 -1
- package/lib/module/TPStreamsLiveChat.js +133 -0
- package/lib/module/TPStreamsLiveChat.js.map +1 -0
- package/lib/module/index.js +1 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/types/TPStreamsLiveChatTypes.js +29 -0
- package/lib/module/types/TPStreamsLiveChatTypes.js.map +1 -0
- package/lib/module/utils/constants.js +28 -0
- package/lib/module/utils/constants.js.map +1 -0
- package/lib/module/utils/liveChatHtmlGenerator.js +131 -0
- package/lib/module/utils/liveChatHtmlGenerator.js.map +1 -0
- package/lib/typescript/src/TPStreamsLiveChat.d.ts +5 -0
- package/lib/typescript/src/TPStreamsLiveChat.d.ts.map +1 -0
- package/lib/typescript/src/TPStreamsPlayerViewNativeComponent.d.ts +1 -0
- package/lib/typescript/src/TPStreamsPlayerViewNativeComponent.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +2 -0
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/types/TPStreamsLiveChatTypes.d.ts +77 -0
- package/lib/typescript/src/types/TPStreamsLiveChatTypes.d.ts.map +1 -0
- package/lib/typescript/src/utils/constants.d.ts +20 -0
- package/lib/typescript/src/utils/constants.d.ts.map +1 -0
- package/lib/typescript/src/utils/liveChatHtmlGenerator.d.ts +6 -0
- package/lib/typescript/src/utils/liveChatHtmlGenerator.d.ts.map +1 -0
- package/package.json +4 -1
- package/src/TPStreamsLiveChat.tsx +189 -0
- package/src/index.tsx +9 -0
- package/src/types/TPStreamsLiveChatTypes.ts +99 -0
- package/src/utils/constants.ts +28 -0
- package/src/utils/liveChatHtmlGenerator.ts +142 -0
|
@@ -0,0 +1,87 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
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
|
+
)
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
|
|
2
|
+
/**
|
|
3
|
+
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
4
|
+
*
|
|
5
|
+
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
6
|
+
* once the code is regenerated.
|
|
7
|
+
*
|
|
8
|
+
* @generated by codegen project: 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
|
|
@@ -0,0 +1,24 @@
|
|
|
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
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
|
|
2
|
+
/**
|
|
3
|
+
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
4
|
+
*
|
|
5
|
+
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
6
|
+
* once the code is regenerated.
|
|
7
|
+
*
|
|
8
|
+
* @generated by codegen project: 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
|
|
@@ -0,0 +1,24 @@
|
|
|
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
|
|
@@ -0,0 +1,107 @@
|
|
|
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
|
|
@@ -0,0 +1,81 @@
|
|
|
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
|
|
@@ -0,0 +1,32 @@
|
|
|
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
|
|
@@ -0,0 +1,34 @@
|
|
|
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
|
|
@@ -0,0 +1,17 @@
|
|
|
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
|
|
@@ -0,0 +1,32 @@
|
|
|
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
|
|
@@ -0,0 +1,16 @@
|
|
|
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
|
|
@@ -0,0 +1,29 @@
|
|
|
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
|
|
@@ -0,0 +1,17 @@
|
|
|
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
|
|
@@ -0,0 +1,19 @@
|
|
|
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
|