From 1d97a828dba20659bc36fd6431775bdbd53daaab Mon Sep 17 00:00:00 2001 From: Aakash N S Date: Wed, 25 May 2016 16:24:28 +0530 Subject: [PATCH] Added and linked react-native-video --- android/app/build.gradle | 1 + .../java/com/reactmusic/MainActivity.java | 4 ++- android/app/src/main/res/values/strings.xml | 1 + android/settings.gradle | 2 ++ ios/ReactMusic.xcodeproj/project.pbxproj | 36 +++++++++++++------ package.json | 3 +- 6 files changed, 35 insertions(+), 12 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index 8c6ed26..bb0a12f 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -120,6 +120,7 @@ android { } dependencies { + compile project(':react-native-video') compile fileTree(dir: "libs", include: ["*.jar"]) compile "com.android.support:appcompat-v7:23.0.1" compile "com.facebook.react:react-native:+" // From node_modules diff --git a/android/app/src/main/java/com/reactmusic/MainActivity.java b/android/app/src/main/java/com/reactmusic/MainActivity.java index a608fd6..5b4de15 100644 --- a/android/app/src/main/java/com/reactmusic/MainActivity.java +++ b/android/app/src/main/java/com/reactmusic/MainActivity.java @@ -1,6 +1,7 @@ package com.reactmusic; import com.facebook.react.ReactActivity; +import com.brentvatne.RCTVideo.ReactVideoPackage; import com.facebook.react.ReactPackage; import com.facebook.react.shell.MainReactPackage; @@ -34,7 +35,8 @@ protected boolean getUseDeveloperSupport() { @Override protected List getPackages() { return Arrays.asList( - new MainReactPackage() + new MainReactPackage(), + new ReactVideoPackage() ); } } diff --git a/android/app/src/main/res/values/strings.xml b/android/app/src/main/res/values/strings.xml index c29bf58..198699a 100644 --- a/android/app/src/main/res/values/strings.xml +++ b/android/app/src/main/res/values/strings.xml @@ -1,3 +1,4 @@ + ReactMusic diff --git a/android/settings.gradle b/android/settings.gradle index 21532d4..09990f0 100644 --- a/android/settings.gradle +++ b/android/settings.gradle @@ -1,3 +1,5 @@ rootProject.name = 'ReactMusic' include ':app' +include ':react-native-video' +project(':react-native-video').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-video/android') diff --git a/ios/ReactMusic.xcodeproj/project.pbxproj b/ios/ReactMusic.xcodeproj/project.pbxproj index 16df3d9..e340297 100644 --- a/ios/ReactMusic.xcodeproj/project.pbxproj +++ b/ios/ReactMusic.xcodeproj/project.pbxproj @@ -5,7 +5,6 @@ }; objectVersion = 46; objects = { - /* Begin PBXBuildFile section */ 00C302E51ABCBA2D00DB3ED1 /* libRCTActionSheet.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */; }; 00C302E71ABCBA2D00DB3ED1 /* libRCTGeolocation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */; }; @@ -22,6 +21,7 @@ 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; }; 146834051AC3E58100842450 /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 146834041AC3E56700842450 /* libReact.a */; }; 832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 832341B51AAA6A8300B99B32 /* libRCTText.a */; }; + 5B96902264E84FEE9634411D /* libRCTVideo.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 50029CF32CE047AA97FF5565 /* libRCTVideo.a */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -126,6 +126,8 @@ 146833FF1AC3E56700842450 /* React.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = React.xcodeproj; path = ../node_modules/react-native/React/React.xcodeproj; sourceTree = ""; }; 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTLinking.xcodeproj; path = ../node_modules/react-native/Libraries/LinkingIOS/RCTLinking.xcodeproj; sourceTree = ""; }; 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTText.xcodeproj; path = ../node_modules/react-native/Libraries/Text/RCTText.xcodeproj; sourceTree = ""; }; + E434F4584E1E408BBC374C5F /* RCTVideo.xcodeproj */ = {isa = PBXFileReference; name = "RCTVideo.xcodeproj"; path = "../node_modules/react-native-video/RCTVideo.xcodeproj"; sourceTree = ""; fileEncoding = undefined; lastKnownFileType = wrapper.pb-project; explicitFileType = undefined; includeInIndex = 0; }; + 50029CF32CE047AA97FF5565 /* libRCTVideo.a */ = {isa = PBXFileReference; name = "libRCTVideo.a"; path = "libRCTVideo.a"; sourceTree = ""; fileEncoding = undefined; lastKnownFileType = archive.ar; explicitFileType = undefined; includeInIndex = 0; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -150,6 +152,7 @@ 832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */, 00C302EA1ABCBA2D00DB3ED1 /* libRCTVibration.a in Frameworks */, 139FDEF61B0652A700C62182 /* libRCTWebSocket.a in Frameworks */, + 5B96902264E84FEE9634411D /* libRCTVideo.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -272,6 +275,7 @@ 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */, 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */, 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */, + E434F4584E1E408BBC374C5F /* RCTVideo.xcodeproj */, ); name = Libraries; sourceTree = ""; @@ -350,7 +354,7 @@ 83CBB9F71A601CBA00E9B192 /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0610; + LastUpgradeCheck = 610; ORGANIZATIONNAME = Facebook; TargetAttributes = { 00E356ED1AD99517003FC87E = { @@ -584,6 +588,10 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_NAME = "$(TARGET_NAME)"; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ReactMusic.app/ReactMusic"; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "\"$(SRCROOT)/$(TARGET_NAME)\"", + ); }; name = Debug; }; @@ -597,6 +605,10 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_NAME = "$(TARGET_NAME)"; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ReactMusic.app/ReactMusic"; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "\"$(SRCROOT)/$(TARGET_NAME)\"", + ); }; name = Release; }; @@ -609,13 +621,14 @@ "$(inherited)", /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, "$(SRCROOT)/../node_modules/react-native/React/**", + "$(SRCROOT)/../node_modules/react-native-video", ); INFOPLIST_FILE = "ReactMusic/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - OTHER_LDFLAGS = ( - "-ObjC", - "-lc++", - ); + OTHER_LDFLAGS = ( + "-ObjC", + "-lc++", + ); PRODUCT_NAME = ReactMusic; }; name = Debug; @@ -628,13 +641,14 @@ "$(inherited)", /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, "$(SRCROOT)/../node_modules/react-native/React/**", + "$(SRCROOT)/../node_modules/react-native-video", ); INFOPLIST_FILE = "ReactMusic/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - OTHER_LDFLAGS = ( - "-ObjC", - "-lc++", - ); + OTHER_LDFLAGS = ( + "-ObjC", + "-lc++", + ); PRODUCT_NAME = ReactMusic; }; name = Release; @@ -677,6 +691,7 @@ "$(inherited)", /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, "$(SRCROOT)/../node_modules/react-native/React/**", + "$(SRCROOT)/../node_modules/react-native-video", ); IPHONEOS_DEPLOYMENT_TARGET = 7.0; MTL_ENABLE_DEBUG_INFO = YES; @@ -717,6 +732,7 @@ "$(inherited)", /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, "$(SRCROOT)/../node_modules/react-native/React/**", + "$(SRCROOT)/../node_modules/react-native-video", ); IPHONEOS_DEPLOYMENT_TARGET = 7.0; MTL_ENABLE_DEBUG_INFO = NO; diff --git a/package.json b/package.json index bf6b2ac..3e44228 100644 --- a/package.json +++ b/package.json @@ -8,6 +8,7 @@ "dependencies": { "react": "^15.0.2", "react-native": "^0.26.1", - "react-native-slider": "^0.7.1" + "react-native-slider": "^0.7.1", + "react-native-video": "^0.8.0-rc" } }