mirror of
https://github.com/zoriya/react-native-video.git
synced 2026-06-04 19:36:52 +00:00
.
This commit is contained in:
@@ -0,0 +1,69 @@
|
||||
///
|
||||
/// HybridVideoPlayerSourceSpec.hpp
|
||||
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
||||
/// https://github.com/mrousavy/nitro
|
||||
/// Copyright © 2025 Marc Rousavy @ Margelo
|
||||
///
|
||||
|
||||
#pragma once
|
||||
|
||||
#if __has_include(<NitroModules/HybridObject.hpp>)
|
||||
#include <NitroModules/HybridObject.hpp>
|
||||
#else
|
||||
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
||||
#endif
|
||||
|
||||
// Forward declaration of `NativeVideoConfig` to properly resolve imports.
|
||||
namespace margelo::nitro::video { struct NativeVideoConfig; }
|
||||
// Forward declaration of `VideoInformation` to properly resolve imports.
|
||||
namespace margelo::nitro::video { struct VideoInformation; }
|
||||
|
||||
#include <string>
|
||||
#include "NativeVideoConfig.hpp"
|
||||
#include "VideoInformation.hpp"
|
||||
#include <NitroModules/Promise.hpp>
|
||||
|
||||
namespace margelo::nitro::video {
|
||||
|
||||
using namespace margelo::nitro;
|
||||
|
||||
/**
|
||||
* An abstract base class for `VideoPlayerSource`
|
||||
* Inherit this class to create instances of `HybridVideoPlayerSourceSpec` in C++.
|
||||
* You must explicitly call `HybridObject`'s constructor yourself, because it is virtual.
|
||||
* @example
|
||||
* ```cpp
|
||||
* class HybridVideoPlayerSource: public HybridVideoPlayerSourceSpec {
|
||||
* public:
|
||||
* HybridVideoPlayerSource(...): HybridObject(TAG) { ... }
|
||||
* // ...
|
||||
* };
|
||||
* ```
|
||||
*/
|
||||
class HybridVideoPlayerSourceSpec: public virtual HybridObject {
|
||||
public:
|
||||
// Constructor
|
||||
explicit HybridVideoPlayerSourceSpec(): HybridObject(TAG) { }
|
||||
|
||||
// Destructor
|
||||
~HybridVideoPlayerSourceSpec() override = default;
|
||||
|
||||
public:
|
||||
// Properties
|
||||
virtual std::string getUri() = 0;
|
||||
virtual NativeVideoConfig getConfig() = 0;
|
||||
|
||||
public:
|
||||
// Methods
|
||||
virtual std::shared_ptr<Promise<VideoInformation>> getAssetInformationAsync() = 0;
|
||||
|
||||
protected:
|
||||
// Hybrid Setup
|
||||
void loadHybridMethods() override;
|
||||
|
||||
protected:
|
||||
// Tag for logging
|
||||
static constexpr auto TAG = "VideoPlayerSource";
|
||||
};
|
||||
|
||||
} // namespace margelo::nitro::video
|
||||
Reference in New Issue
Block a user