chore: rework examples (#4225)
* remove unused examples * init bare example with test app * add react-native-video * add test app suport in expo plugin * expo plugin: skip keys that are already in pod file * fix podfile * add src files * fix metro config * finalize react native test app configuration * init expo example * remove old examples * add guide for example * Add link to examples apps in docs * adopt bare example to CI tests * update CI workflows * CI build lib after node_modules install * fix examples readme * fix iOS CI * Add Example for DRM * Update examples/README.md * fix links * update examples README * sync example code * update README
This commit is contained in:
parent
7c7d83b6e5
commit
9eb5502076
44
.github/workflows/build-android.yml
vendored
44
.github/workflows/build-android.yml
vendored
@ -7,16 +7,16 @@ on:
|
|||||||
paths:
|
paths:
|
||||||
- '.github/workflows/build-android.yml'
|
- '.github/workflows/build-android.yml'
|
||||||
- 'android/**'
|
- 'android/**'
|
||||||
- 'examples/basic/android/**'
|
- 'examples/bare/android/**'
|
||||||
- 'yarn.lock'
|
- 'yarn.lock'
|
||||||
- 'examples/basic/yarn.lock'
|
- 'examples/bare/yarn.lock'
|
||||||
pull_request:
|
pull_request:
|
||||||
paths:
|
paths:
|
||||||
- '.github/workflows/build-android.yml'
|
- '.github/workflows/build-android.yml'
|
||||||
- 'android/**'
|
- 'android/**'
|
||||||
- 'examples/basic/android/**'
|
- 'examples/bare/android/**'
|
||||||
- 'yarn.lock'
|
- 'yarn.lock'
|
||||||
- 'examples/basic/yarn.lock'
|
- 'examples/bare/yarn.lock'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
@ -32,10 +32,18 @@ jobs:
|
|||||||
java-version: 17
|
java-version: 17
|
||||||
java-package: jdk
|
java-package: jdk
|
||||||
|
|
||||||
- name: Install node_modules
|
- name: Install node_modules at Root
|
||||||
uses: ./.github/actions/setup-node
|
uses: ./.github/actions/setup-node
|
||||||
with:
|
with:
|
||||||
working-directory: examples/basic
|
working-directory: ./
|
||||||
|
|
||||||
|
- name: Build Library
|
||||||
|
run: yarn build
|
||||||
|
|
||||||
|
- name: Install node_modules at Example
|
||||||
|
uses: ./.github/actions/setup-node
|
||||||
|
with:
|
||||||
|
working-directory: examples/bare
|
||||||
|
|
||||||
- name: Restore Gradle cache
|
- name: Restore Gradle cache
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v3
|
||||||
@ -46,11 +54,11 @@ jobs:
|
|||||||
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
|
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-gradle-
|
${{ runner.os }}-gradle-
|
||||||
- name: Run Gradle Build for basic example
|
- name: Run Gradle Build for bare example
|
||||||
run: cd examples/basic/android && ./gradlew assembleDebug --build-cache && cd ../../..
|
run: cd examples/bare/android && ./gradlew assembleDebug --build-cache && cd ../../..
|
||||||
|
|
||||||
build-without-ads:
|
build-with-ads:
|
||||||
name: Build Android Example App Without Ads
|
name: Build Android Example App With Ads
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
@ -62,10 +70,18 @@ jobs:
|
|||||||
java-version: 17
|
java-version: 17
|
||||||
java-package: jdk
|
java-package: jdk
|
||||||
|
|
||||||
- name: Install node_modules
|
- name: Install node_modules at Root
|
||||||
uses: ./.github/actions/setup-node
|
uses: ./.github/actions/setup-node
|
||||||
with:
|
with:
|
||||||
working-directory: examples/basic
|
working-directory: ./
|
||||||
|
|
||||||
|
- name: Build Library
|
||||||
|
run: yarn build
|
||||||
|
|
||||||
|
- name: Install node_modules at Example
|
||||||
|
uses: ./.github/actions/setup-node
|
||||||
|
with:
|
||||||
|
working-directory: examples/bare
|
||||||
|
|
||||||
- name: Restore Gradle cache
|
- name: Restore Gradle cache
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v3
|
||||||
@ -76,5 +92,5 @@ jobs:
|
|||||||
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
|
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-gradle-
|
${{ runner.os }}-gradle-
|
||||||
- name: Run Gradle Build for basic example
|
- name: Run Gradle Build for bare example
|
||||||
run: cd examples/basic/android && export RNV_SAMPLE_ENABLE_ADS=false && ./gradlew assembleDebug --build-cache && cd ../../..
|
run: cd examples/bare/android && export RNV_SAMPLE_ENABLE_ADS=true && ./gradlew assembleDebug --build-cache && cd ../../..
|
||||||
|
91
.github/workflows/build-ios.yml
vendored
91
.github/workflows/build-ios.yml
vendored
@ -9,28 +9,37 @@ on:
|
|||||||
- '.github/workflows/build-ios.yml'
|
- '.github/workflows/build-ios.yml'
|
||||||
- 'ios/**'
|
- 'ios/**'
|
||||||
- '*.podspec'
|
- '*.podspec'
|
||||||
- 'examples/basic/ios/**'
|
- 'examples/bare/ios/**'
|
||||||
pull_request:
|
pull_request:
|
||||||
paths:
|
paths:
|
||||||
- '.github/workflows/build-ios.yml'
|
- '.github/workflows/build-ios.yml'
|
||||||
- 'ios/**'
|
- 'ios/**'
|
||||||
- '*.podspec'
|
- '*.podspec'
|
||||||
- 'examples/basic/ios/**'
|
- 'examples/bare/ios/**'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
name: Build iOS Example App
|
name: Build iOS Example App
|
||||||
runs-on: macos-14 # This allow us to use Xcode 15.0.1 which is a lot faster - TODO change to "macos-latest" once it's out of beta
|
runs-on: macos-latest
|
||||||
defaults:
|
defaults:
|
||||||
run:
|
run:
|
||||||
working-directory: examples/basic/ios
|
working-directory: examples/bare/ios
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Install node_modules
|
- name: Install node_modules at Root
|
||||||
uses: ./.github/actions/setup-node
|
uses: ./.github/actions/setup-node
|
||||||
with:
|
with:
|
||||||
working-directory: examples/basic
|
working-directory: ./
|
||||||
|
|
||||||
|
- name: Build Library
|
||||||
|
working-directory: ./
|
||||||
|
run: yarn build
|
||||||
|
|
||||||
|
- name: Install node_modules at Example
|
||||||
|
uses: ./.github/actions/setup-node
|
||||||
|
with:
|
||||||
|
working-directory: examples/bare
|
||||||
|
|
||||||
- name: Restore buildcache
|
- name: Restore buildcache
|
||||||
uses: mikehardy/buildcache-action@v2
|
uses: mikehardy/buildcache-action@v2
|
||||||
@ -46,21 +55,27 @@ jobs:
|
|||||||
uses: actions/cache@v3
|
uses: actions/cache@v3
|
||||||
with:
|
with:
|
||||||
path: |
|
path: |
|
||||||
examples/basic/ios/Pods
|
examples/bare/ios/Pods
|
||||||
~/Library/Caches/CocoaPods
|
~/Library/Caches/CocoaPods
|
||||||
~/.cocoapods
|
~/.cocoapods
|
||||||
key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }}
|
key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-pods-
|
${{ runner.os }}-pods-
|
||||||
|
|
||||||
|
- name: Generate Native Project
|
||||||
|
run: pod install
|
||||||
|
|
||||||
- name: Install Pods
|
- name: Install Pods
|
||||||
run: pod install
|
run: pod install
|
||||||
|
|
||||||
- name: Install xcpretty
|
- name: Install xcpretty
|
||||||
run: gem install xcpretty
|
run: gem install xcpretty
|
||||||
|
|
||||||
- name: Build App
|
- name: Build App
|
||||||
run: "set -o pipefail && xcodebuild \
|
run: "set -o pipefail && xcodebuild \
|
||||||
-derivedDataPath build -UseModernBuildSystem=YES \
|
-derivedDataPath build -UseModernBuildSystem=YES \
|
||||||
-workspace videoplayer.xcworkspace \
|
-workspace BareExample.xcworkspace \
|
||||||
-scheme videoplayer \
|
-scheme BareExample \
|
||||||
-sdk iphonesimulator \
|
-sdk iphonesimulator \
|
||||||
-configuration Debug \
|
-configuration Debug \
|
||||||
-destination 'platform=iOS Simulator,name=iPhone 14' \
|
-destination 'platform=iOS Simulator,name=iPhone 14' \
|
||||||
@ -69,17 +84,26 @@ jobs:
|
|||||||
|
|
||||||
build-with-ads:
|
build-with-ads:
|
||||||
name: Build iOS Example App With Ads
|
name: Build iOS Example App With Ads
|
||||||
runs-on: macos-14 # This allow us to use Xcode 15.0.1 which is a lot faster - TODO change to "macos-latest" once it's out of beta
|
runs-on: macos-latest
|
||||||
defaults:
|
defaults:
|
||||||
run:
|
run:
|
||||||
working-directory: examples/basic/ios
|
working-directory: examples/bare/ios
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Install node_modules
|
- name: Install node_modules at Root
|
||||||
uses: ./.github/actions/setup-node
|
uses: ./.github/actions/setup-node
|
||||||
with:
|
with:
|
||||||
working-directory: examples/basic
|
working-directory: ./
|
||||||
|
|
||||||
|
- name: Build Library
|
||||||
|
working-directory: ./
|
||||||
|
run: yarn build
|
||||||
|
|
||||||
|
- name: Install node_modules at Example
|
||||||
|
uses: ./.github/actions/setup-node
|
||||||
|
with:
|
||||||
|
working-directory: examples/bare
|
||||||
|
|
||||||
- name: Restore buildcache
|
- name: Restore buildcache
|
||||||
uses: mikehardy/buildcache-action@v2
|
uses: mikehardy/buildcache-action@v2
|
||||||
@ -95,21 +119,27 @@ jobs:
|
|||||||
uses: actions/cache@v3
|
uses: actions/cache@v3
|
||||||
with:
|
with:
|
||||||
path: |
|
path: |
|
||||||
examples/basic/ios/Pods
|
examples/bare/ios/Pods
|
||||||
~/Library/Caches/CocoaPods
|
~/Library/Caches/CocoaPods
|
||||||
~/.cocoapods
|
~/.cocoapods
|
||||||
key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }}
|
key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-pods-
|
${{ runner.os }}-pods-
|
||||||
|
|
||||||
|
- name: Generate Native Project
|
||||||
|
run: export RNV_SAMPLE_ENABLE_ADS=true && pod install
|
||||||
|
|
||||||
- name: Install Pods
|
- name: Install Pods
|
||||||
run: export RNV_SAMPLE_ENABLE_ADS=true && pod install
|
run: export RNV_SAMPLE_ENABLE_ADS=true && pod install
|
||||||
|
|
||||||
- name: Install xcpretty
|
- name: Install xcpretty
|
||||||
run: gem install xcpretty
|
run: gem install xcpretty
|
||||||
|
|
||||||
- name: Build App
|
- name: Build App
|
||||||
run: "set -o pipefail && export RNV_SAMPLE_ENABLE_ADS=true && xcodebuild \
|
run: "set -o pipefail && export RNV_SAMPLE_ENABLE_ADS=true && xcodebuild \
|
||||||
-derivedDataPath build -UseModernBuildSystem=YES \
|
-derivedDataPath build -UseModernBuildSystem=YES \
|
||||||
-workspace videoplayer.xcworkspace \
|
-workspace BareExample.xcworkspace \
|
||||||
-scheme videoplayer \
|
-scheme BareExample \
|
||||||
-sdk iphonesimulator \
|
-sdk iphonesimulator \
|
||||||
-configuration Debug \
|
-configuration Debug \
|
||||||
-destination 'platform=iOS Simulator,name=iPhone 14' \
|
-destination 'platform=iOS Simulator,name=iPhone 14' \
|
||||||
@ -118,17 +148,26 @@ jobs:
|
|||||||
|
|
||||||
build-with-caching:
|
build-with-caching:
|
||||||
name: Build iOS Example App With Caching
|
name: Build iOS Example App With Caching
|
||||||
runs-on: macos-14 # This allow us to use Xcode 15.0.1 which is a lot faster - TODO change to "macos-latest" once it's out of beta
|
runs-on: macos-latest
|
||||||
defaults:
|
defaults:
|
||||||
run:
|
run:
|
||||||
working-directory: examples/basic/ios
|
working-directory: examples/bare/ios
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Install node_modules
|
- name: Install node_modules at Root
|
||||||
uses: ./.github/actions/setup-node
|
uses: ./.github/actions/setup-node
|
||||||
with:
|
with:
|
||||||
working-directory: examples/basic
|
working-directory: ./
|
||||||
|
|
||||||
|
- name: Build Library
|
||||||
|
working-directory: ./
|
||||||
|
run: yarn build
|
||||||
|
|
||||||
|
- name: Install node_modules at Example
|
||||||
|
uses: ./.github/actions/setup-node
|
||||||
|
with:
|
||||||
|
working-directory: examples/bare
|
||||||
|
|
||||||
- name: Restore buildcache
|
- name: Restore buildcache
|
||||||
uses: mikehardy/buildcache-action@v2
|
uses: mikehardy/buildcache-action@v2
|
||||||
@ -144,21 +183,27 @@ jobs:
|
|||||||
uses: actions/cache@v3
|
uses: actions/cache@v3
|
||||||
with:
|
with:
|
||||||
path: |
|
path: |
|
||||||
examples/basic/ios/Pods
|
examples/bare/ios/Pods
|
||||||
~/Library/Caches/CocoaPods
|
~/Library/Caches/CocoaPods
|
||||||
~/.cocoapods
|
~/.cocoapods
|
||||||
key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }}
|
key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-pods-
|
${{ runner.os }}-pods-
|
||||||
|
|
||||||
|
- name: Generate Native Project
|
||||||
|
run: export RNV_SAMPLE_VIDEO_CACHING=true && pod install
|
||||||
|
|
||||||
- name: Install Pods
|
- name: Install Pods
|
||||||
run: export RNV_SAMPLE_VIDEO_CACHING=true && pod install
|
run: export RNV_SAMPLE_VIDEO_CACHING=true && pod install
|
||||||
|
|
||||||
- name: Install xcpretty
|
- name: Install xcpretty
|
||||||
run: gem install xcpretty
|
run: gem install xcpretty
|
||||||
|
|
||||||
- name: Build App
|
- name: Build App
|
||||||
run: "set -o pipefail && export RNV_SAMPLE_VIDEO_CACHING=true && xcodebuild \
|
run: "set -o pipefail && export RNV_SAMPLE_VIDEO_CACHING=true && xcodebuild \
|
||||||
-derivedDataPath build -UseModernBuildSystem=YES \
|
-derivedDataPath build -UseModernBuildSystem=YES \
|
||||||
-workspace videoplayer.xcworkspace \
|
-workspace BareExample.xcworkspace \
|
||||||
-scheme videoplayer \
|
-scheme BareExample \
|
||||||
-sdk iphonesimulator \
|
-sdk iphonesimulator \
|
||||||
-configuration Debug \
|
-configuration Debug \
|
||||||
-destination 'platform=iOS Simulator,name=iPhone 14' \
|
-destination 'platform=iOS Simulator,name=iPhone 14' \
|
||||||
|
@ -17,5 +17,10 @@
|
|||||||
"type": "separator",
|
"type": "separator",
|
||||||
"title": ""
|
"title": ""
|
||||||
},
|
},
|
||||||
|
"example_apps": {
|
||||||
|
"title": "Example Apps",
|
||||||
|
"newWindow": true,
|
||||||
|
"href": "https://github.com/TheWidlarzGroup/react-native-video/tree/master/examples"
|
||||||
|
},
|
||||||
"projects": "Useful projects"
|
"projects": "Useful projects"
|
||||||
}
|
}
|
@ -1,6 +0,0 @@
|
|||||||
|
|
||||||
[android]
|
|
||||||
target = Google Inc.:Google APIs:23
|
|
||||||
|
|
||||||
[maven_repositories]
|
|
||||||
central = https://repo1.maven.org/maven2
|
|
@ -1,2 +0,0 @@
|
|||||||
BUNDLE_PATH: "vendor/bundle"
|
|
||||||
BUNDLE_FORCE_RUBY_PLATFORM: 1
|
|
@ -1,16 +0,0 @@
|
|||||||
module.exports = {
|
|
||||||
root: true,
|
|
||||||
extends: '@react-native',
|
|
||||||
parser: '@typescript-eslint/parser',
|
|
||||||
plugins: ['@typescript-eslint'],
|
|
||||||
overrides: [
|
|
||||||
{
|
|
||||||
files: ['*.ts', '*.tsx'],
|
|
||||||
rules: {
|
|
||||||
'@typescript-eslint/no-shadow': ['error'],
|
|
||||||
'no-shadow': 'off',
|
|
||||||
'no-undef': 'off',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
};
|
|
67
examples/FabricExample/.gitignore
vendored
67
examples/FabricExample/.gitignore
vendored
@ -1,67 +0,0 @@
|
|||||||
# OSX
|
|
||||||
#
|
|
||||||
.DS_Store
|
|
||||||
|
|
||||||
# Xcode
|
|
||||||
#
|
|
||||||
build/
|
|
||||||
*.pbxuser
|
|
||||||
!default.pbxuser
|
|
||||||
*.mode1v3
|
|
||||||
!default.mode1v3
|
|
||||||
*.mode2v3
|
|
||||||
!default.mode2v3
|
|
||||||
*.perspectivev3
|
|
||||||
!default.perspectivev3
|
|
||||||
xcuserdata
|
|
||||||
*.xccheckout
|
|
||||||
*.moved-aside
|
|
||||||
DerivedData
|
|
||||||
*.hmap
|
|
||||||
*.ipa
|
|
||||||
*.xcuserstate
|
|
||||||
ios/.xcode.env.local
|
|
||||||
|
|
||||||
# Android/IntelliJ
|
|
||||||
#
|
|
||||||
build/
|
|
||||||
.idea
|
|
||||||
.gradle
|
|
||||||
local.properties
|
|
||||||
*.iml
|
|
||||||
*.hprof
|
|
||||||
.cxx/
|
|
||||||
|
|
||||||
# node.js
|
|
||||||
#
|
|
||||||
node_modules/
|
|
||||||
npm-debug.log
|
|
||||||
yarn-error.log
|
|
||||||
|
|
||||||
# BUCK
|
|
||||||
buck-out/
|
|
||||||
\.buckd/
|
|
||||||
*.keystore
|
|
||||||
!debug.keystore
|
|
||||||
|
|
||||||
# fastlane
|
|
||||||
#
|
|
||||||
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
|
|
||||||
# screenshots whenever they are needed.
|
|
||||||
# For more information about the recommended setup visit:
|
|
||||||
# https://docs.fastlane.tools/best-practices/source-control/
|
|
||||||
|
|
||||||
**/fastlane/report.xml
|
|
||||||
**/fastlane/Preview.html
|
|
||||||
**/fastlane/screenshots
|
|
||||||
**/fastlane/test_output
|
|
||||||
|
|
||||||
# Bundle artifact
|
|
||||||
*.jsbundle
|
|
||||||
|
|
||||||
# Ruby / CocoaPods
|
|
||||||
/ios/Pods/
|
|
||||||
/vendor/bundle/
|
|
||||||
|
|
||||||
# testing
|
|
||||||
/coverage
|
|
@ -1,7 +0,0 @@
|
|||||||
module.exports = {
|
|
||||||
arrowParens: 'avoid',
|
|
||||||
bracketSameLine: true,
|
|
||||||
bracketSpacing: false,
|
|
||||||
singleQuote: true,
|
|
||||||
trailingComma: 'all',
|
|
||||||
};
|
|
@ -1 +0,0 @@
|
|||||||
2.7.5
|
|
@ -1 +0,0 @@
|
|||||||
{}
|
|
@ -1,19 +0,0 @@
|
|||||||
/**
|
|
||||||
* Sample React Native App
|
|
||||||
* https://github.com/facebook/react-native
|
|
||||||
*
|
|
||||||
* Generated with the TypeScript template
|
|
||||||
* https://github.com/react-native-community/react-native-template-typescript
|
|
||||||
*
|
|
||||||
* @format
|
|
||||||
*/
|
|
||||||
|
|
||||||
import React, {type PropsWithChildren} from 'react';
|
|
||||||
import {StyleSheet, View} from 'react-native';
|
|
||||||
import VideoPlayer from './src/VideoPlayer';
|
|
||||||
|
|
||||||
const App = () => {
|
|
||||||
return <VideoPlayer />;
|
|
||||||
};
|
|
||||||
|
|
||||||
export default App;
|
|
@ -1,7 +0,0 @@
|
|||||||
source 'https://rubygems.org'
|
|
||||||
|
|
||||||
# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
|
|
||||||
ruby ">= 2.6.10"
|
|
||||||
|
|
||||||
gem 'cocoapods', '~> 1.13'
|
|
||||||
gem 'activesupport', '>= 6.1.7.3', '< 7.1.0'
|
|
@ -1,107 +0,0 @@
|
|||||||
GEM
|
|
||||||
remote: https://rubygems.org/
|
|
||||||
specs:
|
|
||||||
CFPropertyList (3.0.7)
|
|
||||||
base64
|
|
||||||
nkf
|
|
||||||
rexml
|
|
||||||
activesupport (6.1.7.8)
|
|
||||||
concurrent-ruby (~> 1.0, >= 1.0.2)
|
|
||||||
i18n (>= 1.6, < 2)
|
|
||||||
minitest (>= 5.1)
|
|
||||||
tzinfo (~> 2.0)
|
|
||||||
zeitwerk (~> 2.3)
|
|
||||||
addressable (2.8.7)
|
|
||||||
public_suffix (>= 2.0.2, < 7.0)
|
|
||||||
algoliasearch (1.27.5)
|
|
||||||
httpclient (~> 2.8, >= 2.8.3)
|
|
||||||
json (>= 1.5.1)
|
|
||||||
atomos (0.1.3)
|
|
||||||
base64 (0.2.0)
|
|
||||||
claide (1.1.0)
|
|
||||||
cocoapods (1.15.2)
|
|
||||||
addressable (~> 2.8)
|
|
||||||
claide (>= 1.0.2, < 2.0)
|
|
||||||
cocoapods-core (= 1.15.2)
|
|
||||||
cocoapods-deintegrate (>= 1.0.3, < 2.0)
|
|
||||||
cocoapods-downloader (>= 2.1, < 3.0)
|
|
||||||
cocoapods-plugins (>= 1.0.0, < 2.0)
|
|
||||||
cocoapods-search (>= 1.0.0, < 2.0)
|
|
||||||
cocoapods-trunk (>= 1.6.0, < 2.0)
|
|
||||||
cocoapods-try (>= 1.1.0, < 2.0)
|
|
||||||
colored2 (~> 3.1)
|
|
||||||
escape (~> 0.0.4)
|
|
||||||
fourflusher (>= 2.3.0, < 3.0)
|
|
||||||
gh_inspector (~> 1.0)
|
|
||||||
molinillo (~> 0.8.0)
|
|
||||||
nap (~> 1.0)
|
|
||||||
ruby-macho (>= 2.3.0, < 3.0)
|
|
||||||
xcodeproj (>= 1.23.0, < 2.0)
|
|
||||||
cocoapods-core (1.15.2)
|
|
||||||
activesupport (>= 5.0, < 8)
|
|
||||||
addressable (~> 2.8)
|
|
||||||
algoliasearch (~> 1.0)
|
|
||||||
concurrent-ruby (~> 1.1)
|
|
||||||
fuzzy_match (~> 2.0.4)
|
|
||||||
nap (~> 1.0)
|
|
||||||
netrc (~> 0.11)
|
|
||||||
public_suffix (~> 4.0)
|
|
||||||
typhoeus (~> 1.0)
|
|
||||||
cocoapods-deintegrate (1.0.5)
|
|
||||||
cocoapods-downloader (2.1)
|
|
||||||
cocoapods-plugins (1.0.0)
|
|
||||||
nap
|
|
||||||
cocoapods-search (1.0.1)
|
|
||||||
cocoapods-trunk (1.6.0)
|
|
||||||
nap (>= 0.8, < 2.0)
|
|
||||||
netrc (~> 0.11)
|
|
||||||
cocoapods-try (1.2.0)
|
|
||||||
colored2 (3.1.2)
|
|
||||||
concurrent-ruby (1.2.2)
|
|
||||||
escape (0.0.4)
|
|
||||||
ethon (0.16.0)
|
|
||||||
ffi (>= 1.15.0)
|
|
||||||
ffi (1.17.0)
|
|
||||||
fourflusher (2.3.1)
|
|
||||||
fuzzy_match (2.0.4)
|
|
||||||
gh_inspector (1.1.3)
|
|
||||||
httpclient (2.8.3)
|
|
||||||
i18n (1.12.0)
|
|
||||||
concurrent-ruby (~> 1.0)
|
|
||||||
json (2.7.2)
|
|
||||||
minitest (5.18.0)
|
|
||||||
molinillo (0.8.0)
|
|
||||||
nanaimo (0.3.0)
|
|
||||||
nap (1.1.0)
|
|
||||||
netrc (0.11.0)
|
|
||||||
nkf (0.2.0)
|
|
||||||
public_suffix (4.0.7)
|
|
||||||
rexml (3.2.9)
|
|
||||||
strscan
|
|
||||||
ruby-macho (2.5.1)
|
|
||||||
strscan (3.1.0)
|
|
||||||
typhoeus (1.4.1)
|
|
||||||
ethon (>= 0.9.0)
|
|
||||||
tzinfo (2.0.6)
|
|
||||||
concurrent-ruby (~> 1.0)
|
|
||||||
xcodeproj (1.24.0)
|
|
||||||
CFPropertyList (>= 2.3.3, < 4.0)
|
|
||||||
atomos (~> 0.1.3)
|
|
||||||
claide (>= 1.0.2, < 2.0)
|
|
||||||
colored2 (~> 3.1)
|
|
||||||
nanaimo (~> 0.3.0)
|
|
||||||
rexml (~> 3.2.4)
|
|
||||||
zeitwerk (2.6.16)
|
|
||||||
|
|
||||||
PLATFORMS
|
|
||||||
ruby
|
|
||||||
|
|
||||||
DEPENDENCIES
|
|
||||||
activesupport (>= 6.1.7.3, < 7.1.0)
|
|
||||||
cocoapods (~> 1.13)
|
|
||||||
|
|
||||||
RUBY VERSION
|
|
||||||
ruby 2.7.5p203
|
|
||||||
|
|
||||||
BUNDLED WITH
|
|
||||||
2.4.5
|
|
@ -1,17 +0,0 @@
|
|||||||
/**
|
|
||||||
* @format
|
|
||||||
*/
|
|
||||||
|
|
||||||
import 'react-native';
|
|
||||||
import React from 'react';
|
|
||||||
import App from '../App';
|
|
||||||
|
|
||||||
// Note: import explicitly to use the types shipped with jest.
|
|
||||||
import {it} from '@jest/globals';
|
|
||||||
|
|
||||||
// Note: test renderer must be required after react-native.
|
|
||||||
import renderer from 'react-test-renderer';
|
|
||||||
|
|
||||||
it('renders correctly', () => {
|
|
||||||
renderer.create(<App />);
|
|
||||||
});
|
|
@ -1,55 +0,0 @@
|
|||||||
# To learn about Buck see [Docs](https://buckbuild.com/).
|
|
||||||
# To run your application with Buck:
|
|
||||||
# - install Buck
|
|
||||||
# - `npm start` - to start the packager
|
|
||||||
# - `cd android`
|
|
||||||
# - `keytool -genkey -v -keystore keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname "CN=Android Debug,O=Android,C=US"`
|
|
||||||
# - `./gradlew :app:copyDownloadableDepsToLibs` - make all Gradle compile dependencies available to Buck
|
|
||||||
# - `buck install -r android/app` - compile, install and run application
|
|
||||||
#
|
|
||||||
|
|
||||||
load(":build_defs.bzl", "create_aar_targets", "create_jar_targets")
|
|
||||||
|
|
||||||
lib_deps = []
|
|
||||||
|
|
||||||
create_aar_targets(glob(["libs/*.aar"]))
|
|
||||||
|
|
||||||
create_jar_targets(glob(["libs/*.jar"]))
|
|
||||||
|
|
||||||
android_library(
|
|
||||||
name = "all-libs",
|
|
||||||
exported_deps = lib_deps,
|
|
||||||
)
|
|
||||||
|
|
||||||
android_library(
|
|
||||||
name = "app-code",
|
|
||||||
srcs = glob([
|
|
||||||
"src/main/java/**/*.java",
|
|
||||||
]),
|
|
||||||
deps = [
|
|
||||||
":all-libs",
|
|
||||||
":build_config",
|
|
||||||
":res",
|
|
||||||
],
|
|
||||||
)
|
|
||||||
|
|
||||||
android_build_config(
|
|
||||||
name = "build_config",
|
|
||||||
package = "net.video.fabricexample",
|
|
||||||
)
|
|
||||||
|
|
||||||
android_resource(
|
|
||||||
name = "res",
|
|
||||||
package = "net.video.fabricexample",
|
|
||||||
res = "src/main/res",
|
|
||||||
)
|
|
||||||
|
|
||||||
android_binary(
|
|
||||||
name = "app",
|
|
||||||
keystore = "//android/keystores:debug",
|
|
||||||
manifest = "src/main/AndroidManifest.xml",
|
|
||||||
package_type = "debug",
|
|
||||||
deps = [
|
|
||||||
":app-code",
|
|
||||||
],
|
|
||||||
)
|
|
@ -1,123 +0,0 @@
|
|||||||
apply plugin: "com.android.application"
|
|
||||||
apply plugin: "org.jetbrains.kotlin.android"
|
|
||||||
apply plugin: "com.facebook.react"
|
|
||||||
|
|
||||||
import com.android.build.OutputFile
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This is the configuration block to customize your React Native Android app.
|
|
||||||
* By default you don't need to apply any configuration, just uncomment the lines you need.
|
|
||||||
*/
|
|
||||||
react {
|
|
||||||
/* Folders */
|
|
||||||
// The root of your project, i.e. where "package.json" lives. Default is '..'
|
|
||||||
// root = file("../")
|
|
||||||
// The folder where the react-native NPM package is. Default is ../node_modules/react-native
|
|
||||||
// reactNativeDir = file("../node-modules/react-native")
|
|
||||||
// The folder where the react-native Codegen package is. Default is ../node_modules/@react-native/codegen
|
|
||||||
// codegenDir = file("../node_modules/@react-native/codegen")
|
|
||||||
// The cli.js file which is the React Native CLI entrypoint. Default is ../node_modules/react-native/cli.js
|
|
||||||
// cliFile = file("../node_modules/react-native/cli.js")
|
|
||||||
|
|
||||||
/* Variants */
|
|
||||||
// The list of variants to that are debuggable. For those we're going to
|
|
||||||
// skip the bundling of the JS bundle and the assets. By default is just 'debug'.
|
|
||||||
// If you add flavors like lite, prod, etc. you'll have to list your debuggableVariants.
|
|
||||||
// debuggableVariants = ["liteDebug", "prodDebug"]
|
|
||||||
|
|
||||||
/* Bundling */
|
|
||||||
// A list containing the node command and its flags. Default is just 'node'.
|
|
||||||
// nodeExecutableAndArgs = ["node"]
|
|
||||||
//
|
|
||||||
// The command to run when bundling. By default is 'bundle'
|
|
||||||
// bundleCommand = "ram-bundle"
|
|
||||||
//
|
|
||||||
// The path to the CLI configuration file. Default is empty.
|
|
||||||
// bundleConfig = file(../rn-cli.config.js)
|
|
||||||
//
|
|
||||||
// The name of the generated asset file containing your JS bundle
|
|
||||||
// bundleAssetName = "MyApplication.android.bundle"
|
|
||||||
//
|
|
||||||
// The entry file for bundle generation. Default is 'index.android.js' or 'index.js'
|
|
||||||
// entryFile = file("../js/MyApplication.android.js")
|
|
||||||
//
|
|
||||||
// A list of extra flags to pass to the 'bundle' commands.
|
|
||||||
// See https://github.com/react-native-community/cli/blob/main/docs/commands.md#bundle
|
|
||||||
// extraPackagerArgs = []
|
|
||||||
|
|
||||||
/* Hermes Commands */
|
|
||||||
// The hermes compiler command to run. By default it is 'hermesc'
|
|
||||||
// hermesCommand = "$rootDir/my-custom-hermesc/bin/hermesc"
|
|
||||||
//
|
|
||||||
// The list of flags to pass to the Hermes compiler. By default is "-O", "-output-source-map"
|
|
||||||
// hermesFlags = ["-O", "-output-source-map"]
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Set this to true to Run Proguard on Release builds to minify the Java bytecode.
|
|
||||||
*/
|
|
||||||
def enableProguardInReleaseBuilds = false
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The preferred build flavor of JavaScriptCore (JSC)
|
|
||||||
*
|
|
||||||
* For example, to use the international variant, you can use:
|
|
||||||
* `def jscFlavor = 'org.webkit:android-jsc-intl:+'`
|
|
||||||
*
|
|
||||||
* The international variant includes ICU i18n library and necessary data
|
|
||||||
* allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that
|
|
||||||
* give correct results when using with locales other than en-US. Note that
|
|
||||||
* this variant is about 6MiB larger per architecture than default.
|
|
||||||
*/
|
|
||||||
def jscFlavor = 'org.webkit:android-jsc:+'
|
|
||||||
|
|
||||||
android {
|
|
||||||
ndkVersion rootProject.ext.ndkVersion
|
|
||||||
|
|
||||||
buildToolsVersion rootProject.ext.buildToolsVersion
|
|
||||||
compileSdk rootProject.ext.compileSdkVersion
|
|
||||||
|
|
||||||
namespace "net.video.fabricexample"
|
|
||||||
defaultConfig {
|
|
||||||
applicationId "net.video.fabricexample"
|
|
||||||
minSdkVersion rootProject.ext.minSdkVersion
|
|
||||||
targetSdkVersion rootProject.ext.targetSdkVersion
|
|
||||||
versionCode 1
|
|
||||||
versionName "1.0"
|
|
||||||
}
|
|
||||||
|
|
||||||
signingConfigs {
|
|
||||||
debug {
|
|
||||||
storeFile file('debug.keystore')
|
|
||||||
storePassword 'android'
|
|
||||||
keyAlias 'androiddebugkey'
|
|
||||||
keyPassword 'android'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
buildTypes {
|
|
||||||
debug {
|
|
||||||
signingConfig signingConfigs.debug
|
|
||||||
}
|
|
||||||
release {
|
|
||||||
// Caution! In production, you need to generate your own keystore file.
|
|
||||||
// see https://reactnative.dev/docs/signed-apk-android.
|
|
||||||
signingConfig signingConfigs.debug
|
|
||||||
minifyEnabled enableProguardInReleaseBuilds
|
|
||||||
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
dependencies {
|
|
||||||
// The version of react-native is set by the React Native Gradle Plugin
|
|
||||||
implementation("com.facebook.react:react-android")
|
|
||||||
implementation("com.facebook.react:flipper-integration")
|
|
||||||
|
|
||||||
if (hermesEnabled.toBoolean()) {
|
|
||||||
implementation("com.facebook.react:hermes-android")
|
|
||||||
} else {
|
|
||||||
implementation jscFlavor
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)
|
|
@ -1,19 +0,0 @@
|
|||||||
"""Helper definitions to glob .aar and .jar targets"""
|
|
||||||
|
|
||||||
def create_aar_targets(aarfiles):
|
|
||||||
for aarfile in aarfiles:
|
|
||||||
name = "aars__" + aarfile[aarfile.rindex("/") + 1:aarfile.rindex(".aar")]
|
|
||||||
lib_deps.append(":" + name)
|
|
||||||
android_prebuilt_aar(
|
|
||||||
name = name,
|
|
||||||
aar = aarfile,
|
|
||||||
)
|
|
||||||
|
|
||||||
def create_jar_targets(jarfiles):
|
|
||||||
for jarfile in jarfiles:
|
|
||||||
name = "jars__" + jarfile[jarfile.rindex("/") + 1:jarfile.rindex(".jar")]
|
|
||||||
lib_deps.append(":" + name)
|
|
||||||
prebuilt_jar(
|
|
||||||
name = name,
|
|
||||||
binary_jar = jarfile,
|
|
||||||
)
|
|
@ -1,10 +0,0 @@
|
|||||||
# Add project specific ProGuard rules here.
|
|
||||||
# By default, the flags in this file are appended to flags specified
|
|
||||||
# in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt
|
|
||||||
# You can edit the include path and order by changing the proguardFiles
|
|
||||||
# directive in build.gradle.
|
|
||||||
#
|
|
||||||
# For more details, see
|
|
||||||
# http://developer.android.com/guide/developing/tools/proguard.html
|
|
||||||
|
|
||||||
# Add any project specific keep options here:
|
|
@ -1,26 +0,0 @@
|
|||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
package="net.video.fabricexample">
|
|
||||||
|
|
||||||
<uses-permission android:name="android.permission.INTERNET" />
|
|
||||||
|
|
||||||
<application
|
|
||||||
android:name=".MainApplication"
|
|
||||||
android:label="@string/app_name"
|
|
||||||
android:icon="@mipmap/ic_launcher"
|
|
||||||
android:roundIcon="@mipmap/ic_launcher_round"
|
|
||||||
android:allowBackup="false"
|
|
||||||
android:theme="@style/AppTheme">
|
|
||||||
<activity
|
|
||||||
android:name=".MainActivity"
|
|
||||||
android:label="@string/app_name"
|
|
||||||
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|screenSize|smallestScreenSize|uiMode"
|
|
||||||
android:launchMode="singleTask"
|
|
||||||
android:windowSoftInputMode="adjustResize"
|
|
||||||
android:exported="true">
|
|
||||||
<intent-filter>
|
|
||||||
<action android:name="android.intent.action.MAIN" />
|
|
||||||
<category android:name="android.intent.category.LAUNCHER" />
|
|
||||||
</intent-filter>
|
|
||||||
</activity>
|
|
||||||
</application>
|
|
||||||
</manifest>
|
|
@ -1,22 +0,0 @@
|
|||||||
package net.video.fabricexample
|
|
||||||
|
|
||||||
import com.facebook.react.ReactActivity
|
|
||||||
import com.facebook.react.ReactActivityDelegate
|
|
||||||
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.fabricEnabled
|
|
||||||
import com.facebook.react.defaults.DefaultReactActivityDelegate
|
|
||||||
|
|
||||||
class MainActivity : ReactActivity() {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the name of the main component registered from JavaScript. This is used to schedule
|
|
||||||
* rendering of the component.
|
|
||||||
*/
|
|
||||||
override fun getMainComponentName(): String = "FabricExample"
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the instance of the [ReactActivityDelegate]. We use [DefaultReactActivityDelegate]
|
|
||||||
* which allows you to enable New Architecture with a single boolean flags [fabricEnabled]
|
|
||||||
*/
|
|
||||||
override fun createReactActivityDelegate(): ReactActivityDelegate =
|
|
||||||
DefaultReactActivityDelegate(this, mainComponentName, fabricEnabled)
|
|
||||||
}
|
|
@ -1,45 +0,0 @@
|
|||||||
package net.video.fabricexample
|
|
||||||
|
|
||||||
import android.app.Application
|
|
||||||
import com.facebook.react.PackageList
|
|
||||||
import com.facebook.react.ReactApplication
|
|
||||||
import com.facebook.react.ReactHost
|
|
||||||
import com.facebook.react.ReactNativeHost
|
|
||||||
import com.facebook.react.ReactPackage
|
|
||||||
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.load
|
|
||||||
import com.facebook.react.defaults.DefaultReactHost.getDefaultReactHost
|
|
||||||
import com.facebook.react.defaults.DefaultReactNativeHost
|
|
||||||
import com.facebook.react.flipper.ReactNativeFlipper
|
|
||||||
import com.facebook.soloader.SoLoader
|
|
||||||
|
|
||||||
class MainApplication : Application(), ReactApplication {
|
|
||||||
|
|
||||||
override val reactNativeHost: ReactNativeHost =
|
|
||||||
object : DefaultReactNativeHost(this) {
|
|
||||||
override fun getPackages(): List<ReactPackage> =
|
|
||||||
PackageList(this).packages.apply {
|
|
||||||
// Packages that cannot be autolinked yet can be added manually here, for example:
|
|
||||||
// add(MyReactNativePackage())
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun getJSMainModuleName(): String = "index"
|
|
||||||
|
|
||||||
override fun getUseDeveloperSupport(): Boolean = BuildConfig.DEBUG
|
|
||||||
|
|
||||||
override val isNewArchEnabled: Boolean = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED
|
|
||||||
override val isHermesEnabled: Boolean = BuildConfig.IS_HERMES_ENABLED
|
|
||||||
}
|
|
||||||
|
|
||||||
override val reactHost: ReactHost
|
|
||||||
get() = getDefaultReactHost(this.applicationContext, reactNativeHost)
|
|
||||||
|
|
||||||
override fun onCreate() {
|
|
||||||
super.onCreate()
|
|
||||||
SoLoader.init(this, false)
|
|
||||||
if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
|
|
||||||
// If you opted-in for the New Architecture, we load the native entry point for this app.
|
|
||||||
load()
|
|
||||||
}
|
|
||||||
ReactNativeFlipper.initializeFlipper(this, reactNativeHost.reactInstanceManager)
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,7 +0,0 @@
|
|||||||
cmake_minimum_required(VERSION 3.13)
|
|
||||||
|
|
||||||
# Define the library name here.
|
|
||||||
project(fabricexample_appmodules)
|
|
||||||
|
|
||||||
# This file includes all the necessary to let you build your application with the New Architecture.
|
|
||||||
include(${REACT_ANDROID_DIR}/cmake-utils/ReactNative-application.cmake)
|
|
@ -1,32 +0,0 @@
|
|||||||
#include "MainApplicationModuleProvider.h"
|
|
||||||
|
|
||||||
#include <rncli.h>
|
|
||||||
#include <rncore.h>
|
|
||||||
|
|
||||||
namespace facebook {
|
|
||||||
namespace react {
|
|
||||||
|
|
||||||
std::shared_ptr<TurboModule> MainApplicationModuleProvider(
|
|
||||||
const std::string &moduleName,
|
|
||||||
const JavaTurboModule::InitParams ¶ms) {
|
|
||||||
// Here you can provide your own module provider for TurboModules coming from
|
|
||||||
// either your application or from external libraries. The approach to follow
|
|
||||||
// is similar to the following (for a library called `samplelibrary`:
|
|
||||||
//
|
|
||||||
// auto module = samplelibrary_ModuleProvider(moduleName, params);
|
|
||||||
// if (module != nullptr) {
|
|
||||||
// return module;
|
|
||||||
// }
|
|
||||||
// return rncore_ModuleProvider(moduleName, params);
|
|
||||||
|
|
||||||
// Module providers autolinked by RN CLI
|
|
||||||
auto rncli_module = rncli_ModuleProvider(moduleName, params);
|
|
||||||
if (rncli_module != nullptr) {
|
|
||||||
return rncli_module;
|
|
||||||
}
|
|
||||||
|
|
||||||
return rncore_ModuleProvider(moduleName, params);
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace react
|
|
||||||
} // namespace facebook
|
|
@ -1,16 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
#include <memory>
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
#include <ReactCommon/JavaTurboModule.h>
|
|
||||||
|
|
||||||
namespace facebook {
|
|
||||||
namespace react {
|
|
||||||
|
|
||||||
std::shared_ptr<TurboModule> MainApplicationModuleProvider(
|
|
||||||
const std::string &moduleName,
|
|
||||||
const JavaTurboModule::InitParams ¶ms);
|
|
||||||
|
|
||||||
} // namespace react
|
|
||||||
} // namespace facebook
|
|
@ -1,45 +0,0 @@
|
|||||||
#include "MainApplicationTurboModuleManagerDelegate.h"
|
|
||||||
#include "MainApplicationModuleProvider.h"
|
|
||||||
|
|
||||||
namespace facebook {
|
|
||||||
namespace react {
|
|
||||||
|
|
||||||
jni::local_ref<MainApplicationTurboModuleManagerDelegate::jhybriddata>
|
|
||||||
MainApplicationTurboModuleManagerDelegate::initHybrid(
|
|
||||||
jni::alias_ref<jhybridobject>) {
|
|
||||||
return makeCxxInstance();
|
|
||||||
}
|
|
||||||
|
|
||||||
void MainApplicationTurboModuleManagerDelegate::registerNatives() {
|
|
||||||
registerHybrid({
|
|
||||||
makeNativeMethod(
|
|
||||||
"initHybrid", MainApplicationTurboModuleManagerDelegate::initHybrid),
|
|
||||||
makeNativeMethod(
|
|
||||||
"canCreateTurboModule",
|
|
||||||
MainApplicationTurboModuleManagerDelegate::canCreateTurboModule),
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
std::shared_ptr<TurboModule>
|
|
||||||
MainApplicationTurboModuleManagerDelegate::getTurboModule(
|
|
||||||
const std::string &name,
|
|
||||||
const std::shared_ptr<CallInvoker> &jsInvoker) {
|
|
||||||
// Not implemented yet: provide pure-C++ NativeModules here.
|
|
||||||
return nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::shared_ptr<TurboModule>
|
|
||||||
MainApplicationTurboModuleManagerDelegate::getTurboModule(
|
|
||||||
const std::string &name,
|
|
||||||
const JavaTurboModule::InitParams ¶ms) {
|
|
||||||
return MainApplicationModuleProvider(name, params);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool MainApplicationTurboModuleManagerDelegate::canCreateTurboModule(
|
|
||||||
const std::string &name) {
|
|
||||||
return getTurboModule(name, nullptr) != nullptr ||
|
|
||||||
getTurboModule(name, {.moduleName = name}) != nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace react
|
|
||||||
} // namespace facebook
|
|
@ -1,38 +0,0 @@
|
|||||||
#include <memory>
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
#include <ReactCommon/TurboModuleManagerDelegate.h>
|
|
||||||
#include <fbjni/fbjni.h>
|
|
||||||
|
|
||||||
namespace facebook {
|
|
||||||
namespace react {
|
|
||||||
|
|
||||||
class MainApplicationTurboModuleManagerDelegate
|
|
||||||
: public jni::HybridClass<
|
|
||||||
MainApplicationTurboModuleManagerDelegate,
|
|
||||||
TurboModuleManagerDelegate> {
|
|
||||||
public:
|
|
||||||
// Adapt it to the package you used for your Java class.
|
|
||||||
static constexpr auto kJavaDescriptor =
|
|
||||||
"Lnet/video/fabricexample/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate;";
|
|
||||||
|
|
||||||
static jni::local_ref<jhybriddata> initHybrid(jni::alias_ref<jhybridobject>);
|
|
||||||
|
|
||||||
static void registerNatives();
|
|
||||||
|
|
||||||
std::shared_ptr<TurboModule> getTurboModule(
|
|
||||||
const std::string &name,
|
|
||||||
const std::shared_ptr<CallInvoker> &jsInvoker) override;
|
|
||||||
std::shared_ptr<TurboModule> getTurboModule(
|
|
||||||
const std::string &name,
|
|
||||||
const JavaTurboModule::InitParams ¶ms) override;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Test-only method. Allows user to verify whether a TurboModule can be
|
|
||||||
* created by instances of this class.
|
|
||||||
*/
|
|
||||||
bool canCreateTurboModule(const std::string &name);
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace react
|
|
||||||
} // namespace facebook
|
|
@ -1,65 +0,0 @@
|
|||||||
#include "MainComponentsRegistry.h"
|
|
||||||
|
|
||||||
#include <CoreComponentsRegistry.h>
|
|
||||||
#include <fbjni/fbjni.h>
|
|
||||||
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
|
|
||||||
#include <react/renderer/components/rncore/ComponentDescriptors.h>
|
|
||||||
#include <rncli.h>
|
|
||||||
|
|
||||||
namespace facebook {
|
|
||||||
namespace react {
|
|
||||||
|
|
||||||
MainComponentsRegistry::MainComponentsRegistry(ComponentFactory *delegate) {}
|
|
||||||
|
|
||||||
std::shared_ptr<ComponentDescriptorProviderRegistry const>
|
|
||||||
MainComponentsRegistry::sharedProviderRegistry() {
|
|
||||||
auto providerRegistry = CoreComponentsRegistry::sharedProviderRegistry();
|
|
||||||
|
|
||||||
// Autolinked providers registered by RN CLI
|
|
||||||
rncli_registerProviders(providerRegistry);
|
|
||||||
|
|
||||||
// Custom Fabric Components go here. You can register custom
|
|
||||||
// components coming from your App or from 3rd party libraries here.
|
|
||||||
//
|
|
||||||
// providerRegistry->add(concreteComponentDescriptorProvider<
|
|
||||||
// AocViewerComponentDescriptor>());
|
|
||||||
return providerRegistry;
|
|
||||||
}
|
|
||||||
|
|
||||||
jni::local_ref<MainComponentsRegistry::jhybriddata>
|
|
||||||
MainComponentsRegistry::initHybrid(
|
|
||||||
jni::alias_ref<jclass>,
|
|
||||||
ComponentFactory *delegate) {
|
|
||||||
auto instance = makeCxxInstance(delegate);
|
|
||||||
|
|
||||||
auto buildRegistryFunction =
|
|
||||||
[](EventDispatcher::Weak const &eventDispatcher,
|
|
||||||
ContextContainer::Shared const &contextContainer)
|
|
||||||
-> ComponentDescriptorRegistry::Shared {
|
|
||||||
auto registry = MainComponentsRegistry::sharedProviderRegistry()
|
|
||||||
->createComponentDescriptorRegistry(
|
|
||||||
{eventDispatcher, contextContainer});
|
|
||||||
|
|
||||||
auto mutableRegistry =
|
|
||||||
std::const_pointer_cast<ComponentDescriptorRegistry>(registry);
|
|
||||||
|
|
||||||
mutableRegistry->setFallbackComponentDescriptor(
|
|
||||||
std::make_shared<UnimplementedNativeViewComponentDescriptor>(
|
|
||||||
ComponentDescriptorParameters{
|
|
||||||
eventDispatcher, contextContainer, nullptr}));
|
|
||||||
|
|
||||||
return registry;
|
|
||||||
};
|
|
||||||
|
|
||||||
delegate->buildRegistryFunction = buildRegistryFunction;
|
|
||||||
return instance;
|
|
||||||
}
|
|
||||||
|
|
||||||
void MainComponentsRegistry::registerNatives() {
|
|
||||||
registerHybrid({
|
|
||||||
makeNativeMethod("initHybrid", MainComponentsRegistry::initHybrid),
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace react
|
|
||||||
} // namespace facebook
|
|
@ -1,32 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
#include <ComponentFactory.h>
|
|
||||||
#include <fbjni/fbjni.h>
|
|
||||||
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
|
|
||||||
#include <react/renderer/componentregistry/ComponentDescriptorRegistry.h>
|
|
||||||
|
|
||||||
namespace facebook {
|
|
||||||
namespace react {
|
|
||||||
|
|
||||||
class MainComponentsRegistry
|
|
||||||
: public facebook::jni::HybridClass<MainComponentsRegistry> {
|
|
||||||
public:
|
|
||||||
// Adapt it to the package you used for your Java class.
|
|
||||||
constexpr static auto kJavaDescriptor =
|
|
||||||
"Lnet/video/fabricexample/newarchitecture/components/MainComponentsRegistry;";
|
|
||||||
|
|
||||||
static void registerNatives();
|
|
||||||
|
|
||||||
MainComponentsRegistry(ComponentFactory *delegate);
|
|
||||||
|
|
||||||
private:
|
|
||||||
static std::shared_ptr<ComponentDescriptorProviderRegistry const>
|
|
||||||
sharedProviderRegistry();
|
|
||||||
|
|
||||||
static jni::local_ref<jhybriddata> initHybrid(
|
|
||||||
jni::alias_ref<jclass>,
|
|
||||||
ComponentFactory *delegate);
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace react
|
|
||||||
} // namespace facebook
|
|
@ -1,11 +0,0 @@
|
|||||||
#include <fbjni/fbjni.h>
|
|
||||||
#include "MainApplicationTurboModuleManagerDelegate.h"
|
|
||||||
#include "MainComponentsRegistry.h"
|
|
||||||
|
|
||||||
JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *) {
|
|
||||||
return facebook::jni::initialize(vm, [] {
|
|
||||||
facebook::react::MainApplicationTurboModuleManagerDelegate::
|
|
||||||
registerNatives();
|
|
||||||
facebook::react::MainComponentsRegistry::registerNatives();
|
|
||||||
});
|
|
||||||
}
|
|
@ -1,36 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<!-- Copyright (C) 2014 The Android Open Source Project
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
you may not use this file except in compliance with the License.
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
|
|
||||||
Unless required by applicable law or agreed to in writing, software
|
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
See the License for the specific language governing permissions and
|
|
||||||
limitations under the License.
|
|
||||||
-->
|
|
||||||
<inset xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
android:insetLeft="@dimen/abc_edit_text_inset_horizontal_material"
|
|
||||||
android:insetRight="@dimen/abc_edit_text_inset_horizontal_material"
|
|
||||||
android:insetTop="@dimen/abc_edit_text_inset_top_material"
|
|
||||||
android:insetBottom="@dimen/abc_edit_text_inset_bottom_material">
|
|
||||||
|
|
||||||
<selector>
|
|
||||||
<!--
|
|
||||||
This file is a copy of abc_edit_text_material (https://bit.ly/3k8fX7I).
|
|
||||||
The item below with state_pressed="false" and state_focused="false" causes a NullPointerException.
|
|
||||||
NullPointerException:tempt to invoke virtual method 'android.graphics.drawable.Drawable android.graphics.drawable.Drawable$ConstantState.newDrawable(android.content.res.Resources)'
|
|
||||||
|
|
||||||
<item android:state_pressed="false" android:state_focused="false" android:drawable="@drawable/abc_textfield_default_mtrl_alpha"/>
|
|
||||||
|
|
||||||
For more info, see https://bit.ly/3CdLStv (react-native/pull/29452) and https://bit.ly/3nxOMoR.
|
|
||||||
-->
|
|
||||||
<item android:state_enabled="false" android:drawable="@drawable/abc_textfield_default_mtrl_alpha"/>
|
|
||||||
<item android:drawable="@drawable/abc_textfield_activated_mtrl_alpha"/>
|
|
||||||
</selector>
|
|
||||||
|
|
||||||
</inset>
|
|
@ -1,3 +0,0 @@
|
|||||||
<resources>
|
|
||||||
<string name="app_name">FabricExample</string>
|
|
||||||
</resources>
|
|
@ -1,9 +0,0 @@
|
|||||||
<resources>
|
|
||||||
|
|
||||||
<!-- Base application theme. -->
|
|
||||||
<style name="AppTheme" parent="Theme.AppCompat.DayNight.NoActionBar">
|
|
||||||
<!-- Customize your theme here. -->
|
|
||||||
<item name="android:editTextBackground">@drawable/rn_edit_text_material</item>
|
|
||||||
</style>
|
|
||||||
|
|
||||||
</resources>
|
|
@ -1,26 +0,0 @@
|
|||||||
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
|
||||||
|
|
||||||
buildscript {
|
|
||||||
ext {
|
|
||||||
buildToolsVersion = "34.0.0"
|
|
||||||
minSdkVersion = 23
|
|
||||||
compileSdkVersion = 34
|
|
||||||
targetSdkVersion = 34
|
|
||||||
ndkVersion = "26.1.10909125"
|
|
||||||
kotlinVersion = "1.9.22"
|
|
||||||
|
|
||||||
useExoplayerIMA = System.getenv("RNV_SAMPLE_ENABLE_ADS") ?: true
|
|
||||||
useExoplayerRtsp = true
|
|
||||||
}
|
|
||||||
repositories {
|
|
||||||
google()
|
|
||||||
mavenCentral()
|
|
||||||
}
|
|
||||||
dependencies {
|
|
||||||
classpath("com.android.tools.build:gradle")
|
|
||||||
classpath("com.facebook.react:react-native-gradle-plugin")
|
|
||||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
apply plugin: "com.facebook.react.rootproject"
|
|
@ -1,39 +0,0 @@
|
|||||||
# Project-wide Gradle settings.
|
|
||||||
|
|
||||||
# IDE (e.g. Android Studio) users:
|
|
||||||
# Gradle settings configured through the IDE *will override*
|
|
||||||
# any settings specified in this file.
|
|
||||||
|
|
||||||
# For more details on how to configure your build environment visit
|
|
||||||
# http://www.gradle.org/docs/current/userguide/build_environment.html
|
|
||||||
|
|
||||||
# Specifies the JVM arguments used for the daemon process.
|
|
||||||
# The setting is particularly useful for tweaking memory settings.
|
|
||||||
# Default value: -Xmx512m -XX:MaxMetaspaceSize=256m
|
|
||||||
org.gradle.jvmargs=-Xmx2048m -XX:MaxMetaspaceSize=512m
|
|
||||||
|
|
||||||
# When configured, Gradle will run in incubating parallel mode.
|
|
||||||
# This option should only be used with decoupled projects. More details, visit
|
|
||||||
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
|
|
||||||
# org.gradle.parallel=true
|
|
||||||
|
|
||||||
# AndroidX package structure to make it clearer which packages are bundled with the
|
|
||||||
# Android operating system, and which are packaged with your app's APK
|
|
||||||
# https://developer.android.com/topic/libraries/support-library/androidx-rn
|
|
||||||
android.useAndroidX=true
|
|
||||||
# Automatically convert third-party libraries to use AndroidX
|
|
||||||
android.enableJetifier=true
|
|
||||||
|
|
||||||
# Use this property to specify which architecture you want to build.
|
|
||||||
# You can also override it from the CLI using
|
|
||||||
# ./gradlew <task> -PreactNativeArchitectures=x86_64
|
|
||||||
reactNativeArchitectures=armeabi-v7a,arm64-v8a,x86,x86_64
|
|
||||||
|
|
||||||
# Use this property to enable support to the new architecture.
|
|
||||||
# This will allow you to use TurboModules and the Fabric render in
|
|
||||||
# your application. You should enable this flag either if you want
|
|
||||||
# to write custom TurboModules/Fabric components OR use libraries that
|
|
||||||
# are providing them.
|
|
||||||
newArchEnabled=true
|
|
||||||
|
|
||||||
hermesEnabled=true
|
|
Binary file not shown.
178
examples/FabricExample/android/gradlew.bat
vendored
178
examples/FabricExample/android/gradlew.bat
vendored
@ -1,178 +0,0 @@
|
|||||||
@rem
|
|
||||||
@rem Copyright 2015 the original author or authors.
|
|
||||||
@rem
|
|
||||||
@rem Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
@rem you may not use this file except in compliance with the License.
|
|
||||||
@rem You may obtain a copy of the License at
|
|
||||||
@rem
|
|
||||||
@rem https://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
@rem
|
|
||||||
@rem Unless required by applicable law or agreed to in writing, software
|
|
||||||
@rem distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
@rem See the License for the specific language governing permissions and
|
|
||||||
@rem limitations under the License.
|
|
||||||
@rem
|
|
||||||
|
|
||||||
@if "%DEBUG%" == "" @echo off
|
|
||||||
@rem ##########################################################################
|
|
||||||
@rem
|
|
||||||
@rem Gradle startup script for Windows
|
|
||||||
@rem
|
|
||||||
@rem ##########################################################################
|
|
||||||
|
|
||||||
@rem Set local scope for the variables with windows NT shell
|
|
||||||
if "%OS%"=="Windows_NT" setlocal
|
|
||||||
|
|
||||||
set DIRNAME=%~dp0
|
|
||||||
if "%DIRNAME%" == "" set DIRNAME=.
|
|
||||||
set APP_BASE_NAME=%~n0
|
|
||||||
set APP_HOME=%DIRNAME%
|
|
||||||
|
|
||||||
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
|
|
||||||
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
|
|
||||||
|
|
||||||
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
|
||||||
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
|
|
||||||
|
|
||||||
@rem Find java.exe
|
|
||||||
if defined JAVA_HOME goto findJavaFromJavaHome
|
|
||||||
|
|
||||||
set JAVA_EXE=java.exe
|
|
||||||
%JAVA_EXE% -version >NUL 2>&1
|
|
||||||
if "%ERRORLEVEL%" == "0" goto execute
|
|
||||||
|
|
||||||
echo.
|
|
||||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
|
||||||
echo.
|
|
||||||
echo Please set the JAVA_HOME variable in your environment to match the
|
|
||||||
echo location of your Java installation.
|
|
||||||
|
|
||||||
goto fail
|
|
||||||
|
|
||||||
:findJavaFromJavaHome
|
|
||||||
set JAVA_HOME=%JAVA_HOME:"=%
|
|
||||||
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
|
||||||
|
|
||||||
if exist "%JAVA_EXE%" goto execute
|
|
||||||
|
|
||||||
echo.
|
|
||||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
|
||||||
echo.
|
|
||||||
echo Please set the JAVA_HOME variable in your environment to match the
|
|
||||||
echo location of your Java installation.
|
|
||||||
|
|
||||||
goto fail
|
|
||||||
|
|
||||||
:execute
|
|
||||||
@rem Setup the command line
|
|
||||||
|
|
||||||
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
|
||||||
|
|
||||||
|
|
||||||
@rem Execute Gradle
|
|
||||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
|
|
||||||
|
|
||||||
:end
|
|
||||||
@rem End local scope for the variables with windows NT shell
|
|
||||||
if "%ERRORLEVEL%"=="0" goto mainEnd
|
|
||||||
|
|
||||||
:fail
|
|
||||||
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
|
||||||
rem the _cmd.exe /c_ return code!
|
|
||||||
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
|
|
||||||
exit /b 1
|
|
||||||
|
|
||||||
:mainEnd
|
|
||||||
if "%OS%"=="Windows_NT" endlocal
|
|
||||||
|
|
||||||
:omega
|
|
||||||
@rem
|
|
||||||
@rem Copyright 2015 the original author or authors.
|
|
||||||
@rem
|
|
||||||
@rem Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
@rem you may not use this file except in compliance with the License.
|
|
||||||
@rem You may obtain a copy of the License at
|
|
||||||
@rem
|
|
||||||
@rem https://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
@rem
|
|
||||||
@rem Unless required by applicable law or agreed to in writing, software
|
|
||||||
@rem distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
@rem See the License for the specific language governing permissions and
|
|
||||||
@rem limitations under the License.
|
|
||||||
@rem
|
|
||||||
|
|
||||||
@if "%DEBUG%" == "" @echo off
|
|
||||||
@rem ##########################################################################
|
|
||||||
@rem
|
|
||||||
@rem Gradle startup script for Windows
|
|
||||||
@rem
|
|
||||||
@rem ##########################################################################
|
|
||||||
|
|
||||||
@rem Set local scope for the variables with windows NT shell
|
|
||||||
if "%OS%"=="Windows_NT" setlocal
|
|
||||||
|
|
||||||
set DIRNAME=%~dp0
|
|
||||||
if "%DIRNAME%" == "" set DIRNAME=.
|
|
||||||
set APP_BASE_NAME=%~n0
|
|
||||||
set APP_HOME=%DIRNAME%
|
|
||||||
|
|
||||||
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
|
|
||||||
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
|
|
||||||
|
|
||||||
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
|
||||||
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
|
|
||||||
|
|
||||||
@rem Find java.exe
|
|
||||||
if defined JAVA_HOME goto findJavaFromJavaHome
|
|
||||||
|
|
||||||
set JAVA_EXE=java.exe
|
|
||||||
%JAVA_EXE% -version >NUL 2>&1
|
|
||||||
if "%ERRORLEVEL%" == "0" goto execute
|
|
||||||
|
|
||||||
echo.
|
|
||||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
|
||||||
echo.
|
|
||||||
echo Please set the JAVA_HOME variable in your environment to match the
|
|
||||||
echo location of your Java installation.
|
|
||||||
|
|
||||||
goto fail
|
|
||||||
|
|
||||||
:findJavaFromJavaHome
|
|
||||||
set JAVA_HOME=%JAVA_HOME:"=%
|
|
||||||
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
|
||||||
|
|
||||||
if exist "%JAVA_EXE%" goto execute
|
|
||||||
|
|
||||||
echo.
|
|
||||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
|
||||||
echo.
|
|
||||||
echo Please set the JAVA_HOME variable in your environment to match the
|
|
||||||
echo location of your Java installation.
|
|
||||||
|
|
||||||
goto fail
|
|
||||||
|
|
||||||
:execute
|
|
||||||
@rem Setup the command line
|
|
||||||
|
|
||||||
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
|
||||||
|
|
||||||
|
|
||||||
@rem Execute Gradle
|
|
||||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
|
|
||||||
|
|
||||||
:end
|
|
||||||
@rem End local scope for the variables with windows NT shell
|
|
||||||
if "%ERRORLEVEL%"=="0" goto mainEnd
|
|
||||||
|
|
||||||
:fail
|
|
||||||
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
|
||||||
rem the _cmd.exe /c_ return code!
|
|
||||||
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
|
|
||||||
exit /b 1
|
|
||||||
|
|
||||||
:mainEnd
|
|
||||||
if "%OS%"=="Windows_NT" endlocal
|
|
||||||
|
|
||||||
:omega
|
|
@ -1,11 +0,0 @@
|
|||||||
rootProject.name = 'FabricExample'
|
|
||||||
apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)
|
|
||||||
include ':app'
|
|
||||||
includeBuild('../node_modules/@react-native/gradle-plugin')
|
|
||||||
|
|
||||||
// if (settings.hasProperty("newArchEnabled") && settings.newArchEnabled == "true") {
|
|
||||||
// include(":ReactAndroid")
|
|
||||||
// project(":ReactAndroid").projectDir = file('../node_modules/react-native/ReactAndroid')
|
|
||||||
// include(":ReactAndroid:hermes-engine")
|
|
||||||
// project(":ReactAndroid:hermes-engine").projectDir = file('../node_modules/react-native/ReactAndroid/hermes-engine')
|
|
||||||
// }
|
|
@ -1,4 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "FabricExample",
|
|
||||||
"displayName": "FabricExample"
|
|
||||||
}
|
|
@ -1,17 +0,0 @@
|
|||||||
const path = require('path');
|
|
||||||
const pak = require('../../package.json');
|
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
presets: ['module:@react-native/babel-preset'],
|
|
||||||
plugins: [
|
|
||||||
[
|
|
||||||
'module-resolver',
|
|
||||||
{
|
|
||||||
extensions: ['.tsx', '.ts', '.js', '.json'],
|
|
||||||
alias: {
|
|
||||||
[pak.name]: path.join(__dirname, '../../', pak.source),
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
],
|
|
||||||
};
|
|
@ -1,9 +0,0 @@
|
|||||||
/**
|
|
||||||
* @format
|
|
||||||
*/
|
|
||||||
|
|
||||||
import {AppRegistry} from 'react-native';
|
|
||||||
import App from './App';
|
|
||||||
import {name as appName} from './app.json';
|
|
||||||
|
|
||||||
AppRegistry.registerComponent(appName, () => App);
|
|
@ -1,730 +0,0 @@
|
|||||||
// !$*UTF8*$!
|
|
||||||
{
|
|
||||||
archiveVersion = 1;
|
|
||||||
classes = {
|
|
||||||
};
|
|
||||||
objectVersion = 54;
|
|
||||||
objects = {
|
|
||||||
|
|
||||||
/* Begin PBXBuildFile section */
|
|
||||||
00E356F31AD99517003FC87E /* FabricExampleTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* FabricExampleTests.m */; };
|
|
||||||
0C80B921A6F3F58F76C31292 /* libPods-FabricExample.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5DCACB8F33CDC322A6C60F78 /* libPods-FabricExample.a */; };
|
|
||||||
13B07FBC1A68108700A75B9A /* AppDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.mm */; };
|
|
||||||
13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; };
|
|
||||||
13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; };
|
|
||||||
7699B88040F8A987B510C191 /* libPods-FabricExample-FabricExampleTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 19F6CBCC0A4E27FBF8BF4A61 /* libPods-FabricExample-FabricExampleTests.a */; };
|
|
||||||
81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */; };
|
|
||||||
/* End PBXBuildFile section */
|
|
||||||
|
|
||||||
/* Begin PBXContainerItemProxy section */
|
|
||||||
00E356F41AD99517003FC87E /* PBXContainerItemProxy */ = {
|
|
||||||
isa = PBXContainerItemProxy;
|
|
||||||
containerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */;
|
|
||||||
proxyType = 1;
|
|
||||||
remoteGlobalIDString = 13B07F861A680F5B00A75B9A;
|
|
||||||
remoteInfo = FabricExample;
|
|
||||||
};
|
|
||||||
/* End PBXContainerItemProxy section */
|
|
||||||
|
|
||||||
/* Begin PBXFileReference section */
|
|
||||||
00E356EE1AD99517003FC87E /* FabricExampleTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = FabricExampleTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
|
|
||||||
00E356F11AD99517003FC87E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
|
||||||
00E356F21AD99517003FC87E /* FabricExampleTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FabricExampleTests.m; sourceTree = "<group>"; };
|
|
||||||
13B07F961A680F5B00A75B9A /* FabricExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = FabricExample.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
|
||||||
13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = FabricExample/AppDelegate.h; sourceTree = "<group>"; };
|
|
||||||
13B07FB01A68108700A75B9A /* AppDelegate.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = AppDelegate.mm; path = FabricExample/AppDelegate.mm; sourceTree = "<group>"; };
|
|
||||||
13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = FabricExample/Images.xcassets; sourceTree = "<group>"; };
|
|
||||||
13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = FabricExample/Info.plist; sourceTree = "<group>"; };
|
|
||||||
13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = FabricExample/main.m; sourceTree = "<group>"; };
|
|
||||||
19F6CBCC0A4E27FBF8BF4A61 /* libPods-FabricExample-FabricExampleTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-FabricExample-FabricExampleTests.a"; sourceTree = BUILT_PRODUCTS_DIR; };
|
|
||||||
3B4392A12AC88292D35C810B /* Pods-FabricExample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-FabricExample.debug.xcconfig"; path = "Target Support Files/Pods-FabricExample/Pods-FabricExample.debug.xcconfig"; sourceTree = "<group>"; };
|
|
||||||
5709B34CF0A7D63546082F79 /* Pods-FabricExample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-FabricExample.release.xcconfig"; path = "Target Support Files/Pods-FabricExample/Pods-FabricExample.release.xcconfig"; sourceTree = "<group>"; };
|
|
||||||
5B7EB9410499542E8C5724F5 /* Pods-FabricExample-FabricExampleTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-FabricExample-FabricExampleTests.debug.xcconfig"; path = "Target Support Files/Pods-FabricExample-FabricExampleTests/Pods-FabricExample-FabricExampleTests.debug.xcconfig"; sourceTree = "<group>"; };
|
|
||||||
5DCACB8F33CDC322A6C60F78 /* libPods-FabricExample.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-FabricExample.a"; sourceTree = BUILT_PRODUCTS_DIR; };
|
|
||||||
81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = LaunchScreen.storyboard; path = FabricExample/LaunchScreen.storyboard; sourceTree = "<group>"; };
|
|
||||||
89C6BE57DB24E9ADA2F236DE /* Pods-FabricExample-FabricExampleTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-FabricExample-FabricExampleTests.release.xcconfig"; path = "Target Support Files/Pods-FabricExample-FabricExampleTests/Pods-FabricExample-FabricExampleTests.release.xcconfig"; sourceTree = "<group>"; };
|
|
||||||
ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; };
|
|
||||||
/* End PBXFileReference section */
|
|
||||||
|
|
||||||
/* Begin PBXFrameworksBuildPhase section */
|
|
||||||
00E356EB1AD99517003FC87E /* Frameworks */ = {
|
|
||||||
isa = PBXFrameworksBuildPhase;
|
|
||||||
buildActionMask = 2147483647;
|
|
||||||
files = (
|
|
||||||
7699B88040F8A987B510C191 /* libPods-FabricExample-FabricExampleTests.a in Frameworks */,
|
|
||||||
);
|
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
|
||||||
};
|
|
||||||
13B07F8C1A680F5B00A75B9A /* Frameworks */ = {
|
|
||||||
isa = PBXFrameworksBuildPhase;
|
|
||||||
buildActionMask = 2147483647;
|
|
||||||
files = (
|
|
||||||
0C80B921A6F3F58F76C31292 /* libPods-FabricExample.a in Frameworks */,
|
|
||||||
);
|
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
|
||||||
};
|
|
||||||
/* End PBXFrameworksBuildPhase section */
|
|
||||||
|
|
||||||
/* Begin PBXGroup section */
|
|
||||||
00E356EF1AD99517003FC87E /* FabricExampleTests */ = {
|
|
||||||
isa = PBXGroup;
|
|
||||||
children = (
|
|
||||||
00E356F21AD99517003FC87E /* FabricExampleTests.m */,
|
|
||||||
00E356F01AD99517003FC87E /* Supporting Files */,
|
|
||||||
);
|
|
||||||
path = FabricExampleTests;
|
|
||||||
sourceTree = "<group>";
|
|
||||||
};
|
|
||||||
00E356F01AD99517003FC87E /* Supporting Files */ = {
|
|
||||||
isa = PBXGroup;
|
|
||||||
children = (
|
|
||||||
00E356F11AD99517003FC87E /* Info.plist */,
|
|
||||||
);
|
|
||||||
name = "Supporting Files";
|
|
||||||
sourceTree = "<group>";
|
|
||||||
};
|
|
||||||
13B07FAE1A68108700A75B9A /* FabricExample */ = {
|
|
||||||
isa = PBXGroup;
|
|
||||||
children = (
|
|
||||||
13B07FAF1A68108700A75B9A /* AppDelegate.h */,
|
|
||||||
13B07FB01A68108700A75B9A /* AppDelegate.mm */,
|
|
||||||
13B07FB51A68108700A75B9A /* Images.xcassets */,
|
|
||||||
13B07FB61A68108700A75B9A /* Info.plist */,
|
|
||||||
81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */,
|
|
||||||
13B07FB71A68108700A75B9A /* main.m */,
|
|
||||||
);
|
|
||||||
name = FabricExample;
|
|
||||||
sourceTree = "<group>";
|
|
||||||
};
|
|
||||||
2D16E6871FA4F8E400B85C8A /* Frameworks */ = {
|
|
||||||
isa = PBXGroup;
|
|
||||||
children = (
|
|
||||||
ED297162215061F000B7C4FE /* JavaScriptCore.framework */,
|
|
||||||
5DCACB8F33CDC322A6C60F78 /* libPods-FabricExample.a */,
|
|
||||||
19F6CBCC0A4E27FBF8BF4A61 /* libPods-FabricExample-FabricExampleTests.a */,
|
|
||||||
);
|
|
||||||
name = Frameworks;
|
|
||||||
sourceTree = "<group>";
|
|
||||||
};
|
|
||||||
832341AE1AAA6A7D00B99B32 /* Libraries */ = {
|
|
||||||
isa = PBXGroup;
|
|
||||||
children = (
|
|
||||||
);
|
|
||||||
name = Libraries;
|
|
||||||
sourceTree = "<group>";
|
|
||||||
};
|
|
||||||
83CBB9F61A601CBA00E9B192 = {
|
|
||||||
isa = PBXGroup;
|
|
||||||
children = (
|
|
||||||
13B07FAE1A68108700A75B9A /* FabricExample */,
|
|
||||||
832341AE1AAA6A7D00B99B32 /* Libraries */,
|
|
||||||
00E356EF1AD99517003FC87E /* FabricExampleTests */,
|
|
||||||
83CBBA001A601CBA00E9B192 /* Products */,
|
|
||||||
2D16E6871FA4F8E400B85C8A /* Frameworks */,
|
|
||||||
BBD78D7AC51CEA395F1C20DB /* Pods */,
|
|
||||||
);
|
|
||||||
indentWidth = 2;
|
|
||||||
sourceTree = "<group>";
|
|
||||||
tabWidth = 2;
|
|
||||||
usesTabs = 0;
|
|
||||||
};
|
|
||||||
83CBBA001A601CBA00E9B192 /* Products */ = {
|
|
||||||
isa = PBXGroup;
|
|
||||||
children = (
|
|
||||||
13B07F961A680F5B00A75B9A /* FabricExample.app */,
|
|
||||||
00E356EE1AD99517003FC87E /* FabricExampleTests.xctest */,
|
|
||||||
);
|
|
||||||
name = Products;
|
|
||||||
sourceTree = "<group>";
|
|
||||||
};
|
|
||||||
BBD78D7AC51CEA395F1C20DB /* Pods */ = {
|
|
||||||
isa = PBXGroup;
|
|
||||||
children = (
|
|
||||||
3B4392A12AC88292D35C810B /* Pods-FabricExample.debug.xcconfig */,
|
|
||||||
5709B34CF0A7D63546082F79 /* Pods-FabricExample.release.xcconfig */,
|
|
||||||
5B7EB9410499542E8C5724F5 /* Pods-FabricExample-FabricExampleTests.debug.xcconfig */,
|
|
||||||
89C6BE57DB24E9ADA2F236DE /* Pods-FabricExample-FabricExampleTests.release.xcconfig */,
|
|
||||||
);
|
|
||||||
path = Pods;
|
|
||||||
sourceTree = "<group>";
|
|
||||||
};
|
|
||||||
/* End PBXGroup section */
|
|
||||||
|
|
||||||
/* Begin PBXNativeTarget section */
|
|
||||||
00E356ED1AD99517003FC87E /* FabricExampleTests */ = {
|
|
||||||
isa = PBXNativeTarget;
|
|
||||||
buildConfigurationList = 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "FabricExampleTests" */;
|
|
||||||
buildPhases = (
|
|
||||||
A55EABD7B0C7F3A422A6CC61 /* [CP] Check Pods Manifest.lock */,
|
|
||||||
00E356EA1AD99517003FC87E /* Sources */,
|
|
||||||
00E356EB1AD99517003FC87E /* Frameworks */,
|
|
||||||
00E356EC1AD99517003FC87E /* Resources */,
|
|
||||||
C59DA0FBD6956966B86A3779 /* [CP] Embed Pods Frameworks */,
|
|
||||||
F6A41C54EA430FDDC6A6ED99 /* [CP] Copy Pods Resources */,
|
|
||||||
);
|
|
||||||
buildRules = (
|
|
||||||
);
|
|
||||||
dependencies = (
|
|
||||||
00E356F51AD99517003FC87E /* PBXTargetDependency */,
|
|
||||||
);
|
|
||||||
name = FabricExampleTests;
|
|
||||||
productReference = 00E356EE1AD99517003FC87E /* FabricExampleTests.xctest */;
|
|
||||||
productType = "com.apple.product-type.bundle.unit-test";
|
|
||||||
};
|
|
||||||
13B07F861A680F5B00A75B9A /* FabricExample */ = {
|
|
||||||
isa = PBXNativeTarget;
|
|
||||||
buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "FabricExample" */;
|
|
||||||
buildPhases = (
|
|
||||||
C38B50BA6285516D6DCD4F65 /* [CP] Check Pods Manifest.lock */,
|
|
||||||
FD10A7F022414F080027D42C /* Start Packager */,
|
|
||||||
13B07F871A680F5B00A75B9A /* Sources */,
|
|
||||||
13B07F8C1A680F5B00A75B9A /* Frameworks */,
|
|
||||||
13B07F8E1A680F5B00A75B9A /* Resources */,
|
|
||||||
00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */,
|
|
||||||
00EEFC60759A1932668264C0 /* [CP] Embed Pods Frameworks */,
|
|
||||||
E235C05ADACE081382539298 /* [CP] Copy Pods Resources */,
|
|
||||||
);
|
|
||||||
buildRules = (
|
|
||||||
);
|
|
||||||
dependencies = (
|
|
||||||
);
|
|
||||||
name = FabricExample;
|
|
||||||
productName = FabricExample;
|
|
||||||
productReference = 13B07F961A680F5B00A75B9A /* FabricExample.app */;
|
|
||||||
productType = "com.apple.product-type.application";
|
|
||||||
};
|
|
||||||
/* End PBXNativeTarget section */
|
|
||||||
|
|
||||||
/* Begin PBXProject section */
|
|
||||||
83CBB9F71A601CBA00E9B192 /* Project object */ = {
|
|
||||||
isa = PBXProject;
|
|
||||||
attributes = {
|
|
||||||
LastUpgradeCheck = 1210;
|
|
||||||
TargetAttributes = {
|
|
||||||
00E356ED1AD99517003FC87E = {
|
|
||||||
CreatedOnToolsVersion = 6.2;
|
|
||||||
TestTargetID = 13B07F861A680F5B00A75B9A;
|
|
||||||
};
|
|
||||||
13B07F861A680F5B00A75B9A = {
|
|
||||||
LastSwiftMigration = 1120;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
buildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "FabricExample" */;
|
|
||||||
compatibilityVersion = "Xcode 12.0";
|
|
||||||
developmentRegion = en;
|
|
||||||
hasScannedForEncodings = 0;
|
|
||||||
knownRegions = (
|
|
||||||
en,
|
|
||||||
Base,
|
|
||||||
);
|
|
||||||
mainGroup = 83CBB9F61A601CBA00E9B192;
|
|
||||||
productRefGroup = 83CBBA001A601CBA00E9B192 /* Products */;
|
|
||||||
projectDirPath = "";
|
|
||||||
projectRoot = "";
|
|
||||||
targets = (
|
|
||||||
13B07F861A680F5B00A75B9A /* FabricExample */,
|
|
||||||
00E356ED1AD99517003FC87E /* FabricExampleTests */,
|
|
||||||
);
|
|
||||||
};
|
|
||||||
/* End PBXProject section */
|
|
||||||
|
|
||||||
/* Begin PBXResourcesBuildPhase section */
|
|
||||||
00E356EC1AD99517003FC87E /* Resources */ = {
|
|
||||||
isa = PBXResourcesBuildPhase;
|
|
||||||
buildActionMask = 2147483647;
|
|
||||||
files = (
|
|
||||||
);
|
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
|
||||||
};
|
|
||||||
13B07F8E1A680F5B00A75B9A /* Resources */ = {
|
|
||||||
isa = PBXResourcesBuildPhase;
|
|
||||||
buildActionMask = 2147483647;
|
|
||||||
files = (
|
|
||||||
81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */,
|
|
||||||
13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */,
|
|
||||||
);
|
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
|
||||||
};
|
|
||||||
/* End PBXResourcesBuildPhase section */
|
|
||||||
|
|
||||||
/* Begin PBXShellScriptBuildPhase section */
|
|
||||||
00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */ = {
|
|
||||||
isa = PBXShellScriptBuildPhase;
|
|
||||||
buildActionMask = 2147483647;
|
|
||||||
files = (
|
|
||||||
);
|
|
||||||
inputPaths = (
|
|
||||||
"$(SRCROOT)/.xcode.env.local",
|
|
||||||
"$(SRCROOT)/.xcode.env",
|
|
||||||
);
|
|
||||||
name = "Bundle React Native code and images";
|
|
||||||
outputPaths = (
|
|
||||||
);
|
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
|
||||||
shellPath = /bin/sh;
|
|
||||||
shellScript = "set -e\n\nWITH_ENVIRONMENT=\"../node_modules/react-native/scripts/xcode/with-environment.sh\"\nREACT_NATIVE_XCODE=\"../node_modules/react-native/scripts/react-native-xcode.sh\"\n\n/bin/sh -c \"$WITH_ENVIRONMENT $REACT_NATIVE_XCODE\"\n";
|
|
||||||
};
|
|
||||||
00EEFC60759A1932668264C0 /* [CP] Embed Pods Frameworks */ = {
|
|
||||||
isa = PBXShellScriptBuildPhase;
|
|
||||||
buildActionMask = 2147483647;
|
|
||||||
files = (
|
|
||||||
);
|
|
||||||
inputFileListPaths = (
|
|
||||||
"${PODS_ROOT}/Target Support Files/Pods-FabricExample/Pods-FabricExample-frameworks-${CONFIGURATION}-input-files.xcfilelist",
|
|
||||||
);
|
|
||||||
name = "[CP] Embed Pods Frameworks";
|
|
||||||
outputFileListPaths = (
|
|
||||||
"${PODS_ROOT}/Target Support Files/Pods-FabricExample/Pods-FabricExample-frameworks-${CONFIGURATION}-output-files.xcfilelist",
|
|
||||||
);
|
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
|
||||||
shellPath = /bin/sh;
|
|
||||||
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-FabricExample/Pods-FabricExample-frameworks.sh\"\n";
|
|
||||||
showEnvVarsInLog = 0;
|
|
||||||
};
|
|
||||||
A55EABD7B0C7F3A422A6CC61 /* [CP] Check Pods Manifest.lock */ = {
|
|
||||||
isa = PBXShellScriptBuildPhase;
|
|
||||||
buildActionMask = 2147483647;
|
|
||||||
files = (
|
|
||||||
);
|
|
||||||
inputFileListPaths = (
|
|
||||||
);
|
|
||||||
inputPaths = (
|
|
||||||
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
|
|
||||||
"${PODS_ROOT}/Manifest.lock",
|
|
||||||
);
|
|
||||||
name = "[CP] Check Pods Manifest.lock";
|
|
||||||
outputFileListPaths = (
|
|
||||||
);
|
|
||||||
outputPaths = (
|
|
||||||
"$(DERIVED_FILE_DIR)/Pods-FabricExample-FabricExampleTests-checkManifestLockResult.txt",
|
|
||||||
);
|
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
|
||||||
shellPath = /bin/sh;
|
|
||||||
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
|
|
||||||
showEnvVarsInLog = 0;
|
|
||||||
};
|
|
||||||
C38B50BA6285516D6DCD4F65 /* [CP] Check Pods Manifest.lock */ = {
|
|
||||||
isa = PBXShellScriptBuildPhase;
|
|
||||||
buildActionMask = 2147483647;
|
|
||||||
files = (
|
|
||||||
);
|
|
||||||
inputFileListPaths = (
|
|
||||||
);
|
|
||||||
inputPaths = (
|
|
||||||
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
|
|
||||||
"${PODS_ROOT}/Manifest.lock",
|
|
||||||
);
|
|
||||||
name = "[CP] Check Pods Manifest.lock";
|
|
||||||
outputFileListPaths = (
|
|
||||||
);
|
|
||||||
outputPaths = (
|
|
||||||
"$(DERIVED_FILE_DIR)/Pods-FabricExample-checkManifestLockResult.txt",
|
|
||||||
);
|
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
|
||||||
shellPath = /bin/sh;
|
|
||||||
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
|
|
||||||
showEnvVarsInLog = 0;
|
|
||||||
};
|
|
||||||
C59DA0FBD6956966B86A3779 /* [CP] Embed Pods Frameworks */ = {
|
|
||||||
isa = PBXShellScriptBuildPhase;
|
|
||||||
buildActionMask = 2147483647;
|
|
||||||
files = (
|
|
||||||
);
|
|
||||||
inputFileListPaths = (
|
|
||||||
"${PODS_ROOT}/Target Support Files/Pods-FabricExample-FabricExampleTests/Pods-FabricExample-FabricExampleTests-frameworks-${CONFIGURATION}-input-files.xcfilelist",
|
|
||||||
);
|
|
||||||
name = "[CP] Embed Pods Frameworks";
|
|
||||||
outputFileListPaths = (
|
|
||||||
"${PODS_ROOT}/Target Support Files/Pods-FabricExample-FabricExampleTests/Pods-FabricExample-FabricExampleTests-frameworks-${CONFIGURATION}-output-files.xcfilelist",
|
|
||||||
);
|
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
|
||||||
shellPath = /bin/sh;
|
|
||||||
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-FabricExample-FabricExampleTests/Pods-FabricExample-FabricExampleTests-frameworks.sh\"\n";
|
|
||||||
showEnvVarsInLog = 0;
|
|
||||||
};
|
|
||||||
E235C05ADACE081382539298 /* [CP] Copy Pods Resources */ = {
|
|
||||||
isa = PBXShellScriptBuildPhase;
|
|
||||||
buildActionMask = 2147483647;
|
|
||||||
files = (
|
|
||||||
);
|
|
||||||
inputFileListPaths = (
|
|
||||||
"${PODS_ROOT}/Target Support Files/Pods-FabricExample/Pods-FabricExample-resources-${CONFIGURATION}-input-files.xcfilelist",
|
|
||||||
);
|
|
||||||
name = "[CP] Copy Pods Resources";
|
|
||||||
outputFileListPaths = (
|
|
||||||
"${PODS_ROOT}/Target Support Files/Pods-FabricExample/Pods-FabricExample-resources-${CONFIGURATION}-output-files.xcfilelist",
|
|
||||||
);
|
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
|
||||||
shellPath = /bin/sh;
|
|
||||||
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-FabricExample/Pods-FabricExample-resources.sh\"\n";
|
|
||||||
showEnvVarsInLog = 0;
|
|
||||||
};
|
|
||||||
F6A41C54EA430FDDC6A6ED99 /* [CP] Copy Pods Resources */ = {
|
|
||||||
isa = PBXShellScriptBuildPhase;
|
|
||||||
buildActionMask = 2147483647;
|
|
||||||
files = (
|
|
||||||
);
|
|
||||||
inputFileListPaths = (
|
|
||||||
"${PODS_ROOT}/Target Support Files/Pods-FabricExample-FabricExampleTests/Pods-FabricExample-FabricExampleTests-resources-${CONFIGURATION}-input-files.xcfilelist",
|
|
||||||
);
|
|
||||||
name = "[CP] Copy Pods Resources";
|
|
||||||
outputFileListPaths = (
|
|
||||||
"${PODS_ROOT}/Target Support Files/Pods-FabricExample-FabricExampleTests/Pods-FabricExample-FabricExampleTests-resources-${CONFIGURATION}-output-files.xcfilelist",
|
|
||||||
);
|
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
|
||||||
shellPath = /bin/sh;
|
|
||||||
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-FabricExample-FabricExampleTests/Pods-FabricExample-FabricExampleTests-resources.sh\"\n";
|
|
||||||
showEnvVarsInLog = 0;
|
|
||||||
};
|
|
||||||
FD10A7F022414F080027D42C /* Start Packager */ = {
|
|
||||||
isa = PBXShellScriptBuildPhase;
|
|
||||||
buildActionMask = 2147483647;
|
|
||||||
files = (
|
|
||||||
);
|
|
||||||
inputFileListPaths = (
|
|
||||||
);
|
|
||||||
inputPaths = (
|
|
||||||
);
|
|
||||||
name = "Start Packager";
|
|
||||||
outputFileListPaths = (
|
|
||||||
);
|
|
||||||
outputPaths = (
|
|
||||||
);
|
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
|
||||||
shellPath = /bin/sh;
|
|
||||||
shellScript = "export RCT_METRO_PORT=\"${RCT_METRO_PORT:=8081}\"\necho \"export RCT_METRO_PORT=${RCT_METRO_PORT}\" > \"${SRCROOT}/../node_modules/react-native/scripts/.packager.env\"\nif [ -z \"${RCT_NO_LAUNCH_PACKAGER+xxx}\" ] ; then\n if nc -w 5 -z localhost ${RCT_METRO_PORT} ; then\n if ! curl -s \"http://localhost:${RCT_METRO_PORT}/status\" | grep -q \"packager-status:running\" ; then\n echo \"Port ${RCT_METRO_PORT} already in use, packager is either not running or not running correctly\"\n exit 2\n fi\n else\n open \"$SRCROOT/../node_modules/react-native/scripts/launchPackager.command\" || echo \"Can't start packager automatically\"\n fi\nfi\n";
|
|
||||||
showEnvVarsInLog = 0;
|
|
||||||
};
|
|
||||||
/* End PBXShellScriptBuildPhase section */
|
|
||||||
|
|
||||||
/* Begin PBXSourcesBuildPhase section */
|
|
||||||
00E356EA1AD99517003FC87E /* Sources */ = {
|
|
||||||
isa = PBXSourcesBuildPhase;
|
|
||||||
buildActionMask = 2147483647;
|
|
||||||
files = (
|
|
||||||
00E356F31AD99517003FC87E /* FabricExampleTests.m in Sources */,
|
|
||||||
);
|
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
|
||||||
};
|
|
||||||
13B07F871A680F5B00A75B9A /* Sources */ = {
|
|
||||||
isa = PBXSourcesBuildPhase;
|
|
||||||
buildActionMask = 2147483647;
|
|
||||||
files = (
|
|
||||||
13B07FBC1A68108700A75B9A /* AppDelegate.mm in Sources */,
|
|
||||||
13B07FC11A68108700A75B9A /* main.m in Sources */,
|
|
||||||
);
|
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
|
||||||
};
|
|
||||||
/* End PBXSourcesBuildPhase section */
|
|
||||||
|
|
||||||
/* Begin PBXTargetDependency section */
|
|
||||||
00E356F51AD99517003FC87E /* PBXTargetDependency */ = {
|
|
||||||
isa = PBXTargetDependency;
|
|
||||||
target = 13B07F861A680F5B00A75B9A /* FabricExample */;
|
|
||||||
targetProxy = 00E356F41AD99517003FC87E /* PBXContainerItemProxy */;
|
|
||||||
};
|
|
||||||
/* End PBXTargetDependency section */
|
|
||||||
|
|
||||||
/* Begin XCBuildConfiguration section */
|
|
||||||
00E356F61AD99517003FC87E /* Debug */ = {
|
|
||||||
isa = XCBuildConfiguration;
|
|
||||||
baseConfigurationReference = 5B7EB9410499542E8C5724F5 /* Pods-FabricExample-FabricExampleTests.debug.xcconfig */;
|
|
||||||
buildSettings = {
|
|
||||||
BUNDLE_LOADER = "$(TEST_HOST)";
|
|
||||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
|
||||||
"DEBUG=1",
|
|
||||||
"$(inherited)",
|
|
||||||
);
|
|
||||||
INFOPLIST_FILE = FabricExampleTests/Info.plist;
|
|
||||||
IPHONEOS_DEPLOYMENT_TARGET = 13.4;
|
|
||||||
LD_RUNPATH_SEARCH_PATHS = (
|
|
||||||
"$(inherited)",
|
|
||||||
"@executable_path/Frameworks",
|
|
||||||
"@loader_path/Frameworks",
|
|
||||||
);
|
|
||||||
OTHER_LDFLAGS = (
|
|
||||||
"-ObjC",
|
|
||||||
"-lc++",
|
|
||||||
"$(inherited)",
|
|
||||||
);
|
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = net.video.fabricexample;
|
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
|
||||||
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/FabricExample.app/FabricExample";
|
|
||||||
};
|
|
||||||
name = Debug;
|
|
||||||
};
|
|
||||||
00E356F71AD99517003FC87E /* Release */ = {
|
|
||||||
isa = XCBuildConfiguration;
|
|
||||||
baseConfigurationReference = 89C6BE57DB24E9ADA2F236DE /* Pods-FabricExample-FabricExampleTests.release.xcconfig */;
|
|
||||||
buildSettings = {
|
|
||||||
BUNDLE_LOADER = "$(TEST_HOST)";
|
|
||||||
COPY_PHASE_STRIP = NO;
|
|
||||||
INFOPLIST_FILE = FabricExampleTests/Info.plist;
|
|
||||||
IPHONEOS_DEPLOYMENT_TARGET = 13.4;
|
|
||||||
LD_RUNPATH_SEARCH_PATHS = (
|
|
||||||
"$(inherited)",
|
|
||||||
"@executable_path/Frameworks",
|
|
||||||
"@loader_path/Frameworks",
|
|
||||||
);
|
|
||||||
OTHER_LDFLAGS = (
|
|
||||||
"-ObjC",
|
|
||||||
"-lc++",
|
|
||||||
"$(inherited)",
|
|
||||||
);
|
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = net.video.fabricexample;
|
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
|
||||||
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/FabricExample.app/FabricExample";
|
|
||||||
};
|
|
||||||
name = Release;
|
|
||||||
};
|
|
||||||
13B07F941A680F5B00A75B9A /* Debug */ = {
|
|
||||||
isa = XCBuildConfiguration;
|
|
||||||
baseConfigurationReference = 3B4392A12AC88292D35C810B /* Pods-FabricExample.debug.xcconfig */;
|
|
||||||
buildSettings = {
|
|
||||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
|
||||||
CLANG_ENABLE_MODULES = YES;
|
|
||||||
CURRENT_PROJECT_VERSION = 1;
|
|
||||||
ENABLE_BITCODE = NO;
|
|
||||||
INFOPLIST_FILE = FabricExample/Info.plist;
|
|
||||||
INFOPLIST_KEY_CFBundleDisplayName = FabricExample;
|
|
||||||
LD_RUNPATH_SEARCH_PATHS = (
|
|
||||||
"$(inherited)",
|
|
||||||
"@executable_path/Frameworks",
|
|
||||||
);
|
|
||||||
OTHER_LDFLAGS = (
|
|
||||||
"$(inherited)",
|
|
||||||
"-ObjC",
|
|
||||||
"-lc++",
|
|
||||||
);
|
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = net.video.fabricexample;
|
|
||||||
PRODUCT_NAME = FabricExample;
|
|
||||||
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
|
||||||
SWIFT_VERSION = 5.0;
|
|
||||||
VERSIONING_SYSTEM = "apple-generic";
|
|
||||||
};
|
|
||||||
name = Debug;
|
|
||||||
};
|
|
||||||
13B07F951A680F5B00A75B9A /* Release */ = {
|
|
||||||
isa = XCBuildConfiguration;
|
|
||||||
baseConfigurationReference = 5709B34CF0A7D63546082F79 /* Pods-FabricExample.release.xcconfig */;
|
|
||||||
buildSettings = {
|
|
||||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
|
||||||
CLANG_ENABLE_MODULES = YES;
|
|
||||||
CURRENT_PROJECT_VERSION = 1;
|
|
||||||
INFOPLIST_FILE = FabricExample/Info.plist;
|
|
||||||
INFOPLIST_KEY_CFBundleDisplayName = FabricExample;
|
|
||||||
LD_RUNPATH_SEARCH_PATHS = (
|
|
||||||
"$(inherited)",
|
|
||||||
"@executable_path/Frameworks",
|
|
||||||
);
|
|
||||||
OTHER_LDFLAGS = (
|
|
||||||
"$(inherited)",
|
|
||||||
"-ObjC",
|
|
||||||
"-lc++",
|
|
||||||
);
|
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = net.video.fabricexample;
|
|
||||||
PRODUCT_NAME = FabricExample;
|
|
||||||
SWIFT_VERSION = 5.0;
|
|
||||||
VERSIONING_SYSTEM = "apple-generic";
|
|
||||||
};
|
|
||||||
name = Release;
|
|
||||||
};
|
|
||||||
83CBBA201A601CBA00E9B192 /* Debug */ = {
|
|
||||||
isa = XCBuildConfiguration;
|
|
||||||
buildSettings = {
|
|
||||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
|
||||||
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
|
|
||||||
CLANG_CXX_LANGUAGE_STANDARD = "c++20";
|
|
||||||
CLANG_CXX_LIBRARY = "libc++";
|
|
||||||
CLANG_ENABLE_MODULES = YES;
|
|
||||||
CLANG_ENABLE_OBJC_ARC = YES;
|
|
||||||
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
|
||||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
|
||||||
CLANG_WARN_COMMA = YES;
|
|
||||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
|
||||||
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
|
||||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
|
||||||
CLANG_WARN_EMPTY_BODY = YES;
|
|
||||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
|
||||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
|
||||||
CLANG_WARN_INT_CONVERSION = YES;
|
|
||||||
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
|
||||||
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
|
||||||
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
|
||||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
|
||||||
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
|
|
||||||
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
|
||||||
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
|
||||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
|
||||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
|
||||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
|
||||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
|
||||||
COPY_PHASE_STRIP = NO;
|
|
||||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
|
||||||
ENABLE_TESTABILITY = YES;
|
|
||||||
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = i386;
|
|
||||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
|
||||||
GCC_DYNAMIC_NO_PIC = NO;
|
|
||||||
GCC_NO_COMMON_BLOCKS = YES;
|
|
||||||
GCC_OPTIMIZATION_LEVEL = 0;
|
|
||||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
|
||||||
"DEBUG=1",
|
|
||||||
"$(inherited)",
|
|
||||||
_LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION,
|
|
||||||
);
|
|
||||||
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
|
|
||||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
|
||||||
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
|
||||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
|
||||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
|
||||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
|
||||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
|
||||||
IPHONEOS_DEPLOYMENT_TARGET = 13.4;
|
|
||||||
LD_RUNPATH_SEARCH_PATHS = (
|
|
||||||
/usr/lib/swift,
|
|
||||||
"$(inherited)",
|
|
||||||
);
|
|
||||||
LIBRARY_SEARCH_PATHS = (
|
|
||||||
"\"$(SDKROOT)/usr/lib/swift\"",
|
|
||||||
"\"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)\"",
|
|
||||||
"\"$(inherited)\"",
|
|
||||||
);
|
|
||||||
MTL_ENABLE_DEBUG_INFO = YES;
|
|
||||||
ONLY_ACTIVE_ARCH = YES;
|
|
||||||
OTHER_CFLAGS = (
|
|
||||||
"$(inherited)",
|
|
||||||
"-DRN_FABRIC_ENABLED",
|
|
||||||
);
|
|
||||||
OTHER_CPLUSPLUSFLAGS = (
|
|
||||||
"$(OTHER_CFLAGS)",
|
|
||||||
"-DFOLLY_NO_CONFIG",
|
|
||||||
"-DFOLLY_MOBILE=1",
|
|
||||||
"-DFOLLY_USE_LIBCPP=1",
|
|
||||||
"-DRN_FABRIC_ENABLED",
|
|
||||||
);
|
|
||||||
OTHER_LDFLAGS = (
|
|
||||||
"$(inherited)",
|
|
||||||
"-Wl",
|
|
||||||
"-ld_classic",
|
|
||||||
);
|
|
||||||
REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
|
|
||||||
SDKROOT = iphoneos;
|
|
||||||
USE_HERMES = true;
|
|
||||||
};
|
|
||||||
name = Debug;
|
|
||||||
};
|
|
||||||
83CBBA211A601CBA00E9B192 /* Release */ = {
|
|
||||||
isa = XCBuildConfiguration;
|
|
||||||
buildSettings = {
|
|
||||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
|
||||||
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
|
|
||||||
CLANG_CXX_LANGUAGE_STANDARD = "c++20";
|
|
||||||
CLANG_CXX_LIBRARY = "libc++";
|
|
||||||
CLANG_ENABLE_MODULES = YES;
|
|
||||||
CLANG_ENABLE_OBJC_ARC = YES;
|
|
||||||
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
|
||||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
|
||||||
CLANG_WARN_COMMA = YES;
|
|
||||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
|
||||||
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
|
||||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
|
||||||
CLANG_WARN_EMPTY_BODY = YES;
|
|
||||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
|
||||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
|
||||||
CLANG_WARN_INT_CONVERSION = YES;
|
|
||||||
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
|
||||||
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
|
||||||
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
|
||||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
|
||||||
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
|
|
||||||
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
|
||||||
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
|
||||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
|
||||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
|
||||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
|
||||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
|
||||||
COPY_PHASE_STRIP = YES;
|
|
||||||
ENABLE_NS_ASSERTIONS = NO;
|
|
||||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
|
||||||
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = i386;
|
|
||||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
|
||||||
GCC_NO_COMMON_BLOCKS = YES;
|
|
||||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
|
||||||
"$(inherited)",
|
|
||||||
_LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION,
|
|
||||||
);
|
|
||||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
|
||||||
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
|
||||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
|
||||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
|
||||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
|
||||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
|
||||||
IPHONEOS_DEPLOYMENT_TARGET = 13.4;
|
|
||||||
LD_RUNPATH_SEARCH_PATHS = (
|
|
||||||
/usr/lib/swift,
|
|
||||||
"$(inherited)",
|
|
||||||
);
|
|
||||||
LIBRARY_SEARCH_PATHS = (
|
|
||||||
"\"$(SDKROOT)/usr/lib/swift\"",
|
|
||||||
"\"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)\"",
|
|
||||||
"\"$(inherited)\"",
|
|
||||||
);
|
|
||||||
MTL_ENABLE_DEBUG_INFO = NO;
|
|
||||||
OTHER_CFLAGS = (
|
|
||||||
"$(inherited)",
|
|
||||||
"-DRN_FABRIC_ENABLED",
|
|
||||||
);
|
|
||||||
OTHER_CPLUSPLUSFLAGS = (
|
|
||||||
"$(OTHER_CFLAGS)",
|
|
||||||
"-DFOLLY_NO_CONFIG",
|
|
||||||
"-DFOLLY_MOBILE=1",
|
|
||||||
"-DFOLLY_USE_LIBCPP=1",
|
|
||||||
"-DRN_FABRIC_ENABLED",
|
|
||||||
);
|
|
||||||
OTHER_LDFLAGS = (
|
|
||||||
"$(inherited)",
|
|
||||||
"-Wl",
|
|
||||||
"-ld_classic",
|
|
||||||
);
|
|
||||||
REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
|
|
||||||
SDKROOT = iphoneos;
|
|
||||||
USE_HERMES = true;
|
|
||||||
VALIDATE_PRODUCT = YES;
|
|
||||||
};
|
|
||||||
name = Release;
|
|
||||||
};
|
|
||||||
/* End XCBuildConfiguration section */
|
|
||||||
|
|
||||||
/* Begin XCConfigurationList section */
|
|
||||||
00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "FabricExampleTests" */ = {
|
|
||||||
isa = XCConfigurationList;
|
|
||||||
buildConfigurations = (
|
|
||||||
00E356F61AD99517003FC87E /* Debug */,
|
|
||||||
00E356F71AD99517003FC87E /* Release */,
|
|
||||||
);
|
|
||||||
defaultConfigurationIsVisible = 0;
|
|
||||||
defaultConfigurationName = Release;
|
|
||||||
};
|
|
||||||
13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "FabricExample" */ = {
|
|
||||||
isa = XCConfigurationList;
|
|
||||||
buildConfigurations = (
|
|
||||||
13B07F941A680F5B00A75B9A /* Debug */,
|
|
||||||
13B07F951A680F5B00A75B9A /* Release */,
|
|
||||||
);
|
|
||||||
defaultConfigurationIsVisible = 0;
|
|
||||||
defaultConfigurationName = Release;
|
|
||||||
};
|
|
||||||
83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "FabricExample" */ = {
|
|
||||||
isa = XCConfigurationList;
|
|
||||||
buildConfigurations = (
|
|
||||||
83CBBA201A601CBA00E9B192 /* Debug */,
|
|
||||||
83CBBA211A601CBA00E9B192 /* Release */,
|
|
||||||
);
|
|
||||||
defaultConfigurationIsVisible = 0;
|
|
||||||
defaultConfigurationName = Release;
|
|
||||||
};
|
|
||||||
/* End XCConfigurationList section */
|
|
||||||
};
|
|
||||||
rootObject = 83CBB9F71A601CBA00E9B192 /* Project object */;
|
|
||||||
}
|
|
@ -1,88 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<Scheme
|
|
||||||
LastUpgradeVersion = "1210"
|
|
||||||
version = "1.3">
|
|
||||||
<BuildAction
|
|
||||||
parallelizeBuildables = "YES"
|
|
||||||
buildImplicitDependencies = "YES">
|
|
||||||
<BuildActionEntries>
|
|
||||||
<BuildActionEntry
|
|
||||||
buildForTesting = "YES"
|
|
||||||
buildForRunning = "YES"
|
|
||||||
buildForProfiling = "YES"
|
|
||||||
buildForArchiving = "YES"
|
|
||||||
buildForAnalyzing = "YES">
|
|
||||||
<BuildableReference
|
|
||||||
BuildableIdentifier = "primary"
|
|
||||||
BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
|
|
||||||
BuildableName = "FabricExample.app"
|
|
||||||
BlueprintName = "FabricExample"
|
|
||||||
ReferencedContainer = "container:FabricExample.xcodeproj">
|
|
||||||
</BuildableReference>
|
|
||||||
</BuildActionEntry>
|
|
||||||
</BuildActionEntries>
|
|
||||||
</BuildAction>
|
|
||||||
<TestAction
|
|
||||||
buildConfiguration = "Debug"
|
|
||||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
|
||||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
|
||||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
|
||||||
<Testables>
|
|
||||||
<TestableReference
|
|
||||||
skipped = "NO">
|
|
||||||
<BuildableReference
|
|
||||||
BuildableIdentifier = "primary"
|
|
||||||
BlueprintIdentifier = "00E356ED1AD99517003FC87E"
|
|
||||||
BuildableName = "FabricExampleTests.xctest"
|
|
||||||
BlueprintName = "FabricExampleTests"
|
|
||||||
ReferencedContainer = "container:FabricExample.xcodeproj">
|
|
||||||
</BuildableReference>
|
|
||||||
</TestableReference>
|
|
||||||
</Testables>
|
|
||||||
</TestAction>
|
|
||||||
<LaunchAction
|
|
||||||
buildConfiguration = "Debug"
|
|
||||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
|
||||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
|
||||||
launchStyle = "0"
|
|
||||||
useCustomWorkingDirectory = "NO"
|
|
||||||
ignoresPersistentStateOnLaunch = "NO"
|
|
||||||
debugDocumentVersioning = "YES"
|
|
||||||
debugServiceExtension = "internal"
|
|
||||||
allowLocationSimulation = "YES">
|
|
||||||
<BuildableProductRunnable
|
|
||||||
runnableDebuggingMode = "0">
|
|
||||||
<BuildableReference
|
|
||||||
BuildableIdentifier = "primary"
|
|
||||||
BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
|
|
||||||
BuildableName = "FabricExample.app"
|
|
||||||
BlueprintName = "FabricExample"
|
|
||||||
ReferencedContainer = "container:FabricExample.xcodeproj">
|
|
||||||
</BuildableReference>
|
|
||||||
</BuildableProductRunnable>
|
|
||||||
</LaunchAction>
|
|
||||||
<ProfileAction
|
|
||||||
buildConfiguration = "Release"
|
|
||||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
|
||||||
savedToolIdentifier = ""
|
|
||||||
useCustomWorkingDirectory = "NO"
|
|
||||||
debugDocumentVersioning = "YES">
|
|
||||||
<BuildableProductRunnable
|
|
||||||
runnableDebuggingMode = "0">
|
|
||||||
<BuildableReference
|
|
||||||
BuildableIdentifier = "primary"
|
|
||||||
BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
|
|
||||||
BuildableName = "FabricExample.app"
|
|
||||||
BlueprintName = "FabricExample"
|
|
||||||
ReferencedContainer = "container:FabricExample.xcodeproj">
|
|
||||||
</BuildableReference>
|
|
||||||
</BuildableProductRunnable>
|
|
||||||
</ProfileAction>
|
|
||||||
<AnalyzeAction
|
|
||||||
buildConfiguration = "Debug">
|
|
||||||
</AnalyzeAction>
|
|
||||||
<ArchiveAction
|
|
||||||
buildConfiguration = "Release"
|
|
||||||
revealArchiveInOrganizer = "YES">
|
|
||||||
</ArchiveAction>
|
|
||||||
</Scheme>
|
|
@ -1,10 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<Workspace
|
|
||||||
version = "1.0">
|
|
||||||
<FileRef
|
|
||||||
location = "group:FabricExample.xcodeproj">
|
|
||||||
</FileRef>
|
|
||||||
<FileRef
|
|
||||||
location = "group:Pods/Pods.xcodeproj">
|
|
||||||
</FileRef>
|
|
||||||
</Workspace>
|
|
@ -1,8 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
||||||
<plist version="1.0">
|
|
||||||
<dict>
|
|
||||||
<key>IDEDidComputeMac32BitWarning</key>
|
|
||||||
<true/>
|
|
||||||
</dict>
|
|
||||||
</plist>
|
|
@ -1,6 +0,0 @@
|
|||||||
#import <RCTAppDelegate.h>
|
|
||||||
#import <UIKit/UIKit.h>
|
|
||||||
|
|
||||||
@interface AppDelegate : RCTAppDelegate
|
|
||||||
|
|
||||||
@end
|
|
@ -1,31 +0,0 @@
|
|||||||
#import "AppDelegate.h"
|
|
||||||
|
|
||||||
#import <React/RCTBundleURLProvider.h>
|
|
||||||
|
|
||||||
@implementation AppDelegate
|
|
||||||
|
|
||||||
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
|
|
||||||
{
|
|
||||||
self.moduleName = @"FabricExample";
|
|
||||||
// You can add your custom initial props in the dictionary below.
|
|
||||||
// They will be passed down to the ViewController used by React Native.
|
|
||||||
self.initialProps = @{};
|
|
||||||
|
|
||||||
return [super application:application didFinishLaunchingWithOptions:launchOptions];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
|
|
||||||
{
|
|
||||||
return [self getBundleURL];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (NSURL *)getBundleURL
|
|
||||||
{
|
|
||||||
#if DEBUG
|
|
||||||
return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index"];
|
|
||||||
#else
|
|
||||||
return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
@end
|
|
@ -1,53 +0,0 @@
|
|||||||
{
|
|
||||||
"images" : [
|
|
||||||
{
|
|
||||||
"idiom" : "iphone",
|
|
||||||
"scale" : "2x",
|
|
||||||
"size" : "20x20"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"idiom" : "iphone",
|
|
||||||
"scale" : "3x",
|
|
||||||
"size" : "20x20"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"idiom" : "iphone",
|
|
||||||
"scale" : "2x",
|
|
||||||
"size" : "29x29"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"idiom" : "iphone",
|
|
||||||
"scale" : "3x",
|
|
||||||
"size" : "29x29"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"idiom" : "iphone",
|
|
||||||
"scale" : "2x",
|
|
||||||
"size" : "40x40"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"idiom" : "iphone",
|
|
||||||
"scale" : "3x",
|
|
||||||
"size" : "40x40"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"idiom" : "iphone",
|
|
||||||
"scale" : "2x",
|
|
||||||
"size" : "60x60"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"idiom" : "iphone",
|
|
||||||
"scale" : "3x",
|
|
||||||
"size" : "60x60"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"idiom" : "ios-marketing",
|
|
||||||
"scale" : "1x",
|
|
||||||
"size" : "1024x1024"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"info" : {
|
|
||||||
"author" : "xcode",
|
|
||||||
"version" : 1
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,6 +0,0 @@
|
|||||||
{
|
|
||||||
"info" : {
|
|
||||||
"version" : 1,
|
|
||||||
"author" : "xcode"
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,51 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
||||||
<plist version="1.0">
|
|
||||||
<dict>
|
|
||||||
<key>CFBundleDevelopmentRegion</key>
|
|
||||||
<string>en</string>
|
|
||||||
<key>CFBundleDisplayName</key>
|
|
||||||
<string>FabricExample</string>
|
|
||||||
<key>CFBundleExecutable</key>
|
|
||||||
<string>$(EXECUTABLE_NAME)</string>
|
|
||||||
<key>CFBundleIdentifier</key>
|
|
||||||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
|
||||||
<key>CFBundleInfoDictionaryVersion</key>
|
|
||||||
<string>6.0</string>
|
|
||||||
<key>CFBundleName</key>
|
|
||||||
<string>$(PRODUCT_NAME)</string>
|
|
||||||
<key>CFBundlePackageType</key>
|
|
||||||
<string>APPL</string>
|
|
||||||
<key>CFBundleShortVersionString</key>
|
|
||||||
<string>1.0</string>
|
|
||||||
<key>CFBundleSignature</key>
|
|
||||||
<string>????</string>
|
|
||||||
<key>CFBundleVersion</key>
|
|
||||||
<string>1</string>
|
|
||||||
<key>LSRequiresIPhoneOS</key>
|
|
||||||
<true/>
|
|
||||||
<key>NSAppTransportSecurity</key>
|
|
||||||
<dict>
|
|
||||||
<key>NSAllowsArbitraryLoads</key>
|
|
||||||
<false/>
|
|
||||||
<key>NSAllowsLocalNetworking</key>
|
|
||||||
<true/>
|
|
||||||
</dict>
|
|
||||||
<key>NSLocationWhenInUseUsageDescription</key>
|
|
||||||
<string></string>
|
|
||||||
<key>UILaunchStoryboardName</key>
|
|
||||||
<string>LaunchScreen</string>
|
|
||||||
<key>UIRequiredDeviceCapabilities</key>
|
|
||||||
<array>
|
|
||||||
<string>armv7</string>
|
|
||||||
</array>
|
|
||||||
<key>UISupportedInterfaceOrientations</key>
|
|
||||||
<array>
|
|
||||||
<string>UIInterfaceOrientationPortrait</string>
|
|
||||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
|
||||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
|
||||||
</array>
|
|
||||||
<key>UIViewControllerBasedStatusBarAppearance</key>
|
|
||||||
<false/>
|
|
||||||
</dict>
|
|
||||||
</plist>
|
|
@ -1,47 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="15702" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
|
|
||||||
<device id="retina4_7" orientation="portrait" appearance="light"/>
|
|
||||||
<dependencies>
|
|
||||||
<deployment identifier="iOS"/>
|
|
||||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15704"/>
|
|
||||||
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
|
|
||||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
|
||||||
</dependencies>
|
|
||||||
<scenes>
|
|
||||||
<!--View Controller-->
|
|
||||||
<scene sceneID="EHf-IW-A2E">
|
|
||||||
<objects>
|
|
||||||
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
|
|
||||||
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
|
|
||||||
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
|
|
||||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
|
||||||
<subviews>
|
|
||||||
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="FabricExample" textAlignment="center" lineBreakMode="middleTruncation" baselineAdjustment="alignBaselines" minimumFontSize="18" translatesAutoresizingMaskIntoConstraints="NO" id="GJd-Yh-RWb">
|
|
||||||
<rect key="frame" x="0.0" y="202" width="375" height="43"/>
|
|
||||||
<fontDescription key="fontDescription" type="boldSystem" pointSize="36"/>
|
|
||||||
<nil key="highlightedColor"/>
|
|
||||||
</label>
|
|
||||||
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Powered by React Native" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="9" translatesAutoresizingMaskIntoConstraints="NO" id="MN2-I3-ftu">
|
|
||||||
<rect key="frame" x="0.0" y="626" width="375" height="21"/>
|
|
||||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
|
||||||
<nil key="highlightedColor"/>
|
|
||||||
</label>
|
|
||||||
</subviews>
|
|
||||||
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
|
|
||||||
<constraints>
|
|
||||||
<constraint firstItem="Bcu-3y-fUS" firstAttribute="bottom" secondItem="MN2-I3-ftu" secondAttribute="bottom" constant="20" id="OZV-Vh-mqD"/>
|
|
||||||
<constraint firstItem="Bcu-3y-fUS" firstAttribute="centerX" secondItem="GJd-Yh-RWb" secondAttribute="centerX" id="Q3B-4B-g5h"/>
|
|
||||||
<constraint firstItem="MN2-I3-ftu" firstAttribute="centerX" secondItem="Bcu-3y-fUS" secondAttribute="centerX" id="akx-eg-2ui"/>
|
|
||||||
<constraint firstItem="MN2-I3-ftu" firstAttribute="leading" secondItem="Bcu-3y-fUS" secondAttribute="leading" id="i1E-0Y-4RG"/>
|
|
||||||
<constraint firstItem="GJd-Yh-RWb" firstAttribute="centerY" secondItem="Ze5-6b-2t3" secondAttribute="bottom" multiplier="1/3" constant="1" id="moa-c2-u7t"/>
|
|
||||||
<constraint firstItem="GJd-Yh-RWb" firstAttribute="leading" secondItem="Bcu-3y-fUS" secondAttribute="leading" symbolic="YES" id="x7j-FC-K8j"/>
|
|
||||||
</constraints>
|
|
||||||
<viewLayoutGuide key="safeArea" id="Bcu-3y-fUS"/>
|
|
||||||
</view>
|
|
||||||
</viewController>
|
|
||||||
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
|
|
||||||
</objects>
|
|
||||||
<point key="canvasLocation" x="52.173913043478265" y="375"/>
|
|
||||||
</scene>
|
|
||||||
</scenes>
|
|
||||||
</document>
|
|
@ -1,10 +0,0 @@
|
|||||||
#import <UIKit/UIKit.h>
|
|
||||||
|
|
||||||
#import "AppDelegate.h"
|
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
|
||||||
{
|
|
||||||
@autoreleasepool {
|
|
||||||
return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,66 +0,0 @@
|
|||||||
#import <UIKit/UIKit.h>
|
|
||||||
#import <XCTest/XCTest.h>
|
|
||||||
|
|
||||||
#import <React/RCTLog.h>
|
|
||||||
#import <React/RCTRootView.h>
|
|
||||||
|
|
||||||
#define TIMEOUT_SECONDS 600
|
|
||||||
#define TEXT_TO_LOOK_FOR @"Welcome to React"
|
|
||||||
|
|
||||||
@interface FabricExampleTests : XCTestCase
|
|
||||||
|
|
||||||
@end
|
|
||||||
|
|
||||||
@implementation FabricExampleTests
|
|
||||||
|
|
||||||
- (BOOL)findSubviewInView:(UIView *)view matching:(BOOL (^)(UIView *view))test
|
|
||||||
{
|
|
||||||
if (test(view)) {
|
|
||||||
return YES;
|
|
||||||
}
|
|
||||||
for (UIView *subview in [view subviews]) {
|
|
||||||
if ([self findSubviewInView:subview matching:test]) {
|
|
||||||
return YES;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return NO;
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void)testRendersWelcomeScreen
|
|
||||||
{
|
|
||||||
UIViewController *vc = [[[RCTSharedApplication() delegate] window] rootViewController];
|
|
||||||
NSDate *date = [NSDate dateWithTimeIntervalSinceNow:TIMEOUT_SECONDS];
|
|
||||||
BOOL foundElement = NO;
|
|
||||||
|
|
||||||
__block NSString *redboxError = nil;
|
|
||||||
#ifdef DEBUG
|
|
||||||
RCTSetLogFunction(
|
|
||||||
^(RCTLogLevel level, RCTLogSource source, NSString *fileName, NSNumber *lineNumber, NSString *message) {
|
|
||||||
if (level >= RCTLogLevelError) {
|
|
||||||
redboxError = message;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
#endif
|
|
||||||
|
|
||||||
while ([date timeIntervalSinceNow] > 0 && !foundElement && !redboxError) {
|
|
||||||
[[NSRunLoop mainRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]];
|
|
||||||
[[NSRunLoop mainRunLoop] runMode:NSRunLoopCommonModes beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]];
|
|
||||||
|
|
||||||
foundElement = [self findSubviewInView:vc.view
|
|
||||||
matching:^BOOL(UIView *view) {
|
|
||||||
if ([view.accessibilityLabel isEqualToString:TEXT_TO_LOOK_FOR]) {
|
|
||||||
return YES;
|
|
||||||
}
|
|
||||||
return NO;
|
|
||||||
}];
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef DEBUG
|
|
||||||
RCTSetLogFunction(RCTDefaultLogFunction);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
XCTAssertNil(redboxError, @"RedBox error: %@", redboxError);
|
|
||||||
XCTAssertTrue(foundElement, @"Couldn't find element with text '%@' in %d seconds", TEXT_TO_LOOK_FOR, TIMEOUT_SECONDS);
|
|
||||||
}
|
|
||||||
|
|
||||||
@end
|
|
@ -1,24 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
||||||
<plist version="1.0">
|
|
||||||
<dict>
|
|
||||||
<key>CFBundleDevelopmentRegion</key>
|
|
||||||
<string>en</string>
|
|
||||||
<key>CFBundleExecutable</key>
|
|
||||||
<string>$(EXECUTABLE_NAME)</string>
|
|
||||||
<key>CFBundleIdentifier</key>
|
|
||||||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
|
||||||
<key>CFBundleInfoDictionaryVersion</key>
|
|
||||||
<string>6.0</string>
|
|
||||||
<key>CFBundleName</key>
|
|
||||||
<string>$(PRODUCT_NAME)</string>
|
|
||||||
<key>CFBundlePackageType</key>
|
|
||||||
<string>BNDL</string>
|
|
||||||
<key>CFBundleShortVersionString</key>
|
|
||||||
<string>1.0</string>
|
|
||||||
<key>CFBundleSignature</key>
|
|
||||||
<string>????</string>
|
|
||||||
<key>CFBundleVersion</key>
|
|
||||||
<string>1</string>
|
|
||||||
</dict>
|
|
||||||
</plist>
|
|
@ -1,39 +0,0 @@
|
|||||||
ENV['RCT_NEW_ARCH_ENABLED'] = "1"
|
|
||||||
|
|
||||||
# Resolve react_native_pods.rb with node to allow for hoisting
|
|
||||||
require Pod::Executable.execute_command('node', ['-p',
|
|
||||||
'require.resolve(
|
|
||||||
"react-native/scripts/react_native_pods.rb",
|
|
||||||
{paths: [process.argv[1]]},
|
|
||||||
)', __dir__]).strip
|
|
||||||
|
|
||||||
platform :ios, '13.4'
|
|
||||||
install! 'cocoapods', :deterministic_uuids => false
|
|
||||||
|
|
||||||
target 'FabricExample' do
|
|
||||||
config = use_native_modules!
|
|
||||||
|
|
||||||
use_react_native!(
|
|
||||||
:path => config[:reactNativePath],
|
|
||||||
# Enables Flipper.
|
|
||||||
#
|
|
||||||
# Note that if you have use_frameworks! enabled, Flipper will not work and
|
|
||||||
# you should disable the next line.
|
|
||||||
# :flipper_configuration => FlipperConfiguration.enabled,
|
|
||||||
# An absolute path to your application root.
|
|
||||||
:app_path => "#{Pod::Config.instance.installation_root}/.."
|
|
||||||
)
|
|
||||||
|
|
||||||
target 'FabricExampleTests' do
|
|
||||||
inherit! :complete
|
|
||||||
# Pods for testing
|
|
||||||
end
|
|
||||||
|
|
||||||
post_install do |installer|
|
|
||||||
react_native_post_install(
|
|
||||||
installer,
|
|
||||||
config[:reactNativePath],
|
|
||||||
:mac_catalyst_enabled => false
|
|
||||||
)
|
|
||||||
end
|
|
||||||
end
|
|
@ -1,11 +0,0 @@
|
|||||||
# This `.xcode.env` file is versioned and is used to source the environment
|
|
||||||
# used when running script phases inside Xcode.
|
|
||||||
# To customize your local environment, you can create an `.xcode.env.local`
|
|
||||||
# file that is not versioned.
|
|
||||||
|
|
||||||
# NODE_BINARY variable contains the PATH to the node executable.
|
|
||||||
#
|
|
||||||
# Customize the NODE_BINARY variable here.
|
|
||||||
# For example, to use nvm with brew, add the following line
|
|
||||||
# . "$(brew --prefix nvm)/nvm.sh" --no-use
|
|
||||||
export NODE_BINARY=$(command -v node)
|
|
@ -1,3 +0,0 @@
|
|||||||
module.exports = {
|
|
||||||
preset: 'react-native',
|
|
||||||
};
|
|
@ -1,43 +0,0 @@
|
|||||||
const path = require('path');
|
|
||||||
const escape = require('escape-string-regexp');
|
|
||||||
const exclusionList = require('metro-config/src/defaults/exclusionList');
|
|
||||||
const pak = require('../../package.json');
|
|
||||||
const {getDefaultConfig, mergeConfig} = require('@react-native/metro-config');
|
|
||||||
|
|
||||||
const root = path.resolve(__dirname, '../../');
|
|
||||||
|
|
||||||
const modules = Object.keys({
|
|
||||||
...pak.peerDependencies,
|
|
||||||
});
|
|
||||||
|
|
||||||
const config = {
|
|
||||||
projectRoot: __dirname,
|
|
||||||
watchFolders: [root],
|
|
||||||
|
|
||||||
// We need to make sure that only one version is loaded for peerDependencies
|
|
||||||
// So we block them at the root, and alias them to the versions in example's node_modules
|
|
||||||
resolver: {
|
|
||||||
blacklistRE: exclusionList(
|
|
||||||
modules.map(
|
|
||||||
(m) =>
|
|
||||||
new RegExp(`^${escape(path.join(root, 'node_modules', m))}\\/.*$`)
|
|
||||||
)
|
|
||||||
),
|
|
||||||
|
|
||||||
extraNodeModules: modules.reduce((acc, name) => {
|
|
||||||
acc[name] = path.join(__dirname, 'node_modules', name);
|
|
||||||
return acc;
|
|
||||||
}, {}),
|
|
||||||
},
|
|
||||||
|
|
||||||
transformer: {
|
|
||||||
getTransformOptions: async () => ({
|
|
||||||
transform: {
|
|
||||||
experimentalImportSupport: false,
|
|
||||||
inlineRequires: true,
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
module.exports = mergeConfig(getDefaultConfig(__dirname), config);
|
|
@ -1,56 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "fabricexample",
|
|
||||||
"version": "0.0.1",
|
|
||||||
"private": true,
|
|
||||||
"scripts": {
|
|
||||||
"android": "react-native run-android",
|
|
||||||
"ios": "react-native run-ios",
|
|
||||||
"start": "react-native start",
|
|
||||||
"test": "jest",
|
|
||||||
"lint": "eslint . --ext .js,.jsx,.ts,.tsx",
|
|
||||||
"pod-install": "bundle exec npx pod-install --project-directory=ios --verbose"
|
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"@react-native-picker/picker": "2.7.5",
|
|
||||||
"react": "18.1.0",
|
|
||||||
"react-native": "0.73.2"
|
|
||||||
},
|
|
||||||
"devDependencies": {
|
|
||||||
"@babel/core": "^7.12.9",
|
|
||||||
"@babel/runtime": "^7.12.5",
|
|
||||||
"@react-native-community/eslint-config": "^2.0.0",
|
|
||||||
"@react-native/babel-preset": "0.73.19",
|
|
||||||
"@react-native/eslint-config": "0.73.2",
|
|
||||||
"@react-native/metro-config": "0.73.3",
|
|
||||||
"@react-native/typescript-config": "0.73.1",
|
|
||||||
"@tsconfig/react-native": "^2.0.2",
|
|
||||||
"@types/jest": "^26.0.23",
|
|
||||||
"@types/react": "^18.2.6",
|
|
||||||
"@types/react-native": "^0.70.6",
|
|
||||||
"@types/react-test-renderer": "^18.0.0",
|
|
||||||
"@typescript-eslint/eslint-plugin": "^5.37.0",
|
|
||||||
"@typescript-eslint/parser": "^5.37.0",
|
|
||||||
"babel-jest": "^29.6.3",
|
|
||||||
"babel-plugin-module-resolver": "^5.0.0",
|
|
||||||
"eslint": "^7.32.0",
|
|
||||||
"jest": "^29.6.3",
|
|
||||||
"metro-react-native-babel-preset": "0.72.3",
|
|
||||||
"prettier": "2.8.8",
|
|
||||||
"react-test-renderer": "18.1.0",
|
|
||||||
"typescript": "5.0.4"
|
|
||||||
},
|
|
||||||
"jest": {
|
|
||||||
"preset": "react-native",
|
|
||||||
"moduleFileExtensions": [
|
|
||||||
"ts",
|
|
||||||
"tsx",
|
|
||||||
"js",
|
|
||||||
"jsx",
|
|
||||||
"json",
|
|
||||||
"node"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=18"
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,10 +0,0 @@
|
|||||||
const path = require('path');
|
|
||||||
const pak = require('../../package.json');
|
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
dependencies: {
|
|
||||||
[pak.name]: {
|
|
||||||
root: path.join(__dirname, '../../'),
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
@ -1,831 +0,0 @@
|
|||||||
'use strict';
|
|
||||||
|
|
||||||
import React, {Component} from 'react';
|
|
||||||
|
|
||||||
import {
|
|
||||||
Text,
|
|
||||||
TouchableOpacity,
|
|
||||||
View,
|
|
||||||
ActivityIndicator,
|
|
||||||
ToastAndroid,
|
|
||||||
Platform,
|
|
||||||
Alert,
|
|
||||||
} from 'react-native';
|
|
||||||
|
|
||||||
import Video, {
|
|
||||||
AudioTrack,
|
|
||||||
OnAudioTracksData,
|
|
||||||
OnLoadData,
|
|
||||||
OnProgressData,
|
|
||||||
OnTextTracksData,
|
|
||||||
OnVideoAspectRatioData,
|
|
||||||
TextTrack,
|
|
||||||
VideoDecoderProperties,
|
|
||||||
OnBufferData,
|
|
||||||
OnAudioFocusChangedData,
|
|
||||||
OnVideoErrorData,
|
|
||||||
VideoRef,
|
|
||||||
ResizeMode,
|
|
||||||
SelectedTrack,
|
|
||||||
DRMType,
|
|
||||||
OnTextTrackDataChangedData,
|
|
||||||
TextTrackType,
|
|
||||||
ISO639_1,
|
|
||||||
OnSeekData,
|
|
||||||
OnPlaybackStateChangedData,
|
|
||||||
OnPlaybackRateChangeData,
|
|
||||||
OnVideoTracksData,
|
|
||||||
VideoTrack,
|
|
||||||
SelectedVideoTrackType,
|
|
||||||
SelectedVideoTrack,
|
|
||||||
BufferingStrategyType,
|
|
||||||
ReactVideoSource,
|
|
||||||
Drm,
|
|
||||||
TextTracks,
|
|
||||||
} from 'react-native-video';
|
|
||||||
import ToggleControl from './ToggleControl';
|
|
||||||
import MultiValueControl, {
|
|
||||||
MultiValueControlPropType,
|
|
||||||
} from './MultiValueControl';
|
|
||||||
import styles from './styles';
|
|
||||||
import AudioTrackSelector from './components/AudioTracksSelector';
|
|
||||||
import TextTrackSelector from './components/TextTracksSelector';
|
|
||||||
import VideoTrackSelector from './components/VideoTracksSelector';
|
|
||||||
import Seeker from './components/Seeker';
|
|
||||||
|
|
||||||
type AdditionnalSourceInfo = {
|
|
||||||
textTracks: TextTracks;
|
|
||||||
adTagUrl: string;
|
|
||||||
description: string;
|
|
||||||
drm: Drm;
|
|
||||||
noView: boolean;
|
|
||||||
};
|
|
||||||
|
|
||||||
type SampleVideoSource = ReactVideoSource | AdditionnalSourceInfo;
|
|
||||||
|
|
||||||
interface StateType {
|
|
||||||
rate: number;
|
|
||||||
volume: number;
|
|
||||||
muted: boolean;
|
|
||||||
resizeMode: ResizeMode;
|
|
||||||
duration: number;
|
|
||||||
currentTime: number;
|
|
||||||
videoWidth: number;
|
|
||||||
videoHeight: number;
|
|
||||||
paused: boolean;
|
|
||||||
fullscreen: true;
|
|
||||||
decoration: true;
|
|
||||||
isLoading: boolean;
|
|
||||||
audioTracks: Array<AudioTrack>;
|
|
||||||
textTracks: Array<TextTrack>;
|
|
||||||
videoTracks: Array<VideoTrack>;
|
|
||||||
selectedAudioTrack: SelectedTrack | undefined;
|
|
||||||
selectedTextTrack: SelectedTrack | undefined;
|
|
||||||
selectedVideoTrack: SelectedVideoTrack;
|
|
||||||
srcListId: number;
|
|
||||||
loop: boolean;
|
|
||||||
showRNVControls: boolean;
|
|
||||||
useCache: boolean;
|
|
||||||
poster?: string;
|
|
||||||
showNotificationControls: boolean;
|
|
||||||
isSeeking: boolean;
|
|
||||||
}
|
|
||||||
|
|
||||||
class VideoPlayer extends Component {
|
|
||||||
state: StateType = {
|
|
||||||
rate: 1,
|
|
||||||
volume: 1,
|
|
||||||
muted: false,
|
|
||||||
resizeMode: ResizeMode.CONTAIN,
|
|
||||||
duration: 0.0,
|
|
||||||
currentTime: 0.0,
|
|
||||||
videoWidth: 0,
|
|
||||||
videoHeight: 0,
|
|
||||||
paused: false,
|
|
||||||
fullscreen: true,
|
|
||||||
decoration: true,
|
|
||||||
isLoading: false,
|
|
||||||
audioTracks: [],
|
|
||||||
textTracks: [],
|
|
||||||
videoTracks: [],
|
|
||||||
selectedAudioTrack: undefined,
|
|
||||||
selectedTextTrack: undefined,
|
|
||||||
selectedVideoTrack: {
|
|
||||||
type: SelectedVideoTrackType.AUTO,
|
|
||||||
},
|
|
||||||
srcListId: 0,
|
|
||||||
loop: false,
|
|
||||||
showRNVControls: false,
|
|
||||||
useCache: false,
|
|
||||||
poster: undefined,
|
|
||||||
showNotificationControls: false,
|
|
||||||
isSeeking: false,
|
|
||||||
};
|
|
||||||
|
|
||||||
// internal usage change to index if you want to select tracks by index instead of lang
|
|
||||||
textTracksSelectionBy = 'index';
|
|
||||||
|
|
||||||
srcAllPlatformList = [
|
|
||||||
{
|
|
||||||
description: 'local file landscape',
|
|
||||||
uri: require('./broadchurch.mp4'),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
description: 'local file landscape cropped',
|
|
||||||
uri: require('./broadchurch.mp4'),
|
|
||||||
cropStart: 3000,
|
|
||||||
cropEnd: 10000,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
description: 'local file portrait',
|
|
||||||
uri: require('./portrait.mp4'),
|
|
||||||
metadata: {
|
|
||||||
title: 'Test Title',
|
|
||||||
subtitle: 'Test Subtitle',
|
|
||||||
artist: 'Test Artist',
|
|
||||||
description: 'Test Description',
|
|
||||||
imageUri:
|
|
||||||
'https://pbs.twimg.com/profile_images/1498641868397191170/6qW2XkuI_400x400.png',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
description: '(hls|live) red bull tv',
|
|
||||||
textTracksAllowChunklessPreparation: false,
|
|
||||||
uri: 'https://rbmn-live.akamaized.net/hls/live/590964/BoRB-AT/master_928.m3u8',
|
|
||||||
metadata: {
|
|
||||||
title: 'Custom Title',
|
|
||||||
subtitle: 'Custom Subtitle',
|
|
||||||
artist: 'Custom Artist',
|
|
||||||
description: 'Custom Description',
|
|
||||||
imageUri:
|
|
||||||
'https://pbs.twimg.com/profile_images/1498641868397191170/6qW2XkuI_400x400.png',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
description: 'invalid URL',
|
|
||||||
uri: 'mmt://www.youtube.com',
|
|
||||||
type: 'mpd',
|
|
||||||
},
|
|
||||||
{description: '(no url) Stopped playback', uri: undefined},
|
|
||||||
{
|
|
||||||
description: '(no view) no View',
|
|
||||||
noView: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
description: 'Another live sample',
|
|
||||||
uri: 'https://live.forstreet.cl/live/livestream.m3u8',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
description: 'another bunny (can be saved)',
|
|
||||||
uri: 'https://rawgit.com/mediaelement/mediaelement-files/master/big_buck_bunny.mp4',
|
|
||||||
headers: {referer: 'www.github.com', 'User-Agent': 'react.native.video'},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
description: 'sintel with subtitles',
|
|
||||||
uri: 'https://bitmovin-a.akamaihd.net/content/sintel/hls/playlist.m3u8',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
description: 'sintel starts at 20sec',
|
|
||||||
uri: 'https://bitmovin-a.akamaihd.net/content/sintel/hls/playlist.m3u8',
|
|
||||||
startPosition: 50000,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
description: 'BigBugBunny sideLoaded subtitles',
|
|
||||||
// sideloaded subtitles wont work for streaming like HLS on ios
|
|
||||||
// mp4
|
|
||||||
uri: 'https://d23dyxeqlo5psv.cloudfront.net/big_buck_bunny.mp4',
|
|
||||||
textTracks: [
|
|
||||||
{
|
|
||||||
title: 'test',
|
|
||||||
language: 'en' as ISO639_1,
|
|
||||||
type: TextTrackType.VTT,
|
|
||||||
uri: 'https://bitdash-a.akamaihd.net/content/sintel/subtitles/subtitles_en.vtt',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
];
|
|
||||||
|
|
||||||
srcIosList = [];
|
|
||||||
|
|
||||||
srcAndroidList = [
|
|
||||||
{
|
|
||||||
description: 'Another live sample',
|
|
||||||
uri: 'https://live.forstreet.cl/live/livestream.m3u8',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
description: 'asset file',
|
|
||||||
uri: 'asset:///broadchurch.mp4',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
description: '(dash) sintel subtitles',
|
|
||||||
uri: 'https://bitmovin-a.akamaihd.net/content/sintel/sintel.mpd',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
description: '(mp4) big buck bunny',
|
|
||||||
uri: 'http://d23dyxeqlo5psv.cloudfront.net/big_buck_bunny.mp4',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
description: '(mp4|subtitles) demo with sintel Subtitles',
|
|
||||||
uri: 'http://www.youtube.com/api/manifest/dash/id/bf5bb2419360daf1/source/youtube?as=fmp4_audio_clear,fmp4_sd_hd_clear&sparams=ip,ipbits,expire,source,id,as&ip=0.0.0.0&ipbits=0&expire=19000000000&signature=51AF5F39AB0CEC3E5497CD9C900EBFEAECCCB5C7.8506521BFC350652163895D4C26DEE124209AA9E&key=ik0',
|
|
||||||
type: 'mpd',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
description: '(mp4) big buck bunny With Ads',
|
|
||||||
adTagUrl:
|
|
||||||
'https://pubads.g.doubleclick.net/gampad/ads?iu=/21775744923/external/vmap_ad_samples&sz=640x480&cust_params=sample_ar%3Dpremidpostoptimizedpodbumper&ciu_szs=300x250&gdfp_req=1&ad_rule=1&output=vmap&unviewed_position_start=1&env=vp&impl=s&cmsid=496&vid=short_onecue&correlator=',
|
|
||||||
uri: 'http://d23dyxeqlo5psv.cloudfront.net/big_buck_bunny.mp4',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
description: 'WV: Secure SD & HD (cbcs,MP4,H264)',
|
|
||||||
uri: 'https://storage.googleapis.com/wvmedia/cbcs/h264/tears/tears_aes_cbcs.mpd',
|
|
||||||
drm: {
|
|
||||||
type: DRMType.WIDEVINE,
|
|
||||||
licenseServer:
|
|
||||||
'https://proxy.uat.widevine.com/proxy?provider=widevine_test',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
description: 'Secure UHD (cenc)',
|
|
||||||
uri: 'https://storage.googleapis.com/wvmedia/cenc/h264/tears/tears_uhd.mpd',
|
|
||||||
drm: {
|
|
||||||
type: DRMType.WIDEVINE,
|
|
||||||
licenseServer:
|
|
||||||
'https://proxy.uat.widevine.com/proxy?provider=widevine_test',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
description: 'rtsp big bug bunny',
|
|
||||||
uri: 'rtsp://rtspstream:3cfa3c36a9c00f4aa38f3cd35816b287@zephyr.rtsp.stream/movie',
|
|
||||||
type: 'rtsp',
|
|
||||||
},
|
|
||||||
];
|
|
||||||
|
|
||||||
// poster which can be displayed
|
|
||||||
samplePoster =
|
|
||||||
'https://upload.wikimedia.org/wikipedia/commons/1/18/React_Native_Logo.png';
|
|
||||||
|
|
||||||
srcList: SampleVideoSource[] = this.srcAllPlatformList.concat(
|
|
||||||
Platform.OS === 'android' ? this.srcAndroidList : this.srcIosList,
|
|
||||||
);
|
|
||||||
|
|
||||||
video?: VideoRef;
|
|
||||||
|
|
||||||
popupInfo = () => {
|
|
||||||
VideoDecoderProperties.getWidevineLevel().then((widevineLevel: number) => {
|
|
||||||
VideoDecoderProperties.isHEVCSupported().then((hevc: string) => {
|
|
||||||
VideoDecoderProperties.isCodecSupported('video/avc', 1920, 1080).then(
|
|
||||||
(avc: string) => {
|
|
||||||
this.toast(
|
|
||||||
true,
|
|
||||||
'Widevine level: ' +
|
|
||||||
widevineLevel +
|
|
||||||
'\n hevc: ' +
|
|
||||||
hevc +
|
|
||||||
'\n avc: ' +
|
|
||||||
avc,
|
|
||||||
);
|
|
||||||
},
|
|
||||||
);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
onLoad = (data: OnLoadData) => {
|
|
||||||
this.setState({duration: data.duration, loading: false});
|
|
||||||
this.onAudioTracks(data);
|
|
||||||
this.onTextTracks(data);
|
|
||||||
this.onVideoTracks(data);
|
|
||||||
};
|
|
||||||
|
|
||||||
onProgress = (data: OnProgressData) => {
|
|
||||||
this.setState({currentTime: data.currentTime});
|
|
||||||
};
|
|
||||||
|
|
||||||
onSeek = (data: OnSeekData) => {
|
|
||||||
this.setState({isSeeking: false});
|
|
||||||
this.setState({currentTime: data.currentTime});
|
|
||||||
};
|
|
||||||
|
|
||||||
onVideoLoadStart = () => {
|
|
||||||
console.log('onVideoLoadStart');
|
|
||||||
this.setState({isLoading: true});
|
|
||||||
};
|
|
||||||
|
|
||||||
onAudioTracks = (data: OnAudioTracksData) => {
|
|
||||||
const selectedTrack = data.audioTracks?.find((x: AudioTrack) => {
|
|
||||||
return x.selected;
|
|
||||||
});
|
|
||||||
if (selectedTrack?.index) {
|
|
||||||
this.setState({
|
|
||||||
audioTracks: data.audioTracks,
|
|
||||||
selectedAudioTrack: {
|
|
||||||
type: SelectedVideoTrackType.INDEX,
|
|
||||||
value: selectedTrack?.index,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
this.setState({
|
|
||||||
audioTracks: data.audioTracks,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
onVideoTracks = (data: OnVideoTracksData) => {
|
|
||||||
console.log('onVideoTracks', data.videoTracks);
|
|
||||||
this.setState({
|
|
||||||
videoTracks: data.videoTracks,
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
onTextTracks = (data: OnTextTracksData) => {
|
|
||||||
const selectedTrack = data.textTracks?.find((x: TextTrack) => {
|
|
||||||
return x?.selected;
|
|
||||||
});
|
|
||||||
|
|
||||||
if (selectedTrack?.language) {
|
|
||||||
this.setState({
|
|
||||||
textTracks: data.textTracks,
|
|
||||||
selectedTextTrack:
|
|
||||||
this.textTracksSelectionBy === 'index'
|
|
||||||
? {
|
|
||||||
type: 'index',
|
|
||||||
value: selectedTrack?.index,
|
|
||||||
}
|
|
||||||
: {
|
|
||||||
type: 'language',
|
|
||||||
value: selectedTrack?.language,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
this.setState({
|
|
||||||
textTracks: data.textTracks,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
onTextTrackDataChanged = (data: OnTextTrackDataChangedData) => {
|
|
||||||
console.log(`Subtitles: ${JSON.stringify(data, null, 2)}`);
|
|
||||||
};
|
|
||||||
|
|
||||||
onAspectRatio = (data: OnVideoAspectRatioData) => {
|
|
||||||
console.log('onAspectRadio called ' + JSON.stringify(data));
|
|
||||||
this.setState({
|
|
||||||
videoWidth: data.width,
|
|
||||||
videoHeight: data.height,
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
onVideoBuffer = (param: OnBufferData) => {
|
|
||||||
console.log('onVideoBuffer');
|
|
||||||
this.setState({isLoading: param.isBuffering});
|
|
||||||
};
|
|
||||||
|
|
||||||
onReadyForDisplay = () => {
|
|
||||||
console.log('onReadyForDisplay');
|
|
||||||
this.setState({isLoading: false});
|
|
||||||
};
|
|
||||||
|
|
||||||
onAudioBecomingNoisy = () => {
|
|
||||||
this.setState({paused: true});
|
|
||||||
};
|
|
||||||
|
|
||||||
onAudioFocusChanged = (event: OnAudioFocusChangedData) => {
|
|
||||||
this.setState({paused: !event.hasAudioFocus});
|
|
||||||
};
|
|
||||||
|
|
||||||
toast = (visible: boolean, message: string) => {
|
|
||||||
if (visible) {
|
|
||||||
if (Platform.OS === 'android') {
|
|
||||||
ToastAndroid.showWithGravityAndOffset(
|
|
||||||
message,
|
|
||||||
ToastAndroid.LONG,
|
|
||||||
ToastAndroid.BOTTOM,
|
|
||||||
25,
|
|
||||||
50,
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
Alert.alert(message, message);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
onError = (err: OnVideoErrorData) => {
|
|
||||||
console.log(JSON.stringify(err));
|
|
||||||
this.toast(true, 'error: ' + JSON.stringify(err));
|
|
||||||
};
|
|
||||||
|
|
||||||
onEnd = () => {
|
|
||||||
if (!this.state.loop) {
|
|
||||||
this.channelUp();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
onPlaybackRateChange = (data: OnPlaybackRateChangeData) => {
|
|
||||||
console.log('onPlaybackRateChange', data);
|
|
||||||
};
|
|
||||||
|
|
||||||
onPlaybackStateChanged = (data: OnPlaybackStateChangedData) => {
|
|
||||||
console.log('onPlaybackStateChanged', data);
|
|
||||||
};
|
|
||||||
|
|
||||||
toggleFullscreen() {
|
|
||||||
this.setState({fullscreen: !this.state.fullscreen});
|
|
||||||
}
|
|
||||||
toggleControls() {
|
|
||||||
this.setState({showRNVControls: !this.state.showRNVControls});
|
|
||||||
}
|
|
||||||
|
|
||||||
toggleDecoration() {
|
|
||||||
this.setState({decoration: !this.state.decoration});
|
|
||||||
this.video?.setFullScreen(!this.state.decoration);
|
|
||||||
}
|
|
||||||
|
|
||||||
toggleShowNotificationControls() {
|
|
||||||
this.setState({
|
|
||||||
showNotificationControls: !this.state.showNotificationControls,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
goToChannel(channel: number) {
|
|
||||||
this.setState({
|
|
||||||
srcListId: channel,
|
|
||||||
duration: 0.0,
|
|
||||||
currentTime: 0.0,
|
|
||||||
videoWidth: 0,
|
|
||||||
videoHeight: 0,
|
|
||||||
isLoading: false,
|
|
||||||
audioTracks: [],
|
|
||||||
textTracks: [],
|
|
||||||
selectedAudioTrack: undefined,
|
|
||||||
selectedTextTrack: undefined,
|
|
||||||
selectedVideoTrack: {
|
|
||||||
type: SelectedVideoTrackType.AUTO,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
channelUp() {
|
|
||||||
console.log('channel up');
|
|
||||||
this.goToChannel((this.state.srcListId + 1) % this.srcList.length);
|
|
||||||
}
|
|
||||||
|
|
||||||
channelDown() {
|
|
||||||
console.log('channel down');
|
|
||||||
this.goToChannel(
|
|
||||||
(this.state.srcListId + this.srcList.length - 1) % this.srcList.length,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
videoSeek(position: number) {
|
|
||||||
this.setState({isSeeking: true});
|
|
||||||
this.video?.seek(position);
|
|
||||||
}
|
|
||||||
|
|
||||||
renderSeekBar() {
|
|
||||||
return (
|
|
||||||
<Seeker
|
|
||||||
currentTime={this.state.currentTime}
|
|
||||||
duration={this.state.duration}
|
|
||||||
isLoading={this.state.isLoading}
|
|
||||||
videoSeek={prop => this.videoSeek(prop)}
|
|
||||||
isUISeeking={this.state.isSeeking}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
IndicatorLoadingView() {
|
|
||||||
if (this.state.isLoading) {
|
|
||||||
return (
|
|
||||||
<ActivityIndicator
|
|
||||||
color="#3235fd"
|
|
||||||
size="large"
|
|
||||||
style={styles.IndicatorStyle}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
return <View />;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
renderTopControl() {
|
|
||||||
return (
|
|
||||||
<View style={styles.topControlsContainer}>
|
|
||||||
<Text style={styles.controlOption}>
|
|
||||||
{(this.srcList[this.state.srcListId] as AdditionnalSourceInfo)
|
|
||||||
?.description || 'local file'}
|
|
||||||
</Text>
|
|
||||||
<View>
|
|
||||||
<TouchableOpacity
|
|
||||||
onPress={() => {
|
|
||||||
this.toggleControls();
|
|
||||||
}}>
|
|
||||||
<Text style={styles.leftRightControlOption}>
|
|
||||||
{this.state.showRNVControls ? 'Hide controls' : 'Show controls'}
|
|
||||||
</Text>
|
|
||||||
</TouchableOpacity>
|
|
||||||
</View>
|
|
||||||
</View>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
onRateSelected = (value: MultiValueControlPropType) => {
|
|
||||||
this.setState({rate: value});
|
|
||||||
};
|
|
||||||
onVolumeSelected = (value: MultiValueControlPropType) => {
|
|
||||||
this.setState({volume: value});
|
|
||||||
};
|
|
||||||
onResizeModeSelected = (value: MultiValueControlPropType) => {
|
|
||||||
this.setState({resizeMode: value});
|
|
||||||
};
|
|
||||||
|
|
||||||
onSelectedAudioTrackChange = (itemValue: string) => {
|
|
||||||
console.log('on audio value change ' + itemValue);
|
|
||||||
if (itemValue === 'none') {
|
|
||||||
this.setState({
|
|
||||||
selectedAudioTrack: SelectedVideoTrackType.DISABLED,
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
this.setState({
|
|
||||||
selectedAudioTrack: {
|
|
||||||
type: SelectedVideoTrackType.INDEX,
|
|
||||||
value: itemValue,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
onSelectedTextTrackChange = (itemValue: string) => {
|
|
||||||
console.log('on value change ' + itemValue);
|
|
||||||
this.setState({
|
|
||||||
selectedTextTrack: {
|
|
||||||
type: this.textTracksSelectionBy === 'index' ? 'index' : 'language',
|
|
||||||
value: itemValue,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
onSelectedVideoTrackChange = (itemValue: string) => {
|
|
||||||
console.log('on value change ' + itemValue);
|
|
||||||
if (itemValue === undefined || itemValue === 'auto') {
|
|
||||||
this.setState({
|
|
||||||
selectedVideoTrack: {
|
|
||||||
type: SelectedVideoTrackType.AUTO,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
this.setState({
|
|
||||||
selectedVideoTrack: {
|
|
||||||
type: SelectedVideoTrackType.INDEX,
|
|
||||||
value: itemValue,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
renderOverlay() {
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
{this.IndicatorLoadingView()}
|
|
||||||
<View style={styles.topControls}>
|
|
||||||
<View style={styles.resizeModeControl}>
|
|
||||||
{this.renderTopControl()}
|
|
||||||
</View>
|
|
||||||
</View>
|
|
||||||
{!this.state.showRNVControls ? (
|
|
||||||
<>
|
|
||||||
<View style={styles.leftControls}>
|
|
||||||
<ToggleControl
|
|
||||||
onPress={() => {
|
|
||||||
this.channelDown();
|
|
||||||
}}
|
|
||||||
text="ChDown"
|
|
||||||
/>
|
|
||||||
</View>
|
|
||||||
<View style={styles.rightControls}>
|
|
||||||
<ToggleControl
|
|
||||||
onPress={() => {
|
|
||||||
this.channelUp();
|
|
||||||
}}
|
|
||||||
text="ChUp"
|
|
||||||
/>
|
|
||||||
</View>
|
|
||||||
<View style={styles.bottomControls}>
|
|
||||||
<View style={styles.generalControls}>
|
|
||||||
{Platform.OS === 'android' ? (
|
|
||||||
<View style={styles.generalControls}>
|
|
||||||
<ToggleControl
|
|
||||||
onPress={() => {
|
|
||||||
this.popupInfo();
|
|
||||||
}}
|
|
||||||
text="decoderInfo"
|
|
||||||
/>
|
|
||||||
<ToggleControl
|
|
||||||
isSelected={this.state.useCache}
|
|
||||||
onPress={() => {
|
|
||||||
this.setState({useCache: !this.state.useCache});
|
|
||||||
}}
|
|
||||||
selectedText="enable cache"
|
|
||||||
unselectedText="disable cache"
|
|
||||||
/>
|
|
||||||
</View>
|
|
||||||
) : null}
|
|
||||||
<ToggleControl
|
|
||||||
isSelected={this.state.paused}
|
|
||||||
onPress={() => {
|
|
||||||
this.setState({paused: !this.state.paused});
|
|
||||||
}}
|
|
||||||
selectedText="pause"
|
|
||||||
unselectedText="playing"
|
|
||||||
/>
|
|
||||||
<ToggleControl
|
|
||||||
isSelected={this.state.loop}
|
|
||||||
onPress={() => {
|
|
||||||
this.setState({loop: !this.state.loop});
|
|
||||||
}}
|
|
||||||
selectedText="loop enable"
|
|
||||||
unselectedText="loop disable"
|
|
||||||
/>
|
|
||||||
<ToggleControl
|
|
||||||
onPress={() => {
|
|
||||||
this.toggleFullscreen();
|
|
||||||
}}
|
|
||||||
text="fullscreen"
|
|
||||||
/>
|
|
||||||
<ToggleControl
|
|
||||||
onPress={() => {
|
|
||||||
this.toggleDecoration();
|
|
||||||
}}
|
|
||||||
text="decoration"
|
|
||||||
/>
|
|
||||||
<ToggleControl
|
|
||||||
isSelected={!!this.state.poster}
|
|
||||||
onPress={() => {
|
|
||||||
this.setState({
|
|
||||||
poster: this.state.poster ? undefined : this.samplePoster,
|
|
||||||
});
|
|
||||||
}}
|
|
||||||
selectedText="poster"
|
|
||||||
unselectedText="no poster"
|
|
||||||
/>
|
|
||||||
<ToggleControl
|
|
||||||
isSelected={this.state.showNotificationControls}
|
|
||||||
onPress={() => {
|
|
||||||
this.toggleShowNotificationControls();
|
|
||||||
}}
|
|
||||||
selectedText="hide notification controls"
|
|
||||||
unselectedText="show notification controls"
|
|
||||||
/>
|
|
||||||
</View>
|
|
||||||
<View style={styles.generalControls}>
|
|
||||||
{/* shall be replaced by slider */}
|
|
||||||
<MultiValueControl
|
|
||||||
values={[0, 0.25, 0.5, 1.0, 1.5, 2.0]}
|
|
||||||
onPress={this.onRateSelected}
|
|
||||||
selected={this.state.rate}
|
|
||||||
/>
|
|
||||||
{/* shall be replaced by slider */}
|
|
||||||
<MultiValueControl
|
|
||||||
values={[0.5, 1, 1.5]}
|
|
||||||
onPress={this.onVolumeSelected}
|
|
||||||
selected={this.state.volume}
|
|
||||||
/>
|
|
||||||
<MultiValueControl
|
|
||||||
values={[
|
|
||||||
ResizeMode.COVER,
|
|
||||||
ResizeMode.CONTAIN,
|
|
||||||
ResizeMode.STRETCH,
|
|
||||||
]}
|
|
||||||
onPress={this.onResizeModeSelected}
|
|
||||||
selected={this.state.resizeMode}
|
|
||||||
/>
|
|
||||||
<ToggleControl
|
|
||||||
isSelected={this.state.muted}
|
|
||||||
onPress={() => {
|
|
||||||
this.setState({muted: !this.state.muted});
|
|
||||||
}}
|
|
||||||
text="muted"
|
|
||||||
/>
|
|
||||||
{Platform.OS === 'ios' ? (
|
|
||||||
<ToggleControl
|
|
||||||
isSelected={this.state.paused}
|
|
||||||
onPress={() => {
|
|
||||||
this.video
|
|
||||||
?.save({})
|
|
||||||
?.then(response => {
|
|
||||||
console.log('Downloaded URI', response);
|
|
||||||
})
|
|
||||||
.catch(error => {
|
|
||||||
console.log('error during save ', error);
|
|
||||||
});
|
|
||||||
}}
|
|
||||||
text="save"
|
|
||||||
/>
|
|
||||||
) : null}
|
|
||||||
</View>
|
|
||||||
{this.renderSeekBar()}
|
|
||||||
<View style={styles.generalControls}>
|
|
||||||
<AudioTrackSelector
|
|
||||||
audioTracks={this.state.audioTracks}
|
|
||||||
selectedAudioTrack={this.state.selectedAudioTrack}
|
|
||||||
onValueChange={this.onSelectedAudioTrackChange}
|
|
||||||
/>
|
|
||||||
<TextTrackSelector
|
|
||||||
textTracks={this.state.textTracks}
|
|
||||||
selectedTextTrack={this.state.selectedTextTrack}
|
|
||||||
onValueChange={this.onSelectedTextTrackChange}
|
|
||||||
textTracksSelectionBy={this.textTracksSelectionBy}
|
|
||||||
/>
|
|
||||||
<VideoTrackSelector
|
|
||||||
videoTracks={this.state.videoTracks}
|
|
||||||
selectedVideoTrack={this.state.selectedVideoTrack}
|
|
||||||
onValueChange={this.onSelectedVideoTrackChange}
|
|
||||||
/>
|
|
||||||
</View>
|
|
||||||
</View>
|
|
||||||
</>
|
|
||||||
) : null}
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
renderVideoView() {
|
|
||||||
const viewStyle = this.state.fullscreen
|
|
||||||
? styles.fullScreen
|
|
||||||
: styles.halfScreen;
|
|
||||||
|
|
||||||
const currentSrc = this.srcList[this.state.srcListId];
|
|
||||||
const additionnal = currentSrc as AdditionnalSourceInfo;
|
|
||||||
|
|
||||||
return (
|
|
||||||
<TouchableOpacity style={viewStyle}>
|
|
||||||
<Video
|
|
||||||
showNotificationControls={this.state.showNotificationControls}
|
|
||||||
ref={(ref: VideoRef) => {
|
|
||||||
this.video = ref;
|
|
||||||
}}
|
|
||||||
source={currentSrc as ReactVideoSource}
|
|
||||||
textTracks={additionnal?.textTracks}
|
|
||||||
adTagUrl={additionnal?.adTagUrl}
|
|
||||||
drm={additionnal?.drm}
|
|
||||||
style={viewStyle}
|
|
||||||
rate={this.state.rate}
|
|
||||||
paused={this.state.paused}
|
|
||||||
volume={this.state.volume}
|
|
||||||
muted={this.state.muted}
|
|
||||||
fullscreen={this.state.fullscreen}
|
|
||||||
controls={this.state.showRNVControls}
|
|
||||||
resizeMode={this.state.resizeMode}
|
|
||||||
onLoad={this.onLoad}
|
|
||||||
onAudioTracks={this.onAudioTracks}
|
|
||||||
onTextTracks={this.onTextTracks}
|
|
||||||
onVideoTracks={this.onVideoTracks}
|
|
||||||
onTextTrackDataChanged={this.onTextTrackDataChanged}
|
|
||||||
onProgress={this.onProgress}
|
|
||||||
onEnd={this.onEnd}
|
|
||||||
progressUpdateInterval={1000}
|
|
||||||
onError={this.onError}
|
|
||||||
onAudioBecomingNoisy={this.onAudioBecomingNoisy}
|
|
||||||
onAudioFocusChanged={this.onAudioFocusChanged}
|
|
||||||
onLoadStart={this.onVideoLoadStart}
|
|
||||||
onAspectRatio={this.onAspectRatio}
|
|
||||||
onReadyForDisplay={this.onReadyForDisplay}
|
|
||||||
onBuffer={this.onVideoBuffer}
|
|
||||||
onSeek={this.onSeek}
|
|
||||||
repeat={this.state.loop}
|
|
||||||
selectedTextTrack={this.state.selectedTextTrack}
|
|
||||||
selectedAudioTrack={this.state.selectedAudioTrack}
|
|
||||||
selectedVideoTrack={this.state.selectedVideoTrack}
|
|
||||||
playInBackground={false}
|
|
||||||
bufferConfig={{
|
|
||||||
minBufferMs: 15000,
|
|
||||||
maxBufferMs: 50000,
|
|
||||||
bufferForPlaybackMs: 2500,
|
|
||||||
bufferForPlaybackAfterRebufferMs: 5000,
|
|
||||||
cacheSizeMB: this.state.useCache ? 200 : 0,
|
|
||||||
live: {
|
|
||||||
targetOffsetMs: 500,
|
|
||||||
},
|
|
||||||
}}
|
|
||||||
preventsDisplaySleepDuringVideoPlayback={true}
|
|
||||||
poster={this.state.poster}
|
|
||||||
onPlaybackRateChange={this.onPlaybackRateChange}
|
|
||||||
onPlaybackStateChanged={this.onPlaybackStateChanged}
|
|
||||||
bufferingStrategy={BufferingStrategyType.DEFAULT}
|
|
||||||
debug={{enable: true, thread: true}}
|
|
||||||
/>
|
|
||||||
</TouchableOpacity>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
render() {
|
|
||||||
return (
|
|
||||||
<View style={styles.container}>
|
|
||||||
{(this.srcList[this.state.srcListId] as AdditionnalSourceInfo)?.noView
|
|
||||||
? null
|
|
||||||
: this.renderVideoView()}
|
|
||||||
{this.renderOverlay()}
|
|
||||||
</View>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
export default VideoPlayer;
|
|
@ -1,13 +0,0 @@
|
|||||||
// prettier-ignore
|
|
||||||
{
|
|
||||||
"extends": "@react-native/typescript-config/tsconfig.json",
|
|
||||||
"compilerOptions": {
|
|
||||||
/* Visit https://aka.ms/tsconfig.json to read more about this file */
|
|
||||||
"paths": {
|
|
||||||
"react-native-video": ["../../src/index.ts"],
|
|
||||||
"react": [ "./node_modules/@types/react" ]
|
|
||||||
},
|
|
||||||
/* Completeness */
|
|
||||||
"skipLibCheck": true, /* Skip type checking all .d.ts files. */
|
|
||||||
}
|
|
||||||
}
|
|
172
examples/README.md
Normal file
172
examples/README.md
Normal file
@ -0,0 +1,172 @@
|
|||||||
|
# Examples
|
||||||
|
This directory contains examples for `react-native-video` - this is a guide that will show you what can you find here and how to use them.
|
||||||
|
|
||||||
|
## Examples Structure
|
||||||
|
|
||||||
|
- **[`bare`](#bare)** - Main example ([react-native-test-app](https://github.com/microsoft/react-native-test-app) - bare react-native app) that you can run on: iOS, Android, Windows, visionOS
|
||||||
|
|
||||||
|
- **[`expo`](#expo)** - Expo example that you can run on: iOS, Android, tvOS, web (support coming soon)
|
||||||
|
|
||||||
|
### Updating Examples Content
|
||||||
|
|
||||||
|
Both of applications have mostly the same code (Windows and tvOS have platform-specific code). Other platform are using codebase from `bare` example.
|
||||||
|
If you want to update examples content, you should do it in `bare` example. `expo` example is copping (and overwriting!) `src` folder from `bare` on dependency install.
|
||||||
|
If you want to sync `expo` example, you can use `yarn update-src` command in `expo` example directory.
|
||||||
|
|
||||||
|
## How To Run Examples
|
||||||
|
|
||||||
|
## [Bare](https://github.com/TheWidlarzGroup/react-native-video/tree/master/examples/bare)
|
||||||
|
|
||||||
|
### Configuration
|
||||||
|
|
||||||
|
You can configure the example by changing the settings of expo-plugin `app.json` file in the `bare` directory.
|
||||||
|
|
||||||
|
> [!TIP]
|
||||||
|
> You can find more information about the expo-plugin configuration [here](https://thewidlarzgroup.github.io/react-native-video/other/expo).
|
||||||
|
|
||||||
|
> [!CAUTION]
|
||||||
|
> You will need to regenerate the native project after changing the `app.json` file. eg. on Apple platforms you will need to install pods twice. (one for applying expo-plugin changes and second for applying react-native-video changes)
|
||||||
|
|
||||||
|
### Building
|
||||||
|
1. Install dependency in repository root directory
|
||||||
|
```bash
|
||||||
|
yarn install
|
||||||
|
```
|
||||||
|
|
||||||
|
2. Install dependency in `bare` example directory
|
||||||
|
```bash
|
||||||
|
cd examples/bare && yarn install
|
||||||
|
```
|
||||||
|
|
||||||
|
3. Now you will need to generate native project for platform you want to run the example on.
|
||||||
|
- For iOS / visionOS:
|
||||||
|
Install pods in `ios` / `visionOS` directory
|
||||||
|
```bash
|
||||||
|
# for ios
|
||||||
|
pod install --project-directory=ios
|
||||||
|
# for visionOS
|
||||||
|
pod install --project-directory=visionos
|
||||||
|
```
|
||||||
|
> [!IMPORTANT]
|
||||||
|
> You will need to hit it twice, because expo-plugin changes are not applied in the first run.
|
||||||
|
> [!TIP]
|
||||||
|
> Make sure you've already downloaded the visionOS simulator on which you want to launch the app.
|
||||||
|
|
||||||
|
Now you are ready to run the App. (Flag `--interactive` is optional, but it is recommended as it allows you to choose the device you want to run the app on. Select `BareExample` scheme)
|
||||||
|
```bash
|
||||||
|
# for ios
|
||||||
|
yarn ios --interactive
|
||||||
|
# for visionOS
|
||||||
|
yarn visionos --interactive
|
||||||
|
```
|
||||||
|
|
||||||
|
- For Android:
|
||||||
|
There is no need to run any additional command. you can just run the App. (Flag `--interactive` is optional, but it is recommended as it allows you to choose the device you want to run the app on)
|
||||||
|
```bash
|
||||||
|
yarn android --interactive
|
||||||
|
```
|
||||||
|
|
||||||
|
- For Windows:
|
||||||
|
There is no need to run any additional command. you can just run the App.
|
||||||
|
```bash
|
||||||
|
yarn windows
|
||||||
|
```
|
||||||
|
|
||||||
|
If Metro Bundler is not running (or it did not start), you can start it by running:
|
||||||
|
```bash
|
||||||
|
yarn start
|
||||||
|
```
|
||||||
|
|
||||||
|
## [Expo](https://github.com/TheWidlarzGroup/react-native-video/tree/master/examples/bare)
|
||||||
|
|
||||||
|
### Configuration
|
||||||
|
|
||||||
|
#### Expo Plugin
|
||||||
|
You can configure the example by changing the settings of expo-plugin `app.json` file in the `expo` directory.
|
||||||
|
|
||||||
|
> [!TIP]
|
||||||
|
> You can find more information about the expo-plugin configuration [here](https://thewidlarzgroup.github.io/react-native-video/other/expo).
|
||||||
|
|
||||||
|
> [!CAUTION]
|
||||||
|
> You will need to regenerate the native project after changing the `app.json` file - you can do it by running `yarn prebuild` command in `expo` example directory.
|
||||||
|
|
||||||
|
#### Switching between Mobile and TV
|
||||||
|
If you want to switch between mobile and TV version of the app you will need to regenerate the native project. You can do it by running `yarn prebuild:tv` command in `expo` example directory.
|
||||||
|
|
||||||
|
|
||||||
|
### Building
|
||||||
|
1. Install dependency in repository root directory
|
||||||
|
```bash
|
||||||
|
yarn install
|
||||||
|
```
|
||||||
|
|
||||||
|
2. Install dependency in `expo` example directory
|
||||||
|
```bash
|
||||||
|
cd examples/expo && yarn install
|
||||||
|
```
|
||||||
|
|
||||||
|
3. Now you will need to generate native project for platform you want to run the example on.
|
||||||
|
If you want to use example on tv you should read [Switching between Mobile and TV](#switching-between-mobile-and-tv) section.
|
||||||
|
|
||||||
|
- For iOS / tvOS:
|
||||||
|
Install pods in `ios` directory
|
||||||
|
```bash
|
||||||
|
pod install --project-directory=ios
|
||||||
|
```
|
||||||
|
|
||||||
|
Now you are ready to run the App. (Flag `--device` is optional, but it is recommended as it allows you to choose the device you want to run the app on)
|
||||||
|
```bash
|
||||||
|
# for ios
|
||||||
|
yarn ios --device
|
||||||
|
# for tvOS
|
||||||
|
yarn ios:tv --device
|
||||||
|
```
|
||||||
|
|
||||||
|
- For Android / Android TV:
|
||||||
|
There is no need to run any additional command. you can just run the App. (Flag `--device` is optional, but it is recommended as it allows you to choose the device you want to run the app on)
|
||||||
|
```bash
|
||||||
|
# for android
|
||||||
|
yarn android --device
|
||||||
|
# for android tv
|
||||||
|
yarn android:tv --device
|
||||||
|
```
|
||||||
|
|
||||||
|
> [!WARNING]
|
||||||
|
> Setup for android is not complete yet. Please use bare app for android testing.
|
||||||
|
|
||||||
|
- For Web:
|
||||||
|
Support for web is coming soon.
|
||||||
|
|
||||||
|
If Metro Bundler is not running (or it did not start), you can start it by running:
|
||||||
|
```bash
|
||||||
|
yarn start
|
||||||
|
```
|
||||||
|
|
||||||
|
## For Maintainers
|
||||||
|
|
||||||
|
### Opening React Native Video in Android Studio / Xcode
|
||||||
|
To open `react-native-video` in Android Studio / Xcode you need to open `examples/bare/android` or `examples/bare/ios` directory.
|
||||||
|
First, you need to follow the [How To Run Examples](#how-to-run-examples) guide to generate the native project. Then you can open the project in Android Studio / Xcode by running below command in `examples/bare` directory.
|
||||||
|
```bash
|
||||||
|
# for android
|
||||||
|
studio ./android
|
||||||
|
# for ios
|
||||||
|
xed ./ios
|
||||||
|
```
|
||||||
|
|
||||||
|
### Updating Examples
|
||||||
|
|
||||||
|
#### Bare
|
||||||
|
Because `bare` example is using react-native-test-app it is very easy to update it.
|
||||||
|
|
||||||
|
1. Change version of `react-native` in `package.json` file in `bare` directory.
|
||||||
|
2. Hit below command and verify if everything is working correctly - RN_VERSION should be the version you want to update to.
|
||||||
|
```bash
|
||||||
|
npx @rnx-kit/align-deps@latest --requirements react-native@RN_VERSION --write
|
||||||
|
```
|
||||||
|
|
||||||
|
That's it! Now you can commit changes and create a PR.
|
||||||
|
|
||||||
|
#### Expo
|
||||||
|
To update `expo` example you should follow this [guide](https://docs.expo.dev/workflow/upgrading-expo-sdk-walkthrough).
|
||||||
|
After updating `expo` example you will need to use prebuild (yarn expo prebuild) - if it fails you will need to add `--clean` flag to the command - this will remove manual link of `react-native-video` package so you will need to link it again.
|
16
examples/bare/.gitignore
vendored
Normal file
16
examples/bare/.gitignore
vendored
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
*.binlog
|
||||||
|
*.hprof
|
||||||
|
*.xcworkspace/
|
||||||
|
*.zip
|
||||||
|
.DS_Store
|
||||||
|
.gradle/
|
||||||
|
.idea/
|
||||||
|
.vs/
|
||||||
|
.xcode.env
|
||||||
|
Pods/
|
||||||
|
build/
|
||||||
|
dist/*
|
||||||
|
!dist/.gitignore
|
||||||
|
local.properties
|
||||||
|
msbuild.binlog
|
||||||
|
node_modules/
|
1
examples/bare/.watchmanconfig
Normal file
1
examples/bare/.watchmanconfig
Normal file
@ -0,0 +1 @@
|
|||||||
|
{}
|
48
examples/bare/android/build.gradle
Normal file
48
examples/bare/android/build.gradle
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
buildscript {
|
||||||
|
apply(from: {
|
||||||
|
def searchDir = rootDir.toPath()
|
||||||
|
do {
|
||||||
|
def p = searchDir.resolve("node_modules/react-native-test-app/android/dependencies.gradle")
|
||||||
|
if (p.toFile().exists()) {
|
||||||
|
return p.toRealPath().toString()
|
||||||
|
}
|
||||||
|
} while (searchDir = searchDir.getParent())
|
||||||
|
throw new GradleException("Could not find `react-native-test-app`");
|
||||||
|
}())
|
||||||
|
|
||||||
|
repositories {
|
||||||
|
mavenCentral()
|
||||||
|
google()
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
getReactNativeDependencies().each { dependency ->
|
||||||
|
classpath(dependency)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ext {
|
||||||
|
// For CI builds
|
||||||
|
useExoplayerIMA = System.getenv("RNV_SAMPLE_ENABLE_ADS") ?: false
|
||||||
|
}
|
||||||
|
|
||||||
|
allprojects {
|
||||||
|
repositories {
|
||||||
|
maven {
|
||||||
|
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
|
||||||
|
url({
|
||||||
|
def searchDir = rootDir.toPath()
|
||||||
|
do {
|
||||||
|
def p = searchDir.resolve("node_modules/react-native/android")
|
||||||
|
if (p.toFile().exists()) {
|
||||||
|
return p.toRealPath().toString()
|
||||||
|
}
|
||||||
|
} while (searchDir = searchDir.getParent())
|
||||||
|
throw new GradleException("Could not find `react-native`");
|
||||||
|
}())
|
||||||
|
}
|
||||||
|
mavenCentral()
|
||||||
|
google()
|
||||||
|
}
|
||||||
|
}
|
@ -7,15 +7,18 @@
|
|||||||
# For more details on how to configure your build environment visit
|
# For more details on how to configure your build environment visit
|
||||||
# http://www.gradle.org/docs/current/userguide/build_environment.html
|
# http://www.gradle.org/docs/current/userguide/build_environment.html
|
||||||
|
|
||||||
# Specifies the JVM arguments used for the daemon process.
|
# Specifies the JVM arguments used for the Gradle Daemon. The setting is
|
||||||
# The setting is particularly useful for tweaking memory settings.
|
# particularly useful for configuring JVM memory settings for build performance.
|
||||||
# Default value: -Xmx512m -XX:MaxMetaspaceSize=256m
|
# This does not affect the JVM settings for the Gradle client VM.
|
||||||
org.gradle.jvmargs=-Xmx4096m -XX:MaxMetaspaceSize=512m
|
# The default is `-Xmx512m -XX:MaxMetaspaceSize=256m`.
|
||||||
|
org.gradle.jvmargs=-Xmx2g -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
|
||||||
|
|
||||||
# When configured, Gradle will run in incubating parallel mode.
|
# When configured, Gradle will fork up to org.gradle.workers.max JVMs to execute
|
||||||
# This option should only be used with decoupled projects. More details, visit
|
# projects in parallel. To learn more about parallel task execution, see the
|
||||||
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
|
# section on Gradle build performance:
|
||||||
# org.gradle.parallel=true
|
# https://docs.gradle.org/current/userguide/performance.html#parallel_execution.
|
||||||
|
# Default is `false`.
|
||||||
|
#org.gradle.parallel=true
|
||||||
|
|
||||||
# AndroidX package structure to make it clearer which packages are bundled with the
|
# AndroidX package structure to make it clearer which packages are bundled with the
|
||||||
# Android operating system, and which are packaged with your app's APK
|
# Android operating system, and which are packaged with your app's APK
|
||||||
@ -23,6 +26,8 @@ org.gradle.jvmargs=-Xmx4096m -XX:MaxMetaspaceSize=512m
|
|||||||
android.useAndroidX=true
|
android.useAndroidX=true
|
||||||
# Automatically convert third-party libraries to use AndroidX
|
# Automatically convert third-party libraries to use AndroidX
|
||||||
android.enableJetifier=true
|
android.enableJetifier=true
|
||||||
|
# Jetifier randomly fails on these libraries
|
||||||
|
android.jetifier.ignorelist=hermes-android,react-android
|
||||||
|
|
||||||
# Use this property to specify which architecture you want to build.
|
# Use this property to specify which architecture you want to build.
|
||||||
# You can also override it from the CLI using
|
# You can also override it from the CLI using
|
||||||
@ -34,8 +39,15 @@ reactNativeArchitectures=armeabi-v7a,arm64-v8a,x86,x86_64
|
|||||||
# your application. You should enable this flag either if you want
|
# your application. You should enable this flag either if you want
|
||||||
# to write custom TurboModules/Fabric components OR use libraries that
|
# to write custom TurboModules/Fabric components OR use libraries that
|
||||||
# are providing them.
|
# are providing them.
|
||||||
newArchEnabled=false
|
# Note that this is incompatible with web debugging.
|
||||||
|
#newArchEnabled=true
|
||||||
|
#bridgelessEnabled=true
|
||||||
|
|
||||||
# Use this property to enable or disable the Hermes JS engine.
|
# Uncomment the line below to build React Native from source.
|
||||||
# If set to false, you will be using JSC instead.
|
#react.buildFromSource=true
|
||||||
hermesEnabled=true
|
|
||||||
|
# Version of Android NDK to build against.
|
||||||
|
#ANDROID_NDK_VERSION=26.1.10909125
|
||||||
|
|
||||||
|
# Version of Kotlin to build against.
|
||||||
|
#KOTLIN_VERSION=1.8.22
|
BIN
examples/bare/android/gradle/wrapper/gradle-wrapper.jar
vendored
Normal file
BIN
examples/bare/android/gradle/wrapper/gradle-wrapper.jar
vendored
Normal file
Binary file not shown.
@ -1,6 +1,6 @@
|
|||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-all.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
|
||||||
networkTimeout=10000
|
networkTimeout=10000
|
||||||
validateDistributionUrl=true
|
validateDistributionUrl=true
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
@ -55,7 +55,7 @@
|
|||||||
# Darwin, MinGW, and NonStop.
|
# Darwin, MinGW, and NonStop.
|
||||||
#
|
#
|
||||||
# (3) This script is generated from the Groovy template
|
# (3) This script is generated from the Groovy template
|
||||||
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||||
# within the Gradle project.
|
# within the Gradle project.
|
||||||
#
|
#
|
||||||
# You can find Gradle at https://github.com/gradle/gradle/.
|
# You can find Gradle at https://github.com/gradle/gradle/.
|
||||||
@ -145,7 +145,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
|||||||
case $MAX_FD in #(
|
case $MAX_FD in #(
|
||||||
max*)
|
max*)
|
||||||
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
|
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
|
||||||
# shellcheck disable=SC3045
|
# shellcheck disable=SC2039,SC3045
|
||||||
MAX_FD=$( ulimit -H -n ) ||
|
MAX_FD=$( ulimit -H -n ) ||
|
||||||
warn "Could not query maximum file descriptor limit"
|
warn "Could not query maximum file descriptor limit"
|
||||||
esac
|
esac
|
||||||
@ -153,7 +153,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
|||||||
'' | soft) :;; #(
|
'' | soft) :;; #(
|
||||||
*)
|
*)
|
||||||
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
|
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
|
||||||
# shellcheck disable=SC3045
|
# shellcheck disable=SC2039,SC3045
|
||||||
ulimit -n "$MAX_FD" ||
|
ulimit -n "$MAX_FD" ||
|
||||||
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
||||||
esac
|
esac
|
||||||
@ -202,11 +202,11 @@ fi
|
|||||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||||
|
|
||||||
# Collect all arguments for the java command;
|
# Collect all arguments for the java command:
|
||||||
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
|
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
|
||||||
# shell script including quotes and variable substitutions, so put them in
|
# and any embedded shellness will be escaped.
|
||||||
# double quotes to make sure that they get re-expanded; and
|
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
|
||||||
# * put everything else in single quotes, so that it's not re-expanded.
|
# treated as '${Hostname}' itself on the command line.
|
||||||
|
|
||||||
set -- \
|
set -- \
|
||||||
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
21
examples/bare/android/settings.gradle
Normal file
21
examples/bare/android/settings.gradle
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
pluginManagement {
|
||||||
|
repositories {
|
||||||
|
gradlePluginPortal()
|
||||||
|
mavenCentral()
|
||||||
|
google()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
rootProject.name = "BareExample"
|
||||||
|
|
||||||
|
apply(from: {
|
||||||
|
def searchDir = rootDir.toPath()
|
||||||
|
do {
|
||||||
|
def p = searchDir.resolve("node_modules/react-native-test-app/test-app.gradle")
|
||||||
|
if (p.toFile().exists()) {
|
||||||
|
return p.toRealPath().toString()
|
||||||
|
}
|
||||||
|
} while (searchDir = searchDir.getParent())
|
||||||
|
throw new GradleException("Could not find `react-native-test-app`");
|
||||||
|
}())
|
||||||
|
applyTestAppSettings(settings)
|
54
examples/bare/app.json
Normal file
54
examples/bare/app.json
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
{
|
||||||
|
"name": "BareExample",
|
||||||
|
"displayName": "BareExample",
|
||||||
|
"components": [
|
||||||
|
{
|
||||||
|
"appKey": "BareExample",
|
||||||
|
"displayName": "Basic Video Example"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"appKey": "DRMExample",
|
||||||
|
"displayName": "DRM Example"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"resources": {
|
||||||
|
"android": [
|
||||||
|
"dist/res",
|
||||||
|
"dist/main.android.jsbundle"
|
||||||
|
],
|
||||||
|
"ios": [
|
||||||
|
"dist/assets",
|
||||||
|
"dist/main.ios.jsbundle"
|
||||||
|
],
|
||||||
|
"macos": [
|
||||||
|
"dist/assets",
|
||||||
|
"dist/main.macos.jsbundle"
|
||||||
|
],
|
||||||
|
"visionos": [
|
||||||
|
"dist/assets",
|
||||||
|
"dist/main.visionos.jsbundle"
|
||||||
|
],
|
||||||
|
"windows": [
|
||||||
|
"dist/assets",
|
||||||
|
"dist/main.windows.bundle"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"plugins": [
|
||||||
|
[
|
||||||
|
"react-native-video",
|
||||||
|
{
|
||||||
|
"reactNativeTestApp": true,
|
||||||
|
"enableNotificationControls": true,
|
||||||
|
"enableBackgroundAudio": true,
|
||||||
|
"enableADSExtension": false,
|
||||||
|
"enableCacheExtension": false,
|
||||||
|
"androidExtensions": {
|
||||||
|
"useExoplayerRtsp": true,
|
||||||
|
"useExoplayerSmoothStreaming": true,
|
||||||
|
"useExoplayerHls": true,
|
||||||
|
"useExoplayerDash": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
]
|
||||||
|
}
|
3
examples/bare/babel.config.js
Normal file
3
examples/bare/babel.config.js
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
module.exports = {
|
||||||
|
presets: ['module:@react-native/babel-preset'],
|
||||||
|
};
|
11
examples/bare/index.js
Normal file
11
examples/bare/index.js
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
/**
|
||||||
|
* @format
|
||||||
|
*/
|
||||||
|
|
||||||
|
import {AppRegistry} from 'react-native';
|
||||||
|
import BasicExample from './src/BasicExample';
|
||||||
|
import {name as appName} from './app.json';
|
||||||
|
import DRMExample from './src/DRMExample';
|
||||||
|
|
||||||
|
AppRegistry.registerComponent(appName, () => BasicExample);
|
||||||
|
AppRegistry.registerComponent('DRMExample', () => DRMExample);
|
23
examples/bare/ios/Podfile
Normal file
23
examples/bare/ios/Podfile
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
ws_dir = Pathname.new(__dir__)
|
||||||
|
ws_dir = ws_dir.parent until
|
||||||
|
File.exist?("#{ws_dir}/node_modules/react-native-test-app/test_app.rb") ||
|
||||||
|
ws_dir.expand_path.to_s == '/'
|
||||||
|
require "#{ws_dir}/node_modules/react-native-test-app/test_app.rb"
|
||||||
|
|
||||||
|
workspace 'BareExample.xcworkspace'
|
||||||
|
|
||||||
|
use_test_app!
|
||||||
|
|
||||||
|
# This is used by CI to test different configurations
|
||||||
|
# If you want to enable it look to README.md
|
||||||
|
if ENV['RNV_SAMPLE_ENABLE_ADS']
|
||||||
|
$RNVideoUseGoogleIMA = true
|
||||||
|
end
|
||||||
|
if ENV['RNV_SAMPLE_VIDEO_CACHING']
|
||||||
|
$RNVideoUseVideoCaching = true
|
||||||
|
end
|
||||||
|
|
||||||
|
# Chache dependencies need to have modular headers
|
||||||
|
if defined?($RNVideoUseVideoCaching)
|
||||||
|
use_modular_headers!
|
||||||
|
end
|
File diff suppressed because it is too large
Load Diff
20
examples/bare/metro.config.js
Normal file
20
examples/bare/metro.config.js
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
const path = require('path');
|
||||||
|
const {makeMetroConfig} = require('@rnx-kit/metro-config');
|
||||||
|
|
||||||
|
module.exports = makeMetroConfig({
|
||||||
|
transformer: {
|
||||||
|
getTransformOptions: async () => ({
|
||||||
|
transform: {
|
||||||
|
experimentalImportSupport: false,
|
||||||
|
inlineRequires: false,
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
},
|
||||||
|
resolver: {
|
||||||
|
enableSymlinks: true,
|
||||||
|
},
|
||||||
|
watchFolders: [
|
||||||
|
path.join(__dirname, 'node_modules', 'react-native-video'),
|
||||||
|
path.resolve(__dirname, '../..'),
|
||||||
|
],
|
||||||
|
});
|
52
examples/bare/package.json
Normal file
52
examples/bare/package.json
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
{
|
||||||
|
"name": "BareExample",
|
||||||
|
"version": "0.0.1",
|
||||||
|
"private": true,
|
||||||
|
"scripts": {
|
||||||
|
"postinstall": "patch-package",
|
||||||
|
"android": "react-native run-android",
|
||||||
|
"build:android": "npm run mkdist && react-native bundle --entry-file index.js --platform android --dev true --bundle-output dist/main.android.jsbundle --assets-dest dist/res",
|
||||||
|
"build:ios": "npm run mkdist && react-native bundle --entry-file index.js --platform ios --dev true --bundle-output dist/main.ios.jsbundle --assets-dest dist",
|
||||||
|
"build:visionos": "npm run mkdist && react-native bundle --entry-file index.js --platform ios --dev true --bundle-output dist/main.visionos.jsbundle --assets-dest dist",
|
||||||
|
"build:windows": "npm run mkdist && react-native bundle --entry-file index.js --platform windows --dev true --bundle-output dist/main.windows.bundle --assets-dest dist",
|
||||||
|
"ios": "react-native run-ios",
|
||||||
|
"lint": "eslint .",
|
||||||
|
"mkdist": "node -e \"require('node:fs').mkdirSync('dist', { recursive: true, mode: 0o755 })\"",
|
||||||
|
"start": "react-native start",
|
||||||
|
"test": "jest",
|
||||||
|
"visionos": "react-native run-visionos",
|
||||||
|
"windows": "react-native run-windows --sln windows/BareExample.sln"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"@callstack/react-native-visionos": "^0.73.0",
|
||||||
|
"@react-native-picker/picker": "2.8.1",
|
||||||
|
"react": "18.2.0",
|
||||||
|
"react-native": "0.73.2",
|
||||||
|
"react-native-video": "link:../..",
|
||||||
|
"react-native-windows": "^0.73.0"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@babel/core": "^7.20.0",
|
||||||
|
"@babel/preset-env": "^7.20.0",
|
||||||
|
"@babel/runtime": "^7.20.0",
|
||||||
|
"@expo/config-plugins": "^8.0.10",
|
||||||
|
"@react-native/babel-preset": "0.73.19",
|
||||||
|
"@react-native/eslint-config": "0.73.2",
|
||||||
|
"@react-native/metro-config": "0.73.3",
|
||||||
|
"@react-native/typescript-config": "0.73.1",
|
||||||
|
"@rnx-kit/metro-config": "^2.0.0",
|
||||||
|
"@types/react": "^18.2.6",
|
||||||
|
"@types/react-test-renderer": "^18.0.0",
|
||||||
|
"babel-jest": "^29.6.3",
|
||||||
|
"eslint": "^8.19.0",
|
||||||
|
"jest": "^29.6.3",
|
||||||
|
"patch-package": "^8.0.0",
|
||||||
|
"prettier": "2.8.8",
|
||||||
|
"react-native-test-app": "^3.10.14",
|
||||||
|
"react-test-renderer": "18.2.0",
|
||||||
|
"typescript": "5.0.4"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=18"
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,21 @@
|
|||||||
|
diff --git a/node_modules/@react-native-picker/picker/RNCPicker.podspec b/node_modules/@react-native-picker/picker/RNCPicker.podspec
|
||||||
|
index bfdf16c..bdc9c7c 100644
|
||||||
|
--- a/node_modules/@react-native-picker/picker/RNCPicker.podspec
|
||||||
|
+++ b/node_modules/@react-native-picker/picker/RNCPicker.podspec
|
||||||
|
@@ -12,7 +12,7 @@ Pod::Spec.new do |s|
|
||||||
|
|
||||||
|
s.authors = package['author']
|
||||||
|
s.homepage = package['homepage']
|
||||||
|
- s.platforms = { :ios => "9.0", :osx => "10.14" }
|
||||||
|
+ s.platforms = { :ios => "9.0", :osx => "10.14", :visionos => "1.0" }
|
||||||
|
|
||||||
|
s.source = { :git => "https://github.com/react-native-picker/picker.git", :tag => "v#{s.version}" }
|
||||||
|
|
||||||
|
@@ -25,6 +25,7 @@ Pod::Spec.new do |s|
|
||||||
|
else
|
||||||
|
s.ios.source_files = "ios/**/*.{h,m,mm}"
|
||||||
|
s.osx.source_files = "macos/**/*.{h,m,mm}"
|
||||||
|
+ s.visionos.source_files = "ios/**/*.{h,m,mm}"
|
||||||
|
end
|
||||||
|
|
||||||
|
s.dependency 'React-Core'
|
23
examples/bare/react-native.config.js
Normal file
23
examples/bare/react-native.config.js
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
const project = (() => {
|
||||||
|
try {
|
||||||
|
const { configureProjects } = require("react-native-test-app");
|
||||||
|
return configureProjects({
|
||||||
|
android: {
|
||||||
|
sourceDir: "android",
|
||||||
|
},
|
||||||
|
ios: {
|
||||||
|
sourceDir: "ios",
|
||||||
|
},
|
||||||
|
windows: {
|
||||||
|
sourceDir: "windows",
|
||||||
|
solutionFile: "windows/BareExample.sln",
|
||||||
|
},
|
||||||
|
});
|
||||||
|
} catch (_) {
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
})();
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
...(project ? { project } : undefined),
|
||||||
|
};
|
345
examples/bare/src/BasicExample.tsx
Normal file
345
examples/bare/src/BasicExample.tsx
Normal file
@ -0,0 +1,345 @@
|
|||||||
|
import React, {type FC, useCallback, useRef, useState, useEffect} from 'react';
|
||||||
|
|
||||||
|
import {Platform, TouchableOpacity, View, StatusBar} from 'react-native';
|
||||||
|
|
||||||
|
import Video, {
|
||||||
|
VideoRef,
|
||||||
|
SelectedVideoTrackType,
|
||||||
|
BufferingStrategyType,
|
||||||
|
SelectedTrackType,
|
||||||
|
ResizeMode,
|
||||||
|
type AudioTrack,
|
||||||
|
type OnAudioTracksData,
|
||||||
|
type OnLoadData,
|
||||||
|
type OnProgressData,
|
||||||
|
type OnTextTracksData,
|
||||||
|
type OnVideoAspectRatioData,
|
||||||
|
type TextTrack,
|
||||||
|
type OnBufferData,
|
||||||
|
type OnAudioFocusChangedData,
|
||||||
|
type OnVideoErrorData,
|
||||||
|
type OnTextTrackDataChangedData,
|
||||||
|
type OnSeekData,
|
||||||
|
type OnPlaybackStateChangedData,
|
||||||
|
type OnPlaybackRateChangeData,
|
||||||
|
type OnVideoTracksData,
|
||||||
|
type ReactVideoSource,
|
||||||
|
type VideoTrack,
|
||||||
|
type SelectedTrack,
|
||||||
|
type SelectedVideoTrack,
|
||||||
|
type EnumValues,
|
||||||
|
OnBandwidthUpdateData,
|
||||||
|
ControlsStyles,
|
||||||
|
} from 'react-native-video';
|
||||||
|
import styles from './styles';
|
||||||
|
import {type AdditionalSourceInfo} from './types';
|
||||||
|
import {
|
||||||
|
bufferConfig,
|
||||||
|
isAndroid,
|
||||||
|
srcList,
|
||||||
|
textTracksSelectionBy,
|
||||||
|
audioTracksSelectionBy,
|
||||||
|
} from './constants';
|
||||||
|
import {Overlay, toast, VideoLoader} from './components';
|
||||||
|
|
||||||
|
const BasicExample = () => {
|
||||||
|
const [rate, setRate] = useState(1);
|
||||||
|
const [volume, setVolume] = useState(1);
|
||||||
|
const [muted, setMuted] = useState(false);
|
||||||
|
const [resizeMode, setResizeMode] = useState<EnumValues<ResizeMode>>(
|
||||||
|
ResizeMode.CONTAIN,
|
||||||
|
);
|
||||||
|
const [duration, setDuration] = useState(0);
|
||||||
|
const [currentTime, setCurrentTime] = useState(0);
|
||||||
|
const [_, setVideoSize] = useState({videoWidth: 0, videoHeight: 0});
|
||||||
|
const [paused, setPaused] = useState(false);
|
||||||
|
const [fullscreen, setFullscreen] = useState(true);
|
||||||
|
const [isLoading, setIsLoading] = useState(false);
|
||||||
|
const [audioTracks, setAudioTracks] = useState<AudioTrack[]>([]);
|
||||||
|
const [textTracks, setTextTracks] = useState<TextTrack[]>([]);
|
||||||
|
const [videoTracks, setVideoTracks] = useState<VideoTrack[]>([]);
|
||||||
|
const [selectedAudioTrack, setSelectedAudioTrack] = useState<
|
||||||
|
SelectedTrack | undefined
|
||||||
|
>(undefined);
|
||||||
|
const [selectedTextTrack, setSelectedTextTrack] = useState<
|
||||||
|
SelectedTrack | undefined
|
||||||
|
>(undefined);
|
||||||
|
const [selectedVideoTrack, setSelectedVideoTrack] =
|
||||||
|
useState<SelectedVideoTrack>({
|
||||||
|
type: SelectedVideoTrackType.AUTO,
|
||||||
|
});
|
||||||
|
const [srcListId, setSrcListId] = useState(0);
|
||||||
|
const [repeat, setRepeat] = useState(false);
|
||||||
|
const [controls, setControls] = useState(false);
|
||||||
|
const [useCache, setUseCache] = useState(false);
|
||||||
|
const [showPoster, setShowPoster] = useState<boolean>(false);
|
||||||
|
const [showNotificationControls, setShowNotificationControls] =
|
||||||
|
useState(false);
|
||||||
|
const [isSeeking, setIsSeeking] = useState(false);
|
||||||
|
|
||||||
|
const videoRef = useRef<VideoRef>(null);
|
||||||
|
const viewStyle = fullscreen ? styles.fullScreen : styles.halfScreen;
|
||||||
|
const currentSrc = srcList[srcListId];
|
||||||
|
const additional = currentSrc as AdditionalSourceInfo;
|
||||||
|
|
||||||
|
const goToChannel = useCallback((channel: number) => {
|
||||||
|
setSrcListId(channel);
|
||||||
|
setDuration(0);
|
||||||
|
setCurrentTime(0);
|
||||||
|
setVideoSize({videoWidth: 0, videoHeight: 0});
|
||||||
|
setIsLoading(false);
|
||||||
|
setAudioTracks([]);
|
||||||
|
setTextTracks([]);
|
||||||
|
setSelectedAudioTrack(undefined);
|
||||||
|
setSelectedTextTrack(undefined);
|
||||||
|
setSelectedVideoTrack({
|
||||||
|
type: SelectedVideoTrackType.AUTO,
|
||||||
|
});
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
const channelUp = useCallback(() => {
|
||||||
|
console.log('channel up');
|
||||||
|
goToChannel((srcListId + 1) % srcList.length);
|
||||||
|
}, [goToChannel, srcListId]);
|
||||||
|
|
||||||
|
const channelDown = useCallback(() => {
|
||||||
|
console.log('channel down');
|
||||||
|
goToChannel((srcListId + srcList.length - 1) % srcList.length);
|
||||||
|
}, [goToChannel, srcListId]);
|
||||||
|
|
||||||
|
const onAudioTracks = (data: OnAudioTracksData) => {
|
||||||
|
console.log('onAudioTracks', data);
|
||||||
|
const selectedTrack = data.audioTracks?.find((x: AudioTrack) => {
|
||||||
|
return x.selected;
|
||||||
|
});
|
||||||
|
let value;
|
||||||
|
if (audioTracksSelectionBy === SelectedTrackType.INDEX) {
|
||||||
|
value = selectedTrack?.index;
|
||||||
|
} else if (audioTracksSelectionBy === SelectedTrackType.LANGUAGE) {
|
||||||
|
value = selectedTrack?.language;
|
||||||
|
} else if (audioTracksSelectionBy === SelectedTrackType.TITLE) {
|
||||||
|
value = selectedTrack?.title;
|
||||||
|
}
|
||||||
|
setAudioTracks(data.audioTracks);
|
||||||
|
setSelectedAudioTrack({
|
||||||
|
type: audioTracksSelectionBy,
|
||||||
|
value: value,
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
const onVideoTracks = (data: OnVideoTracksData) => {
|
||||||
|
console.log('onVideoTracks', data.videoTracks);
|
||||||
|
setVideoTracks(data.videoTracks);
|
||||||
|
};
|
||||||
|
|
||||||
|
const onTextTracks = (data: OnTextTracksData) => {
|
||||||
|
const selectedTrack = data.textTracks?.find((x: TextTrack) => {
|
||||||
|
return x?.selected;
|
||||||
|
});
|
||||||
|
|
||||||
|
setTextTracks(data.textTracks);
|
||||||
|
let value;
|
||||||
|
if (textTracksSelectionBy === SelectedTrackType.INDEX) {
|
||||||
|
value = selectedTrack?.index;
|
||||||
|
} else if (textTracksSelectionBy === SelectedTrackType.LANGUAGE) {
|
||||||
|
value = selectedTrack?.language;
|
||||||
|
} else if (textTracksSelectionBy === SelectedTrackType.TITLE) {
|
||||||
|
value = selectedTrack?.title;
|
||||||
|
}
|
||||||
|
setSelectedTextTrack({
|
||||||
|
type: textTracksSelectionBy,
|
||||||
|
value: value,
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
const onLoad = (data: OnLoadData) => {
|
||||||
|
setDuration(data.duration);
|
||||||
|
onAudioTracks(data);
|
||||||
|
onTextTracks(data);
|
||||||
|
onVideoTracks(data);
|
||||||
|
};
|
||||||
|
|
||||||
|
const onProgress = (data: OnProgressData) => {
|
||||||
|
setCurrentTime(data.currentTime);
|
||||||
|
};
|
||||||
|
|
||||||
|
const onSeek = (data: OnSeekData) => {
|
||||||
|
setCurrentTime(data.currentTime);
|
||||||
|
setIsSeeking(false);
|
||||||
|
};
|
||||||
|
|
||||||
|
const onVideoLoadStart = () => {
|
||||||
|
console.log('onVideoLoadStart');
|
||||||
|
setIsLoading(true);
|
||||||
|
};
|
||||||
|
|
||||||
|
const onTextTrackDataChanged = (data: OnTextTrackDataChangedData) => {
|
||||||
|
console.log(`Subtitles: ${JSON.stringify(data, null, 2)}`);
|
||||||
|
};
|
||||||
|
|
||||||
|
const onAspectRatio = (data: OnVideoAspectRatioData) => {
|
||||||
|
console.log('onAspectRadio called ' + JSON.stringify(data));
|
||||||
|
setVideoSize({videoWidth: data.width, videoHeight: data.height});
|
||||||
|
};
|
||||||
|
|
||||||
|
const onVideoBuffer = (param: OnBufferData) => {
|
||||||
|
console.log('onVideoBuffer');
|
||||||
|
setIsLoading(param.isBuffering);
|
||||||
|
};
|
||||||
|
|
||||||
|
const onReadyForDisplay = () => {
|
||||||
|
console.log('onReadyForDisplay');
|
||||||
|
setIsLoading(false);
|
||||||
|
};
|
||||||
|
|
||||||
|
const onAudioBecomingNoisy = () => {
|
||||||
|
setPaused(true);
|
||||||
|
};
|
||||||
|
|
||||||
|
const onAudioFocusChanged = (event: OnAudioFocusChangedData) => {
|
||||||
|
setPaused(!event.hasAudioFocus);
|
||||||
|
};
|
||||||
|
|
||||||
|
const onError = (err: OnVideoErrorData) => {
|
||||||
|
console.log(JSON.stringify(err));
|
||||||
|
toast(true, 'error: ' + JSON.stringify(err));
|
||||||
|
};
|
||||||
|
|
||||||
|
const onEnd = () => {
|
||||||
|
if (!repeat) {
|
||||||
|
channelUp();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const onPlaybackRateChange = (data: OnPlaybackRateChangeData) => {
|
||||||
|
console.log('onPlaybackRateChange', data);
|
||||||
|
};
|
||||||
|
|
||||||
|
const onPlaybackStateChanged = (data: OnPlaybackStateChangedData) => {
|
||||||
|
console.log('onPlaybackStateChanged', data);
|
||||||
|
};
|
||||||
|
|
||||||
|
const onVideoBandwidthUpdate = (data: OnBandwidthUpdateData) => {
|
||||||
|
console.log('onVideoBandwidthUpdate', data);
|
||||||
|
};
|
||||||
|
|
||||||
|
const onFullScreenExit = () => {
|
||||||
|
// iOS pauses video on exit from full screen
|
||||||
|
Platform.OS === 'ios' && setPaused(true);
|
||||||
|
};
|
||||||
|
|
||||||
|
const _renderLoader = showPoster ? () => <VideoLoader /> : undefined;
|
||||||
|
|
||||||
|
const _subtitleStyle = {subtitlesFollowVideo: true};
|
||||||
|
const _controlsStyles: ControlsStyles = {
|
||||||
|
hideNavigationBarOnFullScreenMode: true,
|
||||||
|
hideNotificationBarOnFullScreenMode: true,
|
||||||
|
liveLabel: 'LIVE',
|
||||||
|
};
|
||||||
|
const _bufferConfig = {
|
||||||
|
...bufferConfig,
|
||||||
|
cacheSizeMB: useCache ? 200 : 0,
|
||||||
|
};
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
videoRef.current?.setSource(currentSrc);
|
||||||
|
}, [currentSrc]);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<View style={styles.container}>
|
||||||
|
<StatusBar animated={true} backgroundColor="black" hidden={false} />
|
||||||
|
|
||||||
|
{(srcList[srcListId] as AdditionalSourceInfo)?.noView ? null : (
|
||||||
|
<TouchableOpacity style={viewStyle}>
|
||||||
|
<Video
|
||||||
|
showNotificationControls={showNotificationControls}
|
||||||
|
ref={videoRef}
|
||||||
|
// source={currentSrc as ReactVideoSource}
|
||||||
|
drm={additional?.drm}
|
||||||
|
style={viewStyle}
|
||||||
|
rate={rate}
|
||||||
|
paused={paused}
|
||||||
|
volume={volume}
|
||||||
|
muted={muted}
|
||||||
|
controls={controls}
|
||||||
|
resizeMode={resizeMode}
|
||||||
|
onFullscreenPlayerWillDismiss={onFullScreenExit}
|
||||||
|
onLoad={onLoad}
|
||||||
|
onAudioTracks={onAudioTracks}
|
||||||
|
onTextTracks={onTextTracks}
|
||||||
|
onVideoTracks={onVideoTracks}
|
||||||
|
onTextTrackDataChanged={onTextTrackDataChanged}
|
||||||
|
onProgress={onProgress}
|
||||||
|
onEnd={onEnd}
|
||||||
|
progressUpdateInterval={1000}
|
||||||
|
onError={onError}
|
||||||
|
onAudioBecomingNoisy={onAudioBecomingNoisy}
|
||||||
|
onAudioFocusChanged={onAudioFocusChanged}
|
||||||
|
onLoadStart={onVideoLoadStart}
|
||||||
|
onAspectRatio={onAspectRatio}
|
||||||
|
onReadyForDisplay={onReadyForDisplay}
|
||||||
|
onBuffer={onVideoBuffer}
|
||||||
|
onBandwidthUpdate={onVideoBandwidthUpdate}
|
||||||
|
onSeek={onSeek}
|
||||||
|
repeat={repeat}
|
||||||
|
selectedTextTrack={selectedTextTrack}
|
||||||
|
selectedAudioTrack={selectedAudioTrack}
|
||||||
|
selectedVideoTrack={selectedVideoTrack}
|
||||||
|
playInBackground={false}
|
||||||
|
bufferConfig={_bufferConfig}
|
||||||
|
preventsDisplaySleepDuringVideoPlayback={true}
|
||||||
|
renderLoader={_renderLoader}
|
||||||
|
onPlaybackRateChange={onPlaybackRateChange}
|
||||||
|
onPlaybackStateChanged={onPlaybackStateChanged}
|
||||||
|
bufferingStrategy={BufferingStrategyType.DEFAULT}
|
||||||
|
debug={{enable: true, thread: true}}
|
||||||
|
subtitleStyle={_subtitleStyle}
|
||||||
|
controlsStyles={_controlsStyles}
|
||||||
|
/>
|
||||||
|
</TouchableOpacity>
|
||||||
|
)}
|
||||||
|
<Overlay
|
||||||
|
channelDown={channelDown}
|
||||||
|
channelUp={channelUp}
|
||||||
|
ref={videoRef}
|
||||||
|
videoTracks={videoTracks}
|
||||||
|
selectedVideoTrack={selectedVideoTrack}
|
||||||
|
setSelectedTextTrack={setSelectedTextTrack}
|
||||||
|
audioTracks={audioTracks}
|
||||||
|
controls={controls}
|
||||||
|
resizeMode={resizeMode}
|
||||||
|
textTracks={textTracks}
|
||||||
|
selectedTextTrack={selectedTextTrack}
|
||||||
|
selectedAudioTrack={selectedAudioTrack}
|
||||||
|
setSelectedAudioTrack={setSelectedAudioTrack}
|
||||||
|
setSelectedVideoTrack={setSelectedVideoTrack}
|
||||||
|
currentTime={currentTime}
|
||||||
|
setMuted={setMuted}
|
||||||
|
muted={muted}
|
||||||
|
duration={duration}
|
||||||
|
paused={paused}
|
||||||
|
volume={volume}
|
||||||
|
setControls={setControls}
|
||||||
|
showPoster={showPoster}
|
||||||
|
rate={rate}
|
||||||
|
setFullscreen={setFullscreen}
|
||||||
|
setPaused={setPaused}
|
||||||
|
isLoading={isLoading}
|
||||||
|
isSeeking={isSeeking}
|
||||||
|
setIsSeeking={setIsSeeking}
|
||||||
|
repeat={repeat}
|
||||||
|
setRepeat={setRepeat}
|
||||||
|
setShowPoster={setShowPoster}
|
||||||
|
setRate={setRate}
|
||||||
|
setResizeMode={setResizeMode}
|
||||||
|
setShowNotificationControls={setShowNotificationControls}
|
||||||
|
showNotificationControls={showNotificationControls}
|
||||||
|
setUseCache={setUseCache}
|
||||||
|
setVolume={setVolume}
|
||||||
|
useCache={useCache}
|
||||||
|
srcListId={srcListId}
|
||||||
|
/>
|
||||||
|
</View>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
export default BasicExample;
|
231
examples/bare/src/DRMExample.tsx
Normal file
231
examples/bare/src/DRMExample.tsx
Normal file
@ -0,0 +1,231 @@
|
|||||||
|
import * as React from 'react';
|
||||||
|
import {
|
||||||
|
Text,
|
||||||
|
View,
|
||||||
|
StyleSheet,
|
||||||
|
Platform,
|
||||||
|
ScrollView,
|
||||||
|
TextInput,
|
||||||
|
Alert,
|
||||||
|
Button,
|
||||||
|
ActivityIndicator,
|
||||||
|
} from 'react-native';
|
||||||
|
import Video, {DRMType, ReactVideoSourceProperties} from 'react-native-video';
|
||||||
|
|
||||||
|
type SourceType = ReactVideoSourceProperties | null;
|
||||||
|
|
||||||
|
const DRMExample = () => {
|
||||||
|
const [loading, setLoading] = React.useState(false);
|
||||||
|
|
||||||
|
const [source, setSource] = React.useState<SourceType>(null);
|
||||||
|
|
||||||
|
const [hls, setHls] = React.useState(
|
||||||
|
'https://d5lhbv70lxyop.cloudfront.net/02b91d1c-dcde-4a93-8391-8524f7836a72/assets/5a116d5e-4acb-4461-8bc0-81adf45a8432/videokit-576p-dash-hls-drm/hls/index.m3u8',
|
||||||
|
);
|
||||||
|
const [fairplayLicense, setFairplayLicense] = React.useState(
|
||||||
|
'https://videokit-demo-7dr2zvpf.la.drm.cloud/acquire-license/fairplay?BrandGuid=02b91d1c-dcde-4a93-8391-8524f7836a72',
|
||||||
|
);
|
||||||
|
const [fairplayCertificate, setFairplayCertificate] = React.useState(
|
||||||
|
'https://videokit-demo-7dr2zvpf.la.drm.cloud/certificate/fairplay?BrandGuid=02b91d1c-dcde-4a93-8391-8524f7836a72',
|
||||||
|
);
|
||||||
|
const [dash, setDash] = React.useState(
|
||||||
|
'https://d5lhbv70lxyop.cloudfront.net/02b91d1c-dcde-4a93-8391-8524f7836a72/assets/5a116d5e-4acb-4461-8bc0-81adf45a8432/videokit-576p-dash-hls-drm/dash/index.mpd',
|
||||||
|
);
|
||||||
|
const [widevineLicense, setWidevineLicense] = React.useState(
|
||||||
|
'https://videokit-demo-7dr2zvpf.la.drm.cloud/acquire-license/widevine?BrandGuid=02b91d1c-dcde-4a93-8391-8524f7836a72',
|
||||||
|
);
|
||||||
|
|
||||||
|
// ------------- DMR Token -------------
|
||||||
|
// This token is used to authenticate the user and get the license
|
||||||
|
// To run example please go to https://someweb.com (TODO: Insert here real website cc Kamil) and complete the form to receive the token
|
||||||
|
// After you receive the token, please paste it here
|
||||||
|
const [token, setToken] = React.useState('<USER_TOKEN>');
|
||||||
|
|
||||||
|
const handlePlayStopVideo = () => {
|
||||||
|
if (source !== null) {
|
||||||
|
setSource(null);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (token === '<USER_TOKEN>') {
|
||||||
|
Alert.alert('Error', 'Please enter the token received from the website');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
setLoading(true);
|
||||||
|
|
||||||
|
const newSource: ReactVideoSourceProperties = {};
|
||||||
|
|
||||||
|
if (Platform.OS === 'ios') {
|
||||||
|
if (fairplayLicense && fairplayCertificate) {
|
||||||
|
newSource.uri = hls;
|
||||||
|
newSource.drm = {
|
||||||
|
type: DRMType.FAIRPLAY,
|
||||||
|
licenseServer: fairplayLicense,
|
||||||
|
certificateUrl: fairplayCertificate,
|
||||||
|
getLicense: (spcString, contentId, licenseUrl, loadedLicenseUrl) => {
|
||||||
|
const formData = new FormData();
|
||||||
|
formData.append('spc', spcString);
|
||||||
|
|
||||||
|
const resultURL = loadedLicenseUrl.replace('skd://', 'https://');
|
||||||
|
|
||||||
|
return fetch(`${resultURL}&userToken=${token}`, {
|
||||||
|
method: 'POST',
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'multipart/form-data',
|
||||||
|
Accept: 'application/json',
|
||||||
|
},
|
||||||
|
body: formData,
|
||||||
|
})
|
||||||
|
.then((response) => response.json())
|
||||||
|
.then((response) => {
|
||||||
|
return response.ckc;
|
||||||
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
console.error('Error', error);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
Alert.alert('Error', 'Please enter Fairplay License and Certificate');
|
||||||
|
setLoading(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Platform.OS === 'android') {
|
||||||
|
if (widevineLicense) {
|
||||||
|
newSource.drm = {
|
||||||
|
type: DRMType.WIDEVINE,
|
||||||
|
licenseServer: widevineLicense,
|
||||||
|
};
|
||||||
|
newSource.uri = dash;
|
||||||
|
} else {
|
||||||
|
Alert.alert('Error', 'Please enter Widevine License');
|
||||||
|
setLoading(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
setSource(newSource);
|
||||||
|
};
|
||||||
|
|
||||||
|
if (Platform.OS !== 'ios' && Platform.OS !== 'android') {
|
||||||
|
return (
|
||||||
|
<View style={styles.container}>
|
||||||
|
<Text>DRM is not supported on this platform</Text>
|
||||||
|
</View>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<ScrollView contentContainerStyle={styles.container}>
|
||||||
|
<Text style={styles.title}>DRM Protected Stream Player</Text>
|
||||||
|
|
||||||
|
{loading && <ActivityIndicator size="large" color="#0000ff" />}
|
||||||
|
{source && source.uri && (
|
||||||
|
<Video
|
||||||
|
key={source.uri}
|
||||||
|
onLoad={() => {
|
||||||
|
setLoading(false);
|
||||||
|
}}
|
||||||
|
onError={(e) => {
|
||||||
|
console.log('error', e);
|
||||||
|
Alert.alert('Error', e.error.localizedDescription);
|
||||||
|
setLoading(false);
|
||||||
|
}}
|
||||||
|
source={source}
|
||||||
|
resizeMode="contain"
|
||||||
|
style={styles.video}
|
||||||
|
controls
|
||||||
|
muted={false}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{Platform.OS === 'ios' && (
|
||||||
|
<>
|
||||||
|
<TextInput
|
||||||
|
style={styles.input}
|
||||||
|
placeholder="HLS URL"
|
||||||
|
value={hls}
|
||||||
|
onChangeText={(text) => setHls(text)}
|
||||||
|
/>
|
||||||
|
|
||||||
|
<TextInput
|
||||||
|
style={styles.input}
|
||||||
|
placeholder="Fairplay License URL"
|
||||||
|
value={fairplayLicense}
|
||||||
|
onChangeText={(text) => setFairplayLicense(text)}
|
||||||
|
/>
|
||||||
|
|
||||||
|
<TextInput
|
||||||
|
style={styles.input}
|
||||||
|
placeholder="Fairplay Certificate URL"
|
||||||
|
value={fairplayCertificate}
|
||||||
|
onChangeText={(text) => setFairplayCertificate(text)}
|
||||||
|
/>
|
||||||
|
</>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{Platform.OS === 'android' && (
|
||||||
|
<>
|
||||||
|
<TextInput
|
||||||
|
style={styles.input}
|
||||||
|
placeholder="DASH URL"
|
||||||
|
value={dash}
|
||||||
|
onChangeText={(text) => setDash(text)}
|
||||||
|
/>
|
||||||
|
|
||||||
|
<TextInput
|
||||||
|
style={styles.input}
|
||||||
|
placeholder="Widevine License URL"
|
||||||
|
value={widevineLicense}
|
||||||
|
onChangeText={(text) => setWidevineLicense(text)}
|
||||||
|
/>
|
||||||
|
</>
|
||||||
|
)}
|
||||||
|
|
||||||
|
<TextInput
|
||||||
|
style={styles.input}
|
||||||
|
placeholder="Token"
|
||||||
|
value={token}
|
||||||
|
onChangeText={(text) => setToken(text)}
|
||||||
|
/>
|
||||||
|
|
||||||
|
<Button
|
||||||
|
title={`${source !== null ? 'Stop' : 'Play'} Video`}
|
||||||
|
onPress={handlePlayStopVideo}
|
||||||
|
/>
|
||||||
|
</ScrollView>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default DRMExample;
|
||||||
|
|
||||||
|
const styles = StyleSheet.create({
|
||||||
|
container: {
|
||||||
|
flexGrow: 1,
|
||||||
|
justifyContent: 'center',
|
||||||
|
alignItems: 'center',
|
||||||
|
padding: 20,
|
||||||
|
backgroundColor: 'black',
|
||||||
|
},
|
||||||
|
title: {
|
||||||
|
fontSize: 24,
|
||||||
|
fontWeight: 'bold',
|
||||||
|
marginBottom: 20,
|
||||||
|
color: 'white',
|
||||||
|
},
|
||||||
|
video: {
|
||||||
|
width: '100%',
|
||||||
|
height: 200,
|
||||||
|
marginBottom: 80,
|
||||||
|
},
|
||||||
|
input: {
|
||||||
|
height: 40,
|
||||||
|
borderColor: 'gray',
|
||||||
|
borderWidth: 1,
|
||||||
|
marginBottom: 10,
|
||||||
|
paddingHorizontal: 10,
|
||||||
|
width: '100%',
|
||||||
|
color: 'white',
|
||||||
|
},
|
||||||
|
});
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user