Skip to content

Commit

Permalink
c-api-foundation
Browse files Browse the repository at this point in the history
Signed-off-by: leehom <[email protected]>
  • Loading branch information
leehom-liulihong committed Mar 28, 2024
1 parent 474b51a commit 8d84aa2
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 3 deletions.
Binary file modified harmony/rn_video.har
Binary file not shown.
4 changes: 2 additions & 2 deletions harmony/rn_video/oh-package.json5
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
"types": "",
"devDependencies": {},
"name": "rnoh-video",
"description": "",
"description": "c-api-foundation",
"main": "index.ets",
"version": "5.2.1-0.2.2",
"version": "5.2.1-0.2.0",
"dependencies": {
"rnoh": "file:../rnoh"
}
Expand Down
17 changes: 17 additions & 0 deletions harmony/rn_video/src/main/cpp/RNCVideoPackage.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,33 @@
#include "RNCVideoViewJSIBinder.h"
#include "RNCVideoViewNapiBinder.h"
#include "RNCVideoEventEmitRequestHandler.h"
#include "RNOH/ArkTSComponentInstance.h"

using namespace rnoh;
using namespace facebook;

class RNCVideoComponentInstanceFactoryDelegate : public ComponentInstanceFactoryDelegate {
public:
using ComponentInstanceFactoryDelegate::ComponentInstanceFactoryDelegate;

ComponentInstance::Shared create(ComponentInstance::Context ctx) override {
if (ctx.componentName == "RNCVideo") {
return std::make_shared<ArkTSComponentInstance>(ctx);
}
return nullptr;
}
};

namespace rnoh {

class RNCVideoPackage : public Package {
public:
RNCVideoPackage(Package::Context ctx) : Package(ctx) {}

ComponentInstanceFactoryDelegate::Shared createComponentInstanceFactoryDelegate() override {
return std::make_shared<RNCVideoComponentInstanceFactoryDelegate>(m_ctx);
}

std::vector<facebook::react::ComponentDescriptorProvider> createComponentDescriptorProviders() override
{
return {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@react-native-oh-tpl/react-native-video",
"version": "5.2.1-0.2.2",
"version": "5.2.1-0.2.0",
"description": "A <Video /> element for react-native",
"harmony": {
"alias": "react-native-video"
Expand Down

0 comments on commit 8d84aa2

Please sign in to comment.