spactureai-mobile-player 1.0.30
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 +20 -0
- package/README.md +474 -0
- package/UnifiedPlayer.podspec +51 -0
- package/android/CMakeLists.txt +29 -0
- package/android/build.gradle +249 -0
- package/android/fix-prefab.gradle +51 -0
- package/android/gradle.properties +15 -0
- package/android/src/main/AndroidManifest.xml +10 -0
- package/android/src/main/AndroidManifestNew.xml +9 -0
- package/android/src/main/cpp/cpp-adapter.cpp +9 -0
- package/android/src/main/java/com/unifiedplayer/core/AudioFocusManager.kt +233 -0
- package/android/src/main/java/com/unifiedplayer/core/VideoError.kt +105 -0
- package/android/src/main/java/com/unifiedplayer/core/VideoManager.kt +292 -0
- package/android/src/main/java/com/unifiedplayer/core/extensions/ResizeMode+AspectRatioFrameLayout.kt +20 -0
- package/android/src/main/java/com/unifiedplayer/core/extensions/SubtitleType+toString.kt +14 -0
- package/android/src/main/java/com/unifiedplayer/core/extensions/VideoPlaybackService+ServiceManagment.kt +59 -0
- package/android/src/main/java/com/unifiedplayer/core/fragments/FullscreenVideoFragment.kt +346 -0
- package/android/src/main/java/com/unifiedplayer/core/fragments/PictureInPictureHelperFragment.kt +85 -0
- package/android/src/main/java/com/unifiedplayer/core/player/DRMManagerSpec.kt +23 -0
- package/android/src/main/java/com/unifiedplayer/core/player/DataSourceFactoryUtils.kt +93 -0
- package/android/src/main/java/com/unifiedplayer/core/player/MediaItemUtils.kt +141 -0
- package/android/src/main/java/com/unifiedplayer/core/player/MediaSourceUtils.kt +134 -0
- package/android/src/main/java/com/unifiedplayer/core/player/OnAudioFocusChangedListener.kt +25 -0
- package/android/src/main/java/com/unifiedplayer/core/plugins/PluginsRegistry.kt +223 -0
- package/android/src/main/java/com/unifiedplayer/core/plugins/ReactNativeVideoPlugin.kt +173 -0
- package/android/src/main/java/com/unifiedplayer/core/recivers/AudioBecomingNoisyReceiver.kt +38 -0
- package/android/src/main/java/com/unifiedplayer/core/services/playback/CustomMediaNotificationProvider.kt +151 -0
- package/android/src/main/java/com/unifiedplayer/core/services/playback/VideoPlaybackCallback.kt +96 -0
- package/android/src/main/java/com/unifiedplayer/core/services/playback/VideoPlaybackService.kt +219 -0
- package/android/src/main/java/com/unifiedplayer/core/services/playback/VideoPlaybackServiceConnection.kt +59 -0
- package/android/src/main/java/com/unifiedplayer/core/utils/PictureInPictureUtils.kt +153 -0
- package/android/src/main/java/com/unifiedplayer/core/utils/SmallVideoPlayerOptimizer.kt +157 -0
- package/android/src/main/java/com/unifiedplayer/core/utils/SourceLoader.kt +48 -0
- package/android/src/main/java/com/unifiedplayer/core/utils/TextTrackUtils.kt +175 -0
- package/android/src/main/java/com/unifiedplayer/core/utils/Threading.kt +75 -0
- package/android/src/main/java/com/unifiedplayer/core/utils/VideoFileHelper.kt +51 -0
- package/android/src/main/java/com/unifiedplayer/core/utils/VideoInformationUtils.kt +67 -0
- package/android/src/main/java/com/unifiedplayer/core/utils/VideoOrientationUtils.kt +30 -0
- package/android/src/main/java/com/unifiedplayer/hybrids/videoplayer/HybridVideoPlayer.kt +732 -0
- package/android/src/main/java/com/unifiedplayer/hybrids/videoplayer/HybridVideoPlayerFactory.kt +16 -0
- package/android/src/main/java/com/unifiedplayer/hybrids/videoplayereventemitter/HybridVideoPlayerEventEmitter.kt +180 -0
- package/android/src/main/java/com/unifiedplayer/hybrids/videoplayersource/HybridVideoPlayerSource.kt +67 -0
- package/android/src/main/java/com/unifiedplayer/hybrids/videoplayersource/HybridVideoPlayerSourceFactory.kt +58 -0
- package/android/src/main/java/com/unifiedplayer/hybrids/videoviewviewmanager/HybridVideoViewViewManager.kt +187 -0
- package/android/src/main/java/com/unifiedplayer/hybrids/videoviewviewmanager/HybridVideoViewViewManagerFactory.kt +13 -0
- package/android/src/main/java/com/unifiedplayer/react/VideoPackage.kt +25 -0
- package/android/src/main/java/com/unifiedplayer/react/VideoViewViewManager.kt +78 -0
- package/android/src/main/java/com/unifiedplayer/view/VideoView.kt +565 -0
- package/android/src/main/res/layout/custom_player_control_view.xml +82 -0
- package/android/src/main/res/layout/player_view_surface.xml +13 -0
- package/android/src/main/res/layout/player_view_texture.xml +13 -0
- package/android/src/paper/java/com/facebook/react/viewmanagers/RNCVideoViewManagerDelegate.java +32 -0
- package/android/src/paper/java/com/facebook/react/viewmanagers/RNCVideoViewManagerInterface.java +16 -0
- package/android/src/stubs/dash/androidx/media3/exoplayer/dash/DashMediaSource.kt +35 -0
- package/android/src/stubs/dash/androidx/media3/exoplayer/dash/DashUtil.kt +11 -0
- package/android/src/stubs/dash/androidx/media3/exoplayer/dash/manifest/AdaptationSet.kt +9 -0
- package/android/src/stubs/dash/androidx/media3/exoplayer/dash/manifest/DashManifest.kt +10 -0
- package/android/src/stubs/dash/androidx/media3/exoplayer/dash/manifest/Period.kt +7 -0
- package/android/src/stubs/dash/androidx/media3/exoplayer/dash/manifest/Representation.kt +8 -0
- package/android/src/stubs/hls/androidx/media3/exoplayer/hls/HlsMediaSource.kt +33 -0
- package/ios/RNCVideoViewManager.mm +39 -0
- package/ios/Video-Bridging-Header.h +2 -0
- package/ios/core/HLSAuthProxy.swift +428 -0
- package/ios/core/VideoError.swift +164 -0
- package/ios/core/VideoManager.swift +219 -0
- package/ios/hybrids/VideoPlayer/HybridVideoPlayer.swift +697 -0
- package/ios/hybrids/VideoPlayer/HybridVideoPlayerFactory.swift +15 -0
- package/ios/hybrids/VideoPlayer/VLCPlaybackDelegates.swift +58 -0
- package/ios/hybrids/VideoPlayerEmitter/HybridVideoPlayerEventEmitter.swift +203 -0
- package/ios/hybrids/VideoPlayerSource/HybridVideoPlayerSource.swift +55 -0
- package/ios/hybrids/VideoPlayerSource/HybridVideoPlayerSourceFactory.swift +29 -0
- package/ios/hybrids/VideoViewViewManager/HybridVideoViewViewManager.swift +266 -0
- package/ios/hybrids/VideoViewViewManager/HybridVideoViewViewManagerFactory.swift +14 -0
- package/ios/view/VideoComponentView.swift +196 -0
- package/ios/view/VideoComponentViewObserver.swift +48 -0
- package/lib/module/core/VideoPlayer.js +287 -0
- package/lib/module/core/VideoPlayer.js.map +1 -0
- package/lib/module/core/VideoPlayerEvents.js +84 -0
- package/lib/module/core/VideoPlayerEvents.js.map +1 -0
- package/lib/module/core/hooks/useEvent.js +19 -0
- package/lib/module/core/hooks/useEvent.js.map +1 -0
- package/lib/module/core/hooks/useManagedInstance.js +75 -0
- package/lib/module/core/hooks/useManagedInstance.js.map +1 -0
- package/lib/module/core/hooks/useVideoPlayer.js +57 -0
- package/lib/module/core/hooks/useVideoPlayer.js.map +1 -0
- package/lib/module/core/types/BufferConfig.js +2 -0
- package/lib/module/core/types/BufferConfig.js.map +1 -0
- package/lib/module/core/types/DrmParams.js +2 -0
- package/lib/module/core/types/DrmParams.js.map +1 -0
- package/lib/module/core/types/Events.js +10 -0
- package/lib/module/core/types/Events.js.map +1 -0
- package/lib/module/core/types/IgnoreSilentSwitchMode.js +2 -0
- package/lib/module/core/types/IgnoreSilentSwitchMode.js.map +1 -0
- package/lib/module/core/types/MixAudioMode.js +2 -0
- package/lib/module/core/types/MixAudioMode.js.map +1 -0
- package/lib/module/core/types/ResizeMode.js +2 -0
- package/lib/module/core/types/ResizeMode.js.map +1 -0
- package/lib/module/core/types/TextTrack.js +2 -0
- package/lib/module/core/types/TextTrack.js.map +1 -0
- package/lib/module/core/types/Utils.js +2 -0
- package/lib/module/core/types/Utils.js.map +1 -0
- package/lib/module/core/types/VideoConfig.js +4 -0
- package/lib/module/core/types/VideoConfig.js.map +1 -0
- package/lib/module/core/types/VideoError.js +100 -0
- package/lib/module/core/types/VideoError.js.map +1 -0
- package/lib/module/core/types/VideoInformation.js +4 -0
- package/lib/module/core/types/VideoInformation.js.map +1 -0
- package/lib/module/core/types/VideoOrientation.js +2 -0
- package/lib/module/core/types/VideoOrientation.js.map +1 -0
- package/lib/module/core/types/VideoPlayerBase.js +4 -0
- package/lib/module/core/types/VideoPlayerBase.js.map +1 -0
- package/lib/module/core/types/VideoPlayerSourceBase.js +4 -0
- package/lib/module/core/types/VideoPlayerSourceBase.js.map +1 -0
- package/lib/module/core/types/VideoPlayerStatus.js +2 -0
- package/lib/module/core/types/VideoPlayerStatus.js.map +1 -0
- package/lib/module/core/utils/playerFactory.js +25 -0
- package/lib/module/core/utils/playerFactory.js.map +1 -0
- package/lib/module/core/utils/sourceFactory.js +138 -0
- package/lib/module/core/utils/sourceFactory.js.map +1 -0
- package/lib/module/core/video-view/NativeVideoView.tsx +18 -0
- package/lib/module/core/video-view/VideoView.js +261 -0
- package/lib/module/core/video-view/VideoView.js.map +1 -0
- package/lib/module/expo-plugins/@types.js +2 -0
- package/lib/module/expo-plugins/@types.js.map +1 -0
- package/lib/module/expo-plugins/getPackageInfo.js +23 -0
- package/lib/module/expo-plugins/getPackageInfo.js.map +1 -0
- package/lib/module/expo-plugins/withAndroidExtensions.js +35 -0
- package/lib/module/expo-plugins/withAndroidExtensions.js.map +1 -0
- package/lib/module/expo-plugins/withAndroidNotificationControls.js +29 -0
- package/lib/module/expo-plugins/withAndroidNotificationControls.js.map +1 -0
- package/lib/module/expo-plugins/withAndroidPictureInPicture.js +18 -0
- package/lib/module/expo-plugins/withAndroidPictureInPicture.js.map +1 -0
- package/lib/module/expo-plugins/withBackgroundAudio.js +22 -0
- package/lib/module/expo-plugins/withBackgroundAudio.js.map +1 -0
- package/lib/module/expo-plugins/withReactNativeVideo.js +27 -0
- package/lib/module/expo-plugins/withReactNativeVideo.js.map +1 -0
- package/lib/module/expo-plugins/writeToPodfile.js +53 -0
- package/lib/module/expo-plugins/writeToPodfile.js.map +1 -0
- package/lib/module/index.js +8 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/module/spec/fabric/VideoViewNativeComponent.ts +17 -0
- package/lib/module/spec/nitro/VideoPlayer.nitro.js +4 -0
- package/lib/module/spec/nitro/VideoPlayer.nitro.js.map +1 -0
- package/lib/module/spec/nitro/VideoPlayerEventEmitter.nitro.js +4 -0
- package/lib/module/spec/nitro/VideoPlayerEventEmitter.nitro.js.map +1 -0
- package/lib/module/spec/nitro/VideoPlayerSource.nitro.js +4 -0
- package/lib/module/spec/nitro/VideoPlayerSource.nitro.js.map +1 -0
- package/lib/module/spec/nitro/VideoViewViewManager.nitro.js +4 -0
- package/lib/module/spec/nitro/VideoViewViewManager.nitro.js.map +1 -0
- package/lib/typescript/drm-plugin/src/PluginManager.nitro.d.ts +10 -0
- package/lib/typescript/drm-plugin/src/PluginManager.nitro.d.ts.map +1 -0
- package/lib/typescript/drm-plugin/src/index.d.ts +4 -0
- package/lib/typescript/drm-plugin/src/index.d.ts.map +1 -0
- package/lib/typescript/package.json +1 -0
- package/lib/typescript/src/core/VideoPlayer.d.ts +88 -0
- package/lib/typescript/src/core/VideoPlayer.d.ts.map +1 -0
- package/lib/typescript/src/core/VideoPlayerEvents.d.ts +22 -0
- package/lib/typescript/src/core/VideoPlayerEvents.d.ts.map +1 -0
- package/lib/typescript/src/core/hooks/useEvent.d.ts +11 -0
- package/lib/typescript/src/core/hooks/useEvent.d.ts.map +1 -0
- package/lib/typescript/src/core/hooks/useManagedInstance.d.ts +19 -0
- package/lib/typescript/src/core/hooks/useManagedInstance.d.ts.map +1 -0
- package/lib/typescript/src/core/hooks/useVideoPlayer.d.ts +16 -0
- package/lib/typescript/src/core/hooks/useVideoPlayer.d.ts.map +1 -0
- package/lib/typescript/src/core/types/BufferConfig.d.ts +97 -0
- package/lib/typescript/src/core/types/BufferConfig.d.ts.map +1 -0
- package/lib/typescript/src/core/types/DrmParams.d.ts +64 -0
- package/lib/typescript/src/core/types/DrmParams.d.ts.map +1 -0
- package/lib/typescript/src/core/types/Events.d.ts +224 -0
- package/lib/typescript/src/core/types/Events.d.ts.map +1 -0
- package/lib/typescript/src/core/types/IgnoreSilentSwitchMode.d.ts +2 -0
- package/lib/typescript/src/core/types/IgnoreSilentSwitchMode.d.ts.map +1 -0
- package/lib/typescript/src/core/types/MixAudioMode.d.ts +2 -0
- package/lib/typescript/src/core/types/MixAudioMode.d.ts.map +1 -0
- package/lib/typescript/src/core/types/ResizeMode.d.ts +10 -0
- package/lib/typescript/src/core/types/ResizeMode.d.ts.map +1 -0
- package/lib/typescript/src/core/types/TextTrack.d.ts +20 -0
- package/lib/typescript/src/core/types/TextTrack.d.ts.map +1 -0
- package/lib/typescript/src/core/types/Utils.d.ts +2 -0
- package/lib/typescript/src/core/types/Utils.d.ts.map +1 -0
- package/lib/typescript/src/core/types/VideoConfig.d.ts +138 -0
- package/lib/typescript/src/core/types/VideoConfig.d.ts.map +1 -0
- package/lib/typescript/src/core/types/VideoError.d.ts +31 -0
- package/lib/typescript/src/core/types/VideoError.d.ts.map +1 -0
- package/lib/typescript/src/core/types/VideoInformation.d.ts +38 -0
- package/lib/typescript/src/core/types/VideoInformation.d.ts.map +1 -0
- package/lib/typescript/src/core/types/VideoOrientation.d.ts +2 -0
- package/lib/typescript/src/core/types/VideoOrientation.d.ts.map +1 -0
- package/lib/typescript/src/core/types/VideoPlayerBase.d.ts +155 -0
- package/lib/typescript/src/core/types/VideoPlayerBase.d.ts.map +1 -0
- package/lib/typescript/src/core/types/VideoPlayerSourceBase.d.ts +17 -0
- package/lib/typescript/src/core/types/VideoPlayerSourceBase.d.ts.map +1 -0
- package/lib/typescript/src/core/types/VideoPlayerStatus.d.ts +9 -0
- package/lib/typescript/src/core/types/VideoPlayerStatus.d.ts.map +1 -0
- package/lib/typescript/src/core/utils/playerFactory.d.ts +12 -0
- package/lib/typescript/src/core/utils/playerFactory.d.ts.map +1 -0
- package/lib/typescript/src/core/utils/sourceFactory.d.ts +29 -0
- package/lib/typescript/src/core/utils/sourceFactory.d.ts.map +1 -0
- package/lib/typescript/src/core/video-view/NativeVideoView.d.ts +2 -0
- package/lib/typescript/src/core/video-view/NativeVideoView.d.ts.map +1 -0
- package/lib/typescript/src/core/video-view/VideoView.d.ts +104 -0
- package/lib/typescript/src/core/video-view/VideoView.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +13 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/lib/typescript/src/spec/fabric/VideoViewNativeComponent.d.ts +13 -0
- package/lib/typescript/src/spec/fabric/VideoViewNativeComponent.d.ts.map +1 -0
- package/lib/typescript/src/spec/nitro/VideoPlayer.nitro.d.ts +55 -0
- package/lib/typescript/src/spec/nitro/VideoPlayer.nitro.d.ts.map +1 -0
- package/lib/typescript/src/spec/nitro/VideoPlayerEventEmitter.nitro.d.ts +150 -0
- package/lib/typescript/src/spec/nitro/VideoPlayerEventEmitter.nitro.d.ts.map +1 -0
- package/lib/typescript/src/spec/nitro/VideoPlayerSource.nitro.d.ts +21 -0
- package/lib/typescript/src/spec/nitro/VideoPlayerSource.nitro.d.ts.map +1 -0
- package/lib/typescript/src/spec/nitro/VideoViewViewManager.nitro.d.ts +75 -0
- package/lib/typescript/src/spec/nitro/VideoViewViewManager.nitro.d.ts.map +1 -0
- package/nitro.json +47 -0
- package/nitrogen/generated/android/UnifiedPlayer+autolinking.cmake +95 -0
- package/nitrogen/generated/android/UnifiedPlayer+autolinking.gradle +27 -0
- package/nitrogen/generated/android/UnifiedPlayerOnLoad.cpp +122 -0
- package/nitrogen/generated/android/UnifiedPlayerOnLoad.hpp +34 -0
- package/nitrogen/generated/android/c++/JBandwidthData.hpp +65 -0
- package/nitrogen/generated/android/c++/JBufferConfig.hpp +101 -0
- package/nitrogen/generated/android/c++/JCustomVideoMetadata.hpp +74 -0
- package/nitrogen/generated/android/c++/JFunc_std__shared_ptr_Promise_std__shared_ptr_Promise_std__string_____OnGetLicensePayload.hpp +126 -0
- package/nitrogen/generated/android/c++/JFunc_void.hpp +75 -0
- package/nitrogen/generated/android/c++/JFunc_void_BandwidthData.hpp +78 -0
- package/nitrogen/generated/android/c++/JFunc_void_TimedMetadata.hpp +81 -0
- package/nitrogen/generated/android/c++/JFunc_void_VideoPlayerStatus.hpp +77 -0
- package/nitrogen/generated/android/c++/JFunc_void_bool.hpp +75 -0
- package/nitrogen/generated/android/c++/JFunc_void_double.hpp +75 -0
- package/nitrogen/generated/android/c++/JFunc_void_onLoadData.hpp +79 -0
- package/nitrogen/generated/android/c++/JFunc_void_onLoadStartData.hpp +82 -0
- package/nitrogen/generated/android/c++/JFunc_void_onPlaybackStateChangeData.hpp +77 -0
- package/nitrogen/generated/android/c++/JFunc_void_onProgressData.hpp +77 -0
- package/nitrogen/generated/android/c++/JFunc_void_onVolumeChangeData.hpp +77 -0
- package/nitrogen/generated/android/c++/JFunc_void_std__optional_std__variant_nitro__NullType__TextTrack__.hpp +83 -0
- package/nitrogen/generated/android/c++/JFunc_void_std__vector_std__string_.hpp +95 -0
- package/nitrogen/generated/android/c++/JHybridVideoPlayerEventEmitterSpec.cpp +224 -0
- package/nitrogen/generated/android/c++/JHybridVideoPlayerEventEmitterSpec.hpp +82 -0
- package/nitrogen/generated/android/c++/JHybridVideoPlayerFactorySpec.cpp +60 -0
- package/nitrogen/generated/android/c++/JHybridVideoPlayerFactorySpec.hpp +63 -0
- package/nitrogen/generated/android/c++/JHybridVideoPlayerSourceFactorySpec.cpp +106 -0
- package/nitrogen/generated/android/c++/JHybridVideoPlayerSourceFactorySpec.hpp +64 -0
- package/nitrogen/generated/android/c++/JHybridVideoPlayerSourceSpec.cpp +124 -0
- package/nitrogen/generated/android/c++/JHybridVideoPlayerSourceSpec.hpp +64 -0
- package/nitrogen/generated/android/c++/JHybridVideoPlayerSpec.cpp +300 -0
- package/nitrogen/generated/android/c++/JHybridVideoPlayerSpec.hpp +98 -0
- package/nitrogen/generated/android/c++/JHybridVideoViewViewManagerFactorySpec.cpp +56 -0
- package/nitrogen/generated/android/c++/JHybridVideoViewViewManagerFactorySpec.hpp +63 -0
- package/nitrogen/generated/android/c++/JHybridVideoViewViewManagerSpec.cpp +185 -0
- package/nitrogen/generated/android/c++/JHybridVideoViewViewManagerSpec.hpp +87 -0
- package/nitrogen/generated/android/c++/JIgnoreSilentSwitchMode.hpp +61 -0
- package/nitrogen/generated/android/c++/JListenerSubscription.hpp +67 -0
- package/nitrogen/generated/android/c++/JLivePlaybackParams.hpp +73 -0
- package/nitrogen/generated/android/c++/JMixAudioMode.hpp +64 -0
- package/nitrogen/generated/android/c++/JNativeDrmParams.hpp +111 -0
- package/nitrogen/generated/android/c++/JNativeExternalSubtitle.hpp +71 -0
- package/nitrogen/generated/android/c++/JNativeVideoConfig.hpp +136 -0
- package/nitrogen/generated/android/c++/JOnGetLicensePayload.hpp +69 -0
- package/nitrogen/generated/android/c++/JResizeMode.hpp +64 -0
- package/nitrogen/generated/android/c++/JResolution.hpp +61 -0
- package/nitrogen/generated/android/c++/JSourceType.hpp +58 -0
- package/nitrogen/generated/android/c++/JSubtitleType.hpp +67 -0
- package/nitrogen/generated/android/c++/JSurfaceType.hpp +58 -0
- package/nitrogen/generated/android/c++/JTextTrack.hpp +70 -0
- package/nitrogen/generated/android/c++/JTimedMetadata.hpp +78 -0
- package/nitrogen/generated/android/c++/JTimedMetadataObject.hpp +61 -0
- package/nitrogen/generated/android/c++/JVariant_NullType_HybridVideoPlayerSourceSpec.cpp +26 -0
- package/nitrogen/generated/android/c++/JVariant_NullType_HybridVideoPlayerSourceSpec.hpp +72 -0
- package/nitrogen/generated/android/c++/JVariant_NullType_TextTrack.cpp +26 -0
- package/nitrogen/generated/android/c++/JVariant_NullType_TextTrack.hpp +73 -0
- package/nitrogen/generated/android/c++/JVideoInformation.hpp +86 -0
- package/nitrogen/generated/android/c++/JVideoOrientation.hpp +73 -0
- package/nitrogen/generated/android/c++/JVideoPlayerStatus.hpp +64 -0
- package/nitrogen/generated/android/c++/JonLoadData.hpp +74 -0
- package/nitrogen/generated/android/c++/JonLoadStartData.hpp +65 -0
- package/nitrogen/generated/android/c++/JonPlaybackStateChangeData.hpp +61 -0
- package/nitrogen/generated/android/c++/JonProgressData.hpp +65 -0
- package/nitrogen/generated/android/c++/JonVolumeChangeData.hpp +61 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/unifiedplayer/BandwidthData.kt +61 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/unifiedplayer/BufferConfig.kt +101 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/unifiedplayer/CustomVideoMetadata.kt +71 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/unifiedplayer/Func_std__shared_ptr_Promise_std__shared_ptr_Promise_std__string_____OnGetLicensePayload.kt +80 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/unifiedplayer/Func_void.kt +80 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/unifiedplayer/Func_void_BandwidthData.kt +80 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/unifiedplayer/Func_void_TimedMetadata.kt +80 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/unifiedplayer/Func_void_VideoPlayerStatus.kt +80 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/unifiedplayer/Func_void_bool.kt +80 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/unifiedplayer/Func_void_double.kt +80 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/unifiedplayer/Func_void_onLoadData.kt +80 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/unifiedplayer/Func_void_onLoadStartData.kt +80 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/unifiedplayer/Func_void_onPlaybackStateChangeData.kt +80 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/unifiedplayer/Func_void_onProgressData.kt +80 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/unifiedplayer/Func_void_onVolumeChangeData.kt +80 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/unifiedplayer/Func_void_std__optional_std__variant_nitro__NullType__TextTrack__.kt +80 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/unifiedplayer/Func_void_std__vector_std__string_.kt +80 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/unifiedplayer/HybridVideoPlayerEventEmitterSpec.kt +226 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/unifiedplayer/HybridVideoPlayerFactorySpec.kt +54 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/unifiedplayer/HybridVideoPlayerSourceFactorySpec.kt +58 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/unifiedplayer/HybridVideoPlayerSourceSpec.kt +61 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/unifiedplayer/HybridVideoPlayerSpec.kt +178 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/unifiedplayer/HybridVideoViewViewManagerFactorySpec.kt +54 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/unifiedplayer/HybridVideoViewViewManagerSpec.kt +168 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/unifiedplayer/IgnoreSilentSwitchMode.kt +24 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/unifiedplayer/ListenerSubscription.kt +55 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/unifiedplayer/LivePlaybackParams.kt +71 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/unifiedplayer/MixAudioMode.kt +25 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/unifiedplayer/NativeDrmParams.kt +85 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/unifiedplayer/NativeExternalSubtitle.kt +66 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/unifiedplayer/NativeVideoConfig.kt +81 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/unifiedplayer/OnGetLicensePayload.kt +66 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/unifiedplayer/ResizeMode.kt +25 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/unifiedplayer/Resolution.kt +56 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/unifiedplayer/SourceType.kt +23 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/unifiedplayer/SubtitleType.kt +26 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/unifiedplayer/SurfaceType.kt +23 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/unifiedplayer/TextTrack.kt +66 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/unifiedplayer/TimedMetadata.kt +51 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/unifiedplayer/TimedMetadataObject.kt +56 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/unifiedplayer/UnifiedPlayerOnLoad.kt +35 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/unifiedplayer/Variant_NullType_HybridVideoPlayerSourceSpec.kt +62 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/unifiedplayer/Variant_NullType_TextTrack.kt +62 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/unifiedplayer/VideoInformation.kt +86 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/unifiedplayer/VideoOrientation.kt +28 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/unifiedplayer/VideoPlayerStatus.kt +25 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/unifiedplayer/onLoadData.kt +71 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/unifiedplayer/onLoadStartData.kt +56 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/unifiedplayer/onPlaybackStateChangeData.kt +56 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/unifiedplayer/onProgressData.kt +61 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/unifiedplayer/onVolumeChangeData.kt +56 -0
- package/nitrogen/generated/ios/UnifiedPlayer+autolinking.rb +62 -0
- package/nitrogen/generated/ios/UnifiedPlayer-Swift-Cxx-Bridge.cpp +280 -0
- package/nitrogen/generated/ios/UnifiedPlayer-Swift-Cxx-Bridge.hpp +1106 -0
- package/nitrogen/generated/ios/UnifiedPlayer-Swift-Cxx-Umbrella.hpp +162 -0
- package/nitrogen/generated/ios/UnifiedPlayerAutolinking.mm +49 -0
- package/nitrogen/generated/ios/UnifiedPlayerAutolinking.swift +50 -0
- package/nitrogen/generated/ios/c++/HybridVideoPlayerEventEmitterSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridVideoPlayerEventEmitterSpecSwift.hpp +279 -0
- package/nitrogen/generated/ios/c++/HybridVideoPlayerFactorySpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridVideoPlayerFactorySpecSwift.hpp +87 -0
- package/nitrogen/generated/ios/c++/HybridVideoPlayerSourceFactorySpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridVideoPlayerSourceFactorySpecSwift.hpp +125 -0
- package/nitrogen/generated/ios/c++/HybridVideoPlayerSourceSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridVideoPlayerSourceSpecSwift.hpp +125 -0
- package/nitrogen/generated/ios/c++/HybridVideoPlayerSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridVideoPlayerSpecSwift.hpp +256 -0
- package/nitrogen/generated/ios/c++/HybridVideoViewViewManagerFactorySpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridVideoViewViewManagerFactorySpecSwift.hpp +84 -0
- package/nitrogen/generated/ios/c++/HybridVideoViewViewManagerSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridVideoViewViewManagerSpecSwift.hpp +217 -0
- package/nitrogen/generated/ios/swift/BandwidthData.swift +65 -0
- package/nitrogen/generated/ios/swift/BufferConfig.swift +201 -0
- package/nitrogen/generated/ios/swift/CustomVideoMetadata.swift +114 -0
- package/nitrogen/generated/ios/swift/Func_std__shared_ptr_Promise_std__shared_ptr_Promise_std__string_____OnGetLicensePayload.swift +61 -0
- package/nitrogen/generated/ios/swift/Func_void.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_BandwidthData.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_TimedMetadata.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_VideoInformation.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_VideoPlayerStatus.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_bool.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_double.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_onLoadData.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_onLoadStartData.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_onPlaybackStateChangeData.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_onProgressData.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_onVolumeChangeData.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_std__optional_std__variant_nitro__NullType__TextTrack__.swift +65 -0
- package/nitrogen/generated/ios/swift/Func_void_std__shared_ptr_Promise_std__string__.swift +66 -0
- package/nitrogen/generated/ios/swift/Func_void_std__string.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_std__vector_std__string_.swift +46 -0
- package/nitrogen/generated/ios/swift/HybridVideoPlayerEventEmitterSpec.swift +74 -0
- package/nitrogen/generated/ios/swift/HybridVideoPlayerEventEmitterSpec_cxx.swift +479 -0
- package/nitrogen/generated/ios/swift/HybridVideoPlayerFactorySpec.swift +55 -0
- package/nitrogen/generated/ios/swift/HybridVideoPlayerFactorySpec_cxx.swift +145 -0
- package/nitrogen/generated/ios/swift/HybridVideoPlayerSourceFactorySpec.swift +56 -0
- package/nitrogen/generated/ios/swift/HybridVideoPlayerSourceFactorySpec_cxx.swift +156 -0
- package/nitrogen/generated/ios/swift/HybridVideoPlayerSourceSpec.swift +56 -0
- package/nitrogen/generated/ios/swift/HybridVideoPlayerSourceSpec_cxx.swift +157 -0
- package/nitrogen/generated/ios/swift/HybridVideoPlayerSpec.swift +80 -0
- package/nitrogen/generated/ios/swift/HybridVideoPlayerSpec_cxx.swift +490 -0
- package/nitrogen/generated/ios/swift/HybridVideoViewViewManagerFactorySpec.swift +55 -0
- package/nitrogen/generated/ios/swift/HybridVideoViewViewManagerFactorySpec_cxx.swift +141 -0
- package/nitrogen/generated/ios/swift/HybridVideoViewViewManagerSpec.swift +72 -0
- package/nitrogen/generated/ios/swift/HybridVideoViewViewManagerSpec_cxx.swift +390 -0
- package/nitrogen/generated/ios/swift/IgnoreSilentSwitchMode.swift +44 -0
- package/nitrogen/generated/ios/swift/ListenerSubscription.swift +37 -0
- package/nitrogen/generated/ios/swift/LivePlaybackParams.swift +114 -0
- package/nitrogen/generated/ios/swift/MixAudioMode.swift +48 -0
- package/nitrogen/generated/ios/swift/NativeDrmParams.swift +193 -0
- package/nitrogen/generated/ios/swift/NativeExternalSubtitle.swift +44 -0
- package/nitrogen/generated/ios/swift/NativeVideoConfig.swift +136 -0
- package/nitrogen/generated/ios/swift/OnGetLicensePayload.swift +44 -0
- package/nitrogen/generated/ios/swift/ResizeMode.swift +48 -0
- package/nitrogen/generated/ios/swift/Resolution.swift +34 -0
- package/nitrogen/generated/ios/swift/SourceType.swift +40 -0
- package/nitrogen/generated/ios/swift/SubtitleType.swift +52 -0
- package/nitrogen/generated/ios/swift/SurfaceType.swift +40 -0
- package/nitrogen/generated/ios/swift/TextTrack.swift +57 -0
- package/nitrogen/generated/ios/swift/TimedMetadata.swift +35 -0
- package/nitrogen/generated/ios/swift/TimedMetadataObject.swift +34 -0
- package/nitrogen/generated/ios/swift/Variant_NullType_TextTrack.swift +30 -0
- package/nitrogen/generated/ios/swift/Variant_NullType__any_HybridVideoPlayerSourceSpec_.swift +30 -0
- package/nitrogen/generated/ios/swift/VideoInformation.swift +64 -0
- package/nitrogen/generated/ios/swift/VideoOrientation.swift +60 -0
- package/nitrogen/generated/ios/swift/VideoPlayerStatus.swift +48 -0
- package/nitrogen/generated/ios/swift/onLoadData.swift +49 -0
- package/nitrogen/generated/ios/swift/onLoadStartData.swift +41 -0
- package/nitrogen/generated/ios/swift/onPlaybackStateChangeData.swift +34 -0
- package/nitrogen/generated/ios/swift/onProgressData.swift +39 -0
- package/nitrogen/generated/ios/swift/onVolumeChangeData.swift +34 -0
- package/nitrogen/generated/shared/c++/BandwidthData.hpp +91 -0
- package/nitrogen/generated/shared/c++/BufferConfig.hpp +128 -0
- package/nitrogen/generated/shared/c++/CustomVideoMetadata.hpp +100 -0
- package/nitrogen/generated/shared/c++/HybridVideoPlayerEventEmitterSpec.cpp +40 -0
- package/nitrogen/generated/shared/c++/HybridVideoPlayerEventEmitterSpec.hpp +115 -0
- package/nitrogen/generated/shared/c++/HybridVideoPlayerFactorySpec.cpp +21 -0
- package/nitrogen/generated/shared/c++/HybridVideoPlayerFactorySpec.hpp +67 -0
- package/nitrogen/generated/shared/c++/HybridVideoPlayerSourceFactorySpec.cpp +22 -0
- package/nitrogen/generated/shared/c++/HybridVideoPlayerSourceFactorySpec.hpp +69 -0
- package/nitrogen/generated/shared/c++/HybridVideoPlayerSourceSpec.cpp +23 -0
- package/nitrogen/generated/shared/c++/HybridVideoPlayerSourceSpec.hpp +69 -0
- package/nitrogen/generated/shared/c++/HybridVideoPlayerSpec.cpp +57 -0
- package/nitrogen/generated/shared/c++/HybridVideoPlayerSpec.hpp +120 -0
- package/nitrogen/generated/shared/c++/HybridVideoViewViewManagerFactorySpec.cpp +21 -0
- package/nitrogen/generated/shared/c++/HybridVideoViewViewManagerFactorySpec.hpp +64 -0
- package/nitrogen/generated/shared/c++/HybridVideoViewViewManagerSpec.cpp +46 -0
- package/nitrogen/generated/shared/c++/HybridVideoViewViewManagerSpec.hpp +99 -0
- package/nitrogen/generated/shared/c++/IgnoreSilentSwitchMode.hpp +80 -0
- package/nitrogen/generated/shared/c++/ListenerSubscription.hpp +83 -0
- package/nitrogen/generated/shared/c++/LivePlaybackParams.hpp +99 -0
- package/nitrogen/generated/shared/c++/MixAudioMode.hpp +84 -0
- package/nitrogen/generated/shared/c++/NativeDrmParams.hpp +113 -0
- package/nitrogen/generated/shared/c++/NativeExternalSubtitle.hpp +97 -0
- package/nitrogen/generated/shared/c++/NativeVideoConfig.hpp +121 -0
- package/nitrogen/generated/shared/c++/OnGetLicensePayload.hpp +95 -0
- package/nitrogen/generated/shared/c++/ResizeMode.hpp +84 -0
- package/nitrogen/generated/shared/c++/Resolution.hpp +87 -0
- package/nitrogen/generated/shared/c++/SourceType.hpp +76 -0
- package/nitrogen/generated/shared/c++/SubtitleType.hpp +88 -0
- package/nitrogen/generated/shared/c++/SurfaceType.hpp +76 -0
- package/nitrogen/generated/shared/c++/TextTrack.hpp +96 -0
- package/nitrogen/generated/shared/c++/TimedMetadata.hpp +85 -0
- package/nitrogen/generated/shared/c++/TimedMetadataObject.hpp +87 -0
- package/nitrogen/generated/shared/c++/VideoInformation.hpp +112 -0
- package/nitrogen/generated/shared/c++/VideoOrientation.hpp +96 -0
- package/nitrogen/generated/shared/c++/VideoPlayerStatus.hpp +84 -0
- package/nitrogen/generated/shared/c++/onLoadData.hpp +100 -0
- package/nitrogen/generated/shared/c++/onLoadStartData.hpp +92 -0
- package/nitrogen/generated/shared/c++/onPlaybackStateChangeData.hpp +87 -0
- package/nitrogen/generated/shared/c++/onProgressData.hpp +91 -0
- package/nitrogen/generated/shared/c++/onVolumeChangeData.hpp +87 -0
- package/package.json +180 -0
- package/react-native.config.js +10 -0
- package/src/core/VideoPlayer.ts +357 -0
- package/src/core/VideoPlayerEvents.ts +146 -0
- package/src/core/hooks/useEvent.ts +24 -0
- package/src/core/hooks/useManagedInstance.ts +96 -0
- package/src/core/hooks/useVideoPlayer.ts +73 -0
- package/src/core/types/BufferConfig.ts +103 -0
- package/src/core/types/DrmParams.ts +65 -0
- package/src/core/types/Events.ts +283 -0
- package/src/core/types/IgnoreSilentSwitchMode.ts +1 -0
- package/src/core/types/MixAudioMode.ts +1 -0
- package/src/core/types/ResizeMode.ts +9 -0
- package/src/core/types/TextTrack.ts +22 -0
- package/src/core/types/Utils.ts +1 -0
- package/src/core/types/VideoConfig.ts +150 -0
- package/src/core/types/VideoError.ts +174 -0
- package/src/core/types/VideoInformation.ts +45 -0
- package/src/core/types/VideoOrientation.ts +8 -0
- package/src/core/types/VideoPlayerBase.ts +181 -0
- package/src/core/types/VideoPlayerSourceBase.ts +19 -0
- package/src/core/types/VideoPlayerStatus.ts +8 -0
- package/src/core/utils/playerFactory.ts +33 -0
- package/src/core/utils/sourceFactory.ts +171 -0
- package/src/core/video-view/NativeVideoView.tsx +18 -0
- package/src/core/video-view/VideoView.tsx +492 -0
- package/src/expo-plugins/@types.ts +37 -0
- package/src/expo-plugins/getPackageInfo.ts +23 -0
- package/src/expo-plugins/withAndroidExtensions.ts +46 -0
- package/src/expo-plugins/withAndroidNotificationControls.ts +43 -0
- package/src/expo-plugins/withAndroidPictureInPicture.ts +31 -0
- package/src/expo-plugins/withBackgroundAudio.ts +26 -0
- package/src/expo-plugins/withReactNativeVideo.ts +32 -0
- package/src/expo-plugins/writeToPodfile.ts +74 -0
- package/src/index.tsx +29 -0
- package/src/spec/fabric/VideoViewNativeComponent.ts +17 -0
- package/src/spec/nitro/VideoPlayer.nitro.ts +62 -0
- package/src/spec/nitro/VideoPlayerEventEmitter.nitro.ts +207 -0
- package/src/spec/nitro/VideoPlayerSource.nitro.ts +18 -0
- package/src/spec/nitro/VideoViewViewManager.nitro.ts +92 -0
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// LivePlaybackParams.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#if __has_include(<NitroModules/JSIConverter.hpp>)
|
|
11
|
+
#include <NitroModules/JSIConverter.hpp>
|
|
12
|
+
#else
|
|
13
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
14
|
+
#endif
|
|
15
|
+
#if __has_include(<NitroModules/NitroDefines.hpp>)
|
|
16
|
+
#include <NitroModules/NitroDefines.hpp>
|
|
17
|
+
#else
|
|
18
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
19
|
+
#endif
|
|
20
|
+
#if __has_include(<NitroModules/JSIHelpers.hpp>)
|
|
21
|
+
#include <NitroModules/JSIHelpers.hpp>
|
|
22
|
+
#else
|
|
23
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
24
|
+
#endif
|
|
25
|
+
#if __has_include(<NitroModules/PropNameIDCache.hpp>)
|
|
26
|
+
#include <NitroModules/PropNameIDCache.hpp>
|
|
27
|
+
#else
|
|
28
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
29
|
+
#endif
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
#include <optional>
|
|
34
|
+
|
|
35
|
+
namespace margelo::nitro::unifiedplayer {
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* A struct which can be represented as a JavaScript object (LivePlaybackParams).
|
|
39
|
+
*/
|
|
40
|
+
struct LivePlaybackParams final {
|
|
41
|
+
public:
|
|
42
|
+
std::optional<double> minPlaybackSpeed SWIFT_PRIVATE;
|
|
43
|
+
std::optional<double> maxPlaybackSpeed SWIFT_PRIVATE;
|
|
44
|
+
std::optional<double> maxOffsetMs SWIFT_PRIVATE;
|
|
45
|
+
std::optional<double> minOffsetMs SWIFT_PRIVATE;
|
|
46
|
+
std::optional<double> targetOffsetMs SWIFT_PRIVATE;
|
|
47
|
+
|
|
48
|
+
public:
|
|
49
|
+
LivePlaybackParams() = default;
|
|
50
|
+
explicit LivePlaybackParams(std::optional<double> minPlaybackSpeed, std::optional<double> maxPlaybackSpeed, std::optional<double> maxOffsetMs, std::optional<double> minOffsetMs, std::optional<double> targetOffsetMs): minPlaybackSpeed(minPlaybackSpeed), maxPlaybackSpeed(maxPlaybackSpeed), maxOffsetMs(maxOffsetMs), minOffsetMs(minOffsetMs), targetOffsetMs(targetOffsetMs) {}
|
|
51
|
+
|
|
52
|
+
public:
|
|
53
|
+
friend bool operator==(const LivePlaybackParams& lhs, const LivePlaybackParams& rhs) = default;
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
} // namespace margelo::nitro::unifiedplayer
|
|
57
|
+
|
|
58
|
+
namespace margelo::nitro {
|
|
59
|
+
|
|
60
|
+
// C++ LivePlaybackParams <> JS LivePlaybackParams (object)
|
|
61
|
+
template <>
|
|
62
|
+
struct JSIConverter<margelo::nitro::unifiedplayer::LivePlaybackParams> final {
|
|
63
|
+
static inline margelo::nitro::unifiedplayer::LivePlaybackParams fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
64
|
+
jsi::Object obj = arg.asObject(runtime);
|
|
65
|
+
return margelo::nitro::unifiedplayer::LivePlaybackParams(
|
|
66
|
+
JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "minPlaybackSpeed"))),
|
|
67
|
+
JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "maxPlaybackSpeed"))),
|
|
68
|
+
JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "maxOffsetMs"))),
|
|
69
|
+
JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "minOffsetMs"))),
|
|
70
|
+
JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "targetOffsetMs")))
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::unifiedplayer::LivePlaybackParams& arg) {
|
|
74
|
+
jsi::Object obj(runtime);
|
|
75
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "minPlaybackSpeed"), JSIConverter<std::optional<double>>::toJSI(runtime, arg.minPlaybackSpeed));
|
|
76
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "maxPlaybackSpeed"), JSIConverter<std::optional<double>>::toJSI(runtime, arg.maxPlaybackSpeed));
|
|
77
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "maxOffsetMs"), JSIConverter<std::optional<double>>::toJSI(runtime, arg.maxOffsetMs));
|
|
78
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "minOffsetMs"), JSIConverter<std::optional<double>>::toJSI(runtime, arg.minOffsetMs));
|
|
79
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "targetOffsetMs"), JSIConverter<std::optional<double>>::toJSI(runtime, arg.targetOffsetMs));
|
|
80
|
+
return obj;
|
|
81
|
+
}
|
|
82
|
+
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
83
|
+
if (!value.isObject()) {
|
|
84
|
+
return false;
|
|
85
|
+
}
|
|
86
|
+
jsi::Object obj = value.getObject(runtime);
|
|
87
|
+
if (!nitro::isPlainObject(runtime, obj)) {
|
|
88
|
+
return false;
|
|
89
|
+
}
|
|
90
|
+
if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "minPlaybackSpeed")))) return false;
|
|
91
|
+
if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "maxPlaybackSpeed")))) return false;
|
|
92
|
+
if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "maxOffsetMs")))) return false;
|
|
93
|
+
if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "minOffsetMs")))) return false;
|
|
94
|
+
if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "targetOffsetMs")))) return false;
|
|
95
|
+
return true;
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
} // namespace margelo::nitro
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// MixAudioMode.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#if __has_include(<NitroModules/NitroHash.hpp>)
|
|
11
|
+
#include <NitroModules/NitroHash.hpp>
|
|
12
|
+
#else
|
|
13
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
14
|
+
#endif
|
|
15
|
+
#if __has_include(<NitroModules/JSIConverter.hpp>)
|
|
16
|
+
#include <NitroModules/JSIConverter.hpp>
|
|
17
|
+
#else
|
|
18
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
19
|
+
#endif
|
|
20
|
+
#if __has_include(<NitroModules/NitroDefines.hpp>)
|
|
21
|
+
#include <NitroModules/NitroDefines.hpp>
|
|
22
|
+
#else
|
|
23
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
24
|
+
#endif
|
|
25
|
+
|
|
26
|
+
namespace margelo::nitro::unifiedplayer {
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* An enum which can be represented as a JavaScript union (MixAudioMode).
|
|
30
|
+
*/
|
|
31
|
+
enum class MixAudioMode {
|
|
32
|
+
MIXWITHOTHERS SWIFT_NAME(mixwithothers) = 0,
|
|
33
|
+
DONOTMIX SWIFT_NAME(donotmix) = 1,
|
|
34
|
+
DUCKOTHERS SWIFT_NAME(duckothers) = 2,
|
|
35
|
+
AUTO SWIFT_NAME(auto) = 3,
|
|
36
|
+
} CLOSED_ENUM;
|
|
37
|
+
|
|
38
|
+
} // namespace margelo::nitro::unifiedplayer
|
|
39
|
+
|
|
40
|
+
namespace margelo::nitro {
|
|
41
|
+
|
|
42
|
+
// C++ MixAudioMode <> JS MixAudioMode (union)
|
|
43
|
+
template <>
|
|
44
|
+
struct JSIConverter<margelo::nitro::unifiedplayer::MixAudioMode> final {
|
|
45
|
+
static inline margelo::nitro::unifiedplayer::MixAudioMode fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
46
|
+
std::string unionValue = JSIConverter<std::string>::fromJSI(runtime, arg);
|
|
47
|
+
switch (hashString(unionValue.c_str(), unionValue.size())) {
|
|
48
|
+
case hashString("mixWithOthers"): return margelo::nitro::unifiedplayer::MixAudioMode::MIXWITHOTHERS;
|
|
49
|
+
case hashString("doNotMix"): return margelo::nitro::unifiedplayer::MixAudioMode::DONOTMIX;
|
|
50
|
+
case hashString("duckOthers"): return margelo::nitro::unifiedplayer::MixAudioMode::DUCKOTHERS;
|
|
51
|
+
case hashString("auto"): return margelo::nitro::unifiedplayer::MixAudioMode::AUTO;
|
|
52
|
+
default: [[unlikely]]
|
|
53
|
+
throw std::invalid_argument("Cannot convert \"" + unionValue + "\" to enum MixAudioMode - invalid value!");
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, margelo::nitro::unifiedplayer::MixAudioMode arg) {
|
|
57
|
+
switch (arg) {
|
|
58
|
+
case margelo::nitro::unifiedplayer::MixAudioMode::MIXWITHOTHERS: return JSIConverter<std::string>::toJSI(runtime, "mixWithOthers");
|
|
59
|
+
case margelo::nitro::unifiedplayer::MixAudioMode::DONOTMIX: return JSIConverter<std::string>::toJSI(runtime, "doNotMix");
|
|
60
|
+
case margelo::nitro::unifiedplayer::MixAudioMode::DUCKOTHERS: return JSIConverter<std::string>::toJSI(runtime, "duckOthers");
|
|
61
|
+
case margelo::nitro::unifiedplayer::MixAudioMode::AUTO: return JSIConverter<std::string>::toJSI(runtime, "auto");
|
|
62
|
+
default: [[unlikely]]
|
|
63
|
+
throw std::invalid_argument("Cannot convert MixAudioMode to JS - invalid value: "
|
|
64
|
+
+ std::to_string(static_cast<int>(arg)) + "!");
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
68
|
+
if (!value.isString()) {
|
|
69
|
+
return false;
|
|
70
|
+
}
|
|
71
|
+
std::string unionValue = JSIConverter<std::string>::fromJSI(runtime, value);
|
|
72
|
+
switch (hashString(unionValue.c_str(), unionValue.size())) {
|
|
73
|
+
case hashString("mixWithOthers"):
|
|
74
|
+
case hashString("doNotMix"):
|
|
75
|
+
case hashString("duckOthers"):
|
|
76
|
+
case hashString("auto"):
|
|
77
|
+
return true;
|
|
78
|
+
default:
|
|
79
|
+
return false;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
} // namespace margelo::nitro
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// NativeDrmParams.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#if __has_include(<NitroModules/JSIConverter.hpp>)
|
|
11
|
+
#include <NitroModules/JSIConverter.hpp>
|
|
12
|
+
#else
|
|
13
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
14
|
+
#endif
|
|
15
|
+
#if __has_include(<NitroModules/NitroDefines.hpp>)
|
|
16
|
+
#include <NitroModules/NitroDefines.hpp>
|
|
17
|
+
#else
|
|
18
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
19
|
+
#endif
|
|
20
|
+
#if __has_include(<NitroModules/JSIHelpers.hpp>)
|
|
21
|
+
#include <NitroModules/JSIHelpers.hpp>
|
|
22
|
+
#else
|
|
23
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
24
|
+
#endif
|
|
25
|
+
#if __has_include(<NitroModules/PropNameIDCache.hpp>)
|
|
26
|
+
#include <NitroModules/PropNameIDCache.hpp>
|
|
27
|
+
#else
|
|
28
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
29
|
+
#endif
|
|
30
|
+
|
|
31
|
+
// Forward declaration of `OnGetLicensePayload` to properly resolve imports.
|
|
32
|
+
namespace margelo::nitro::unifiedplayer { struct OnGetLicensePayload; }
|
|
33
|
+
|
|
34
|
+
#include <string>
|
|
35
|
+
#include <optional>
|
|
36
|
+
#include <unordered_map>
|
|
37
|
+
#include <NitroModules/Promise.hpp>
|
|
38
|
+
#include "OnGetLicensePayload.hpp"
|
|
39
|
+
#include <functional>
|
|
40
|
+
|
|
41
|
+
namespace margelo::nitro::unifiedplayer {
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* A struct which can be represented as a JavaScript object (NativeDrmParams).
|
|
45
|
+
*/
|
|
46
|
+
struct NativeDrmParams final {
|
|
47
|
+
public:
|
|
48
|
+
std::optional<std::string> type SWIFT_PRIVATE;
|
|
49
|
+
std::optional<std::string> licenseUrl SWIFT_PRIVATE;
|
|
50
|
+
std::optional<std::string> certificateUrl SWIFT_PRIVATE;
|
|
51
|
+
std::optional<std::string> contentId SWIFT_PRIVATE;
|
|
52
|
+
std::optional<std::unordered_map<std::string, std::string>> licenseHeaders SWIFT_PRIVATE;
|
|
53
|
+
std::optional<bool> multiSession SWIFT_PRIVATE;
|
|
54
|
+
std::optional<std::function<std::shared_ptr<Promise<std::shared_ptr<Promise<std::string>>>>(const OnGetLicensePayload& /* payload */)>> getLicense SWIFT_PRIVATE;
|
|
55
|
+
|
|
56
|
+
public:
|
|
57
|
+
NativeDrmParams() = default;
|
|
58
|
+
explicit NativeDrmParams(std::optional<std::string> type, std::optional<std::string> licenseUrl, std::optional<std::string> certificateUrl, std::optional<std::string> contentId, std::optional<std::unordered_map<std::string, std::string>> licenseHeaders, std::optional<bool> multiSession, std::optional<std::function<std::shared_ptr<Promise<std::shared_ptr<Promise<std::string>>>>(const OnGetLicensePayload& /* payload */)>> getLicense): type(type), licenseUrl(licenseUrl), certificateUrl(certificateUrl), contentId(contentId), licenseHeaders(licenseHeaders), multiSession(multiSession), getLicense(getLicense) {}
|
|
59
|
+
|
|
60
|
+
public:
|
|
61
|
+
// NativeDrmParams is not equatable because these properties are not equatable: getLicense
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
} // namespace margelo::nitro::unifiedplayer
|
|
65
|
+
|
|
66
|
+
namespace margelo::nitro {
|
|
67
|
+
|
|
68
|
+
// C++ NativeDrmParams <> JS NativeDrmParams (object)
|
|
69
|
+
template <>
|
|
70
|
+
struct JSIConverter<margelo::nitro::unifiedplayer::NativeDrmParams> final {
|
|
71
|
+
static inline margelo::nitro::unifiedplayer::NativeDrmParams fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
72
|
+
jsi::Object obj = arg.asObject(runtime);
|
|
73
|
+
return margelo::nitro::unifiedplayer::NativeDrmParams(
|
|
74
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "type"))),
|
|
75
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "licenseUrl"))),
|
|
76
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "certificateUrl"))),
|
|
77
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "contentId"))),
|
|
78
|
+
JSIConverter<std::optional<std::unordered_map<std::string, std::string>>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "licenseHeaders"))),
|
|
79
|
+
JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "multiSession"))),
|
|
80
|
+
JSIConverter<std::optional<std::function<std::shared_ptr<Promise<std::shared_ptr<Promise<std::string>>>>(const margelo::nitro::unifiedplayer::OnGetLicensePayload&)>>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "getLicense")))
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::unifiedplayer::NativeDrmParams& arg) {
|
|
84
|
+
jsi::Object obj(runtime);
|
|
85
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "type"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.type));
|
|
86
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "licenseUrl"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.licenseUrl));
|
|
87
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "certificateUrl"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.certificateUrl));
|
|
88
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "contentId"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.contentId));
|
|
89
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "licenseHeaders"), JSIConverter<std::optional<std::unordered_map<std::string, std::string>>>::toJSI(runtime, arg.licenseHeaders));
|
|
90
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "multiSession"), JSIConverter<std::optional<bool>>::toJSI(runtime, arg.multiSession));
|
|
91
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "getLicense"), JSIConverter<std::optional<std::function<std::shared_ptr<Promise<std::shared_ptr<Promise<std::string>>>>(const margelo::nitro::unifiedplayer::OnGetLicensePayload&)>>>::toJSI(runtime, arg.getLicense));
|
|
92
|
+
return obj;
|
|
93
|
+
}
|
|
94
|
+
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
95
|
+
if (!value.isObject()) {
|
|
96
|
+
return false;
|
|
97
|
+
}
|
|
98
|
+
jsi::Object obj = value.getObject(runtime);
|
|
99
|
+
if (!nitro::isPlainObject(runtime, obj)) {
|
|
100
|
+
return false;
|
|
101
|
+
}
|
|
102
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "type")))) return false;
|
|
103
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "licenseUrl")))) return false;
|
|
104
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "certificateUrl")))) return false;
|
|
105
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "contentId")))) return false;
|
|
106
|
+
if (!JSIConverter<std::optional<std::unordered_map<std::string, std::string>>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "licenseHeaders")))) return false;
|
|
107
|
+
if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "multiSession")))) return false;
|
|
108
|
+
if (!JSIConverter<std::optional<std::function<std::shared_ptr<Promise<std::shared_ptr<Promise<std::string>>>>(const margelo::nitro::unifiedplayer::OnGetLicensePayload&)>>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "getLicense")))) return false;
|
|
109
|
+
return true;
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
} // namespace margelo::nitro
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// NativeExternalSubtitle.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#if __has_include(<NitroModules/JSIConverter.hpp>)
|
|
11
|
+
#include <NitroModules/JSIConverter.hpp>
|
|
12
|
+
#else
|
|
13
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
14
|
+
#endif
|
|
15
|
+
#if __has_include(<NitroModules/NitroDefines.hpp>)
|
|
16
|
+
#include <NitroModules/NitroDefines.hpp>
|
|
17
|
+
#else
|
|
18
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
19
|
+
#endif
|
|
20
|
+
#if __has_include(<NitroModules/JSIHelpers.hpp>)
|
|
21
|
+
#include <NitroModules/JSIHelpers.hpp>
|
|
22
|
+
#else
|
|
23
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
24
|
+
#endif
|
|
25
|
+
#if __has_include(<NitroModules/PropNameIDCache.hpp>)
|
|
26
|
+
#include <NitroModules/PropNameIDCache.hpp>
|
|
27
|
+
#else
|
|
28
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
29
|
+
#endif
|
|
30
|
+
|
|
31
|
+
// Forward declaration of `SubtitleType` to properly resolve imports.
|
|
32
|
+
namespace margelo::nitro::unifiedplayer { enum class SubtitleType; }
|
|
33
|
+
|
|
34
|
+
#include <string>
|
|
35
|
+
#include "SubtitleType.hpp"
|
|
36
|
+
|
|
37
|
+
namespace margelo::nitro::unifiedplayer {
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* A struct which can be represented as a JavaScript object (NativeExternalSubtitle).
|
|
41
|
+
*/
|
|
42
|
+
struct NativeExternalSubtitle final {
|
|
43
|
+
public:
|
|
44
|
+
std::string uri SWIFT_PRIVATE;
|
|
45
|
+
std::string label SWIFT_PRIVATE;
|
|
46
|
+
SubtitleType type SWIFT_PRIVATE;
|
|
47
|
+
std::string language SWIFT_PRIVATE;
|
|
48
|
+
|
|
49
|
+
public:
|
|
50
|
+
NativeExternalSubtitle() = default;
|
|
51
|
+
explicit NativeExternalSubtitle(std::string uri, std::string label, SubtitleType type, std::string language): uri(uri), label(label), type(type), language(language) {}
|
|
52
|
+
|
|
53
|
+
public:
|
|
54
|
+
friend bool operator==(const NativeExternalSubtitle& lhs, const NativeExternalSubtitle& rhs) = default;
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
} // namespace margelo::nitro::unifiedplayer
|
|
58
|
+
|
|
59
|
+
namespace margelo::nitro {
|
|
60
|
+
|
|
61
|
+
// C++ NativeExternalSubtitle <> JS NativeExternalSubtitle (object)
|
|
62
|
+
template <>
|
|
63
|
+
struct JSIConverter<margelo::nitro::unifiedplayer::NativeExternalSubtitle> final {
|
|
64
|
+
static inline margelo::nitro::unifiedplayer::NativeExternalSubtitle fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
65
|
+
jsi::Object obj = arg.asObject(runtime);
|
|
66
|
+
return margelo::nitro::unifiedplayer::NativeExternalSubtitle(
|
|
67
|
+
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "uri"))),
|
|
68
|
+
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "label"))),
|
|
69
|
+
JSIConverter<margelo::nitro::unifiedplayer::SubtitleType>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "type"))),
|
|
70
|
+
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "language")))
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::unifiedplayer::NativeExternalSubtitle& arg) {
|
|
74
|
+
jsi::Object obj(runtime);
|
|
75
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "uri"), JSIConverter<std::string>::toJSI(runtime, arg.uri));
|
|
76
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "label"), JSIConverter<std::string>::toJSI(runtime, arg.label));
|
|
77
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "type"), JSIConverter<margelo::nitro::unifiedplayer::SubtitleType>::toJSI(runtime, arg.type));
|
|
78
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "language"), JSIConverter<std::string>::toJSI(runtime, arg.language));
|
|
79
|
+
return obj;
|
|
80
|
+
}
|
|
81
|
+
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
82
|
+
if (!value.isObject()) {
|
|
83
|
+
return false;
|
|
84
|
+
}
|
|
85
|
+
jsi::Object obj = value.getObject(runtime);
|
|
86
|
+
if (!nitro::isPlainObject(runtime, obj)) {
|
|
87
|
+
return false;
|
|
88
|
+
}
|
|
89
|
+
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "uri")))) return false;
|
|
90
|
+
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "label")))) return false;
|
|
91
|
+
if (!JSIConverter<margelo::nitro::unifiedplayer::SubtitleType>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "type")))) return false;
|
|
92
|
+
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "language")))) return false;
|
|
93
|
+
return true;
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
} // namespace margelo::nitro
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// NativeVideoConfig.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#if __has_include(<NitroModules/JSIConverter.hpp>)
|
|
11
|
+
#include <NitroModules/JSIConverter.hpp>
|
|
12
|
+
#else
|
|
13
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
14
|
+
#endif
|
|
15
|
+
#if __has_include(<NitroModules/NitroDefines.hpp>)
|
|
16
|
+
#include <NitroModules/NitroDefines.hpp>
|
|
17
|
+
#else
|
|
18
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
19
|
+
#endif
|
|
20
|
+
#if __has_include(<NitroModules/JSIHelpers.hpp>)
|
|
21
|
+
#include <NitroModules/JSIHelpers.hpp>
|
|
22
|
+
#else
|
|
23
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
24
|
+
#endif
|
|
25
|
+
#if __has_include(<NitroModules/PropNameIDCache.hpp>)
|
|
26
|
+
#include <NitroModules/PropNameIDCache.hpp>
|
|
27
|
+
#else
|
|
28
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
29
|
+
#endif
|
|
30
|
+
|
|
31
|
+
// Forward declaration of `NativeExternalSubtitle` to properly resolve imports.
|
|
32
|
+
namespace margelo::nitro::unifiedplayer { struct NativeExternalSubtitle; }
|
|
33
|
+
// Forward declaration of `NativeDrmParams` to properly resolve imports.
|
|
34
|
+
namespace margelo::nitro::unifiedplayer { struct NativeDrmParams; }
|
|
35
|
+
// Forward declaration of `BufferConfig` to properly resolve imports.
|
|
36
|
+
namespace margelo::nitro::unifiedplayer { struct BufferConfig; }
|
|
37
|
+
// Forward declaration of `CustomVideoMetadata` to properly resolve imports.
|
|
38
|
+
namespace margelo::nitro::unifiedplayer { struct CustomVideoMetadata; }
|
|
39
|
+
|
|
40
|
+
#include <string>
|
|
41
|
+
#include "NativeExternalSubtitle.hpp"
|
|
42
|
+
#include <vector>
|
|
43
|
+
#include <optional>
|
|
44
|
+
#include "NativeDrmParams.hpp"
|
|
45
|
+
#include <unordered_map>
|
|
46
|
+
#include "BufferConfig.hpp"
|
|
47
|
+
#include "CustomVideoMetadata.hpp"
|
|
48
|
+
|
|
49
|
+
namespace margelo::nitro::unifiedplayer {
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* A struct which can be represented as a JavaScript object (NativeVideoConfig).
|
|
53
|
+
*/
|
|
54
|
+
struct NativeVideoConfig final {
|
|
55
|
+
public:
|
|
56
|
+
std::string uri SWIFT_PRIVATE;
|
|
57
|
+
std::optional<std::vector<NativeExternalSubtitle>> externalSubtitles SWIFT_PRIVATE;
|
|
58
|
+
std::optional<NativeDrmParams> drm SWIFT_PRIVATE;
|
|
59
|
+
std::optional<std::unordered_map<std::string, std::string>> headers SWIFT_PRIVATE;
|
|
60
|
+
std::optional<BufferConfig> bufferConfig SWIFT_PRIVATE;
|
|
61
|
+
std::optional<CustomVideoMetadata> metadata SWIFT_PRIVATE;
|
|
62
|
+
std::optional<bool> initializeOnCreation SWIFT_PRIVATE;
|
|
63
|
+
|
|
64
|
+
public:
|
|
65
|
+
NativeVideoConfig() = default;
|
|
66
|
+
explicit NativeVideoConfig(std::string uri, std::optional<std::vector<NativeExternalSubtitle>> externalSubtitles, std::optional<NativeDrmParams> drm, std::optional<std::unordered_map<std::string, std::string>> headers, std::optional<BufferConfig> bufferConfig, std::optional<CustomVideoMetadata> metadata, std::optional<bool> initializeOnCreation): uri(uri), externalSubtitles(externalSubtitles), drm(drm), headers(headers), bufferConfig(bufferConfig), metadata(metadata), initializeOnCreation(initializeOnCreation) {}
|
|
67
|
+
|
|
68
|
+
public:
|
|
69
|
+
// NativeVideoConfig is not equatable because these properties are not equatable: drm
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
} // namespace margelo::nitro::unifiedplayer
|
|
73
|
+
|
|
74
|
+
namespace margelo::nitro {
|
|
75
|
+
|
|
76
|
+
// C++ NativeVideoConfig <> JS NativeVideoConfig (object)
|
|
77
|
+
template <>
|
|
78
|
+
struct JSIConverter<margelo::nitro::unifiedplayer::NativeVideoConfig> final {
|
|
79
|
+
static inline margelo::nitro::unifiedplayer::NativeVideoConfig fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
80
|
+
jsi::Object obj = arg.asObject(runtime);
|
|
81
|
+
return margelo::nitro::unifiedplayer::NativeVideoConfig(
|
|
82
|
+
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "uri"))),
|
|
83
|
+
JSIConverter<std::optional<std::vector<margelo::nitro::unifiedplayer::NativeExternalSubtitle>>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "externalSubtitles"))),
|
|
84
|
+
JSIConverter<std::optional<margelo::nitro::unifiedplayer::NativeDrmParams>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "drm"))),
|
|
85
|
+
JSIConverter<std::optional<std::unordered_map<std::string, std::string>>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "headers"))),
|
|
86
|
+
JSIConverter<std::optional<margelo::nitro::unifiedplayer::BufferConfig>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "bufferConfig"))),
|
|
87
|
+
JSIConverter<std::optional<margelo::nitro::unifiedplayer::CustomVideoMetadata>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadata"))),
|
|
88
|
+
JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "initializeOnCreation")))
|
|
89
|
+
);
|
|
90
|
+
}
|
|
91
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::unifiedplayer::NativeVideoConfig& arg) {
|
|
92
|
+
jsi::Object obj(runtime);
|
|
93
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "uri"), JSIConverter<std::string>::toJSI(runtime, arg.uri));
|
|
94
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "externalSubtitles"), JSIConverter<std::optional<std::vector<margelo::nitro::unifiedplayer::NativeExternalSubtitle>>>::toJSI(runtime, arg.externalSubtitles));
|
|
95
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "drm"), JSIConverter<std::optional<margelo::nitro::unifiedplayer::NativeDrmParams>>::toJSI(runtime, arg.drm));
|
|
96
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "headers"), JSIConverter<std::optional<std::unordered_map<std::string, std::string>>>::toJSI(runtime, arg.headers));
|
|
97
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "bufferConfig"), JSIConverter<std::optional<margelo::nitro::unifiedplayer::BufferConfig>>::toJSI(runtime, arg.bufferConfig));
|
|
98
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "metadata"), JSIConverter<std::optional<margelo::nitro::unifiedplayer::CustomVideoMetadata>>::toJSI(runtime, arg.metadata));
|
|
99
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "initializeOnCreation"), JSIConverter<std::optional<bool>>::toJSI(runtime, arg.initializeOnCreation));
|
|
100
|
+
return obj;
|
|
101
|
+
}
|
|
102
|
+
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
103
|
+
if (!value.isObject()) {
|
|
104
|
+
return false;
|
|
105
|
+
}
|
|
106
|
+
jsi::Object obj = value.getObject(runtime);
|
|
107
|
+
if (!nitro::isPlainObject(runtime, obj)) {
|
|
108
|
+
return false;
|
|
109
|
+
}
|
|
110
|
+
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "uri")))) return false;
|
|
111
|
+
if (!JSIConverter<std::optional<std::vector<margelo::nitro::unifiedplayer::NativeExternalSubtitle>>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "externalSubtitles")))) return false;
|
|
112
|
+
if (!JSIConverter<std::optional<margelo::nitro::unifiedplayer::NativeDrmParams>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "drm")))) return false;
|
|
113
|
+
if (!JSIConverter<std::optional<std::unordered_map<std::string, std::string>>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "headers")))) return false;
|
|
114
|
+
if (!JSIConverter<std::optional<margelo::nitro::unifiedplayer::BufferConfig>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "bufferConfig")))) return false;
|
|
115
|
+
if (!JSIConverter<std::optional<margelo::nitro::unifiedplayer::CustomVideoMetadata>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "metadata")))) return false;
|
|
116
|
+
if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "initializeOnCreation")))) return false;
|
|
117
|
+
return true;
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
} // namespace margelo::nitro
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// OnGetLicensePayload.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#if __has_include(<NitroModules/JSIConverter.hpp>)
|
|
11
|
+
#include <NitroModules/JSIConverter.hpp>
|
|
12
|
+
#else
|
|
13
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
14
|
+
#endif
|
|
15
|
+
#if __has_include(<NitroModules/NitroDefines.hpp>)
|
|
16
|
+
#include <NitroModules/NitroDefines.hpp>
|
|
17
|
+
#else
|
|
18
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
19
|
+
#endif
|
|
20
|
+
#if __has_include(<NitroModules/JSIHelpers.hpp>)
|
|
21
|
+
#include <NitroModules/JSIHelpers.hpp>
|
|
22
|
+
#else
|
|
23
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
24
|
+
#endif
|
|
25
|
+
#if __has_include(<NitroModules/PropNameIDCache.hpp>)
|
|
26
|
+
#include <NitroModules/PropNameIDCache.hpp>
|
|
27
|
+
#else
|
|
28
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
29
|
+
#endif
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
#include <string>
|
|
34
|
+
|
|
35
|
+
namespace margelo::nitro::unifiedplayer {
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* A struct which can be represented as a JavaScript object (OnGetLicensePayload).
|
|
39
|
+
*/
|
|
40
|
+
struct OnGetLicensePayload final {
|
|
41
|
+
public:
|
|
42
|
+
std::string contentId SWIFT_PRIVATE;
|
|
43
|
+
std::string licenseUrl SWIFT_PRIVATE;
|
|
44
|
+
std::string keyUrl SWIFT_PRIVATE;
|
|
45
|
+
std::string spc SWIFT_PRIVATE;
|
|
46
|
+
|
|
47
|
+
public:
|
|
48
|
+
OnGetLicensePayload() = default;
|
|
49
|
+
explicit OnGetLicensePayload(std::string contentId, std::string licenseUrl, std::string keyUrl, std::string spc): contentId(contentId), licenseUrl(licenseUrl), keyUrl(keyUrl), spc(spc) {}
|
|
50
|
+
|
|
51
|
+
public:
|
|
52
|
+
friend bool operator==(const OnGetLicensePayload& lhs, const OnGetLicensePayload& rhs) = default;
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
} // namespace margelo::nitro::unifiedplayer
|
|
56
|
+
|
|
57
|
+
namespace margelo::nitro {
|
|
58
|
+
|
|
59
|
+
// C++ OnGetLicensePayload <> JS OnGetLicensePayload (object)
|
|
60
|
+
template <>
|
|
61
|
+
struct JSIConverter<margelo::nitro::unifiedplayer::OnGetLicensePayload> final {
|
|
62
|
+
static inline margelo::nitro::unifiedplayer::OnGetLicensePayload fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
63
|
+
jsi::Object obj = arg.asObject(runtime);
|
|
64
|
+
return margelo::nitro::unifiedplayer::OnGetLicensePayload(
|
|
65
|
+
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "contentId"))),
|
|
66
|
+
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "licenseUrl"))),
|
|
67
|
+
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "keyUrl"))),
|
|
68
|
+
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "spc")))
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::unifiedplayer::OnGetLicensePayload& arg) {
|
|
72
|
+
jsi::Object obj(runtime);
|
|
73
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "contentId"), JSIConverter<std::string>::toJSI(runtime, arg.contentId));
|
|
74
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "licenseUrl"), JSIConverter<std::string>::toJSI(runtime, arg.licenseUrl));
|
|
75
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "keyUrl"), JSIConverter<std::string>::toJSI(runtime, arg.keyUrl));
|
|
76
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "spc"), JSIConverter<std::string>::toJSI(runtime, arg.spc));
|
|
77
|
+
return obj;
|
|
78
|
+
}
|
|
79
|
+
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
80
|
+
if (!value.isObject()) {
|
|
81
|
+
return false;
|
|
82
|
+
}
|
|
83
|
+
jsi::Object obj = value.getObject(runtime);
|
|
84
|
+
if (!nitro::isPlainObject(runtime, obj)) {
|
|
85
|
+
return false;
|
|
86
|
+
}
|
|
87
|
+
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "contentId")))) return false;
|
|
88
|
+
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "licenseUrl")))) return false;
|
|
89
|
+
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "keyUrl")))) return false;
|
|
90
|
+
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "spc")))) return false;
|
|
91
|
+
return true;
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
} // namespace margelo::nitro
|