Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

M56 rn video alpha 8 #2

Open
wants to merge 149 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
149 commits
Select commit Hold shift + click to select a range
2fc7193
Print error for configureAudio method try catch blocks. Add fallback …
Romick2005 Mar 3, 2023
7bc2e3c
Remove extra spaces
tironiigor Mar 13, 2023
37e632d
Added player custom looper
tironiigor Mar 13, 2023
bb369a7
Removed pause if _repeat is false
tironiigor Mar 13, 2023
daabb91
Allow audio output via earpiece
mysport12 Apr 2, 2023
87859bc
Update ios/Video/Features/RCTPlayerOperations.swift
Romick2005 Apr 5, 2023
aaa9612
fix: remove dummy nativeOnly
Sunbreak Mar 9, 2023
e0095c3
Make sure audioOutput is respected on first render
mysport12 Apr 12, 2023
dc41c65
Fix audio output not being properly set for iOS
mysport12 Apr 14, 2023
777308a
Recreate asset to avoid stale state
tironiigor Apr 26, 2023
632e694
Request asset precise duration and timing
tironiigor Apr 26, 2023
2184c77
Bump exoplayer to 2.18.6
tironiigor Apr 27, 2023
3bd032b
Merge pull request #3047 from Romick2005/master
freeboub Apr 29, 2023
b312f45
Explicitly use self to make semantic explicit
tironiigor May 5, 2023
493b620
Move OnAudioFocusChangeListener to own class
BasixKOR May 9, 2023
5e7bd86
Update CHANGELOG.md
BasixKOR May 9, 2023
7f3d707
Fix ids in exo_player_control_view
androideveloper Jun 15, 2023
f861b9a
Check for player not being null before calling stop and clearMediaItems
tironiigor Jun 28, 2023
06462f0
Pull changes from #3123
tironiigor Jun 28, 2023
7e5bc48
feat: RN 0.73 support
mrousavy Jul 3, 2023
12d7dd6
fix: issue 2744, call replaceCurrentItem in dispatch thread
cguino Jul 6, 2023
d526479
fix: issue 3040, prevent crash
cguino Jul 6, 2023
50b3650
fix: memory leak due to [weak self] and delegate not being weak
cguino Jul 6, 2023
238daf8
fix: issue 3085, onFullscreen call backs are never fired
cguino Jul 6, 2023
ca50dbd
Merge pull request #3149 from androideveloper/patch-1
freeboub Jul 8, 2023
c0517f8
Merge pull request #3056 from Sunbreak/fabric-1
freeboub Jul 8, 2023
48fa1bc
Merge pull request #3163 from mrousavy/patch-1
freeboub Jul 8, 2023
8723114
Update issue templates
freeboub Jul 8, 2023
c23bcdd
chore: fix build issue
Jul 8, 2023
23a39e8
Merge pull request #3168 from iFeelSmart/fix/build_issue_3152
freeboub Jul 8, 2023
71c3c5c
Revert "fix: issue 2744, call replaceCurrentItem in dispatch thread"
cguino Jul 9, 2023
6190fff
Merge commit '23a39e8f5fffbbdcfc72a4c0d7777763e273cd6d' into feature/…
cguino Jul 9, 2023
9914faf
Merge pull request #3167 from BeApp/feature/ios-fix
freeboub Jul 10, 2023
ccff99f
fix ios block ui issue
Jul 12, 2023
183c818
feat: :zap: added .nvmrc
yungblud Apr 13, 2023
617bcb3
feat: :zap: added laftel video example app
yungblud Apr 13, 2023
70bab9e
feat: :zap: added setup for exapmle
yungblud Apr 13, 2023
f9fe2b0
feat: :zap: set path
yungblud Apr 13, 2023
fe4e2bf
feat: :zap: Pod install
yungblud Apr 13, 2023
f5dc499
feat: :zap: modified setup
yungblud Apr 13, 2023
4ddecbf
feat: :zap: modified setup
yungblud Apr 13, 2023
9e9c5ec
feat: :zap: added example video
yungblud Apr 13, 2023
b2bf6f8
chore: :zap: chore
yungblud Apr 13, 2023
2c2f812
chore: update example package
jiyong1 Apr 15, 2023
bc4d2ca
example app change
jiyong1 Apr 20, 2023
0ea4ac8
feat: :zap: added gitignore
yungblud Apr 25, 2023
0be9de9
feat: :zap: turn on newarch enabled on example app
yungblud Apr 25, 2023
7b6e76e
feat: :zap: setup example app new arch
yungblud Apr 25, 2023
650b3a6
feat: :zap: setup android example app for fabric android
yungblud Apr 26, 2023
0ca348f
feat: :zap: setup kotlin
yungblud May 1, 2023
805ccb9
feat: renamed with react-native-rename
yungblud May 8, 2023
0cd28cf
feat: changed folder name to FabricExample
yungblud May 8, 2023
d81d59d
feat: setup pod-install script with fabric enabled on Podfile
yungblud Jul 19, 2023
28ac4d2
fixes black splashes on android
Jul 23, 2023
24b5975
fix doc
Jul 23, 2023
9e7737d
Fixed javascript syntax error
atultiwaree Jul 26, 2023
9816ee1
Fixed javascript syntax error
atultiwaree Jul 26, 2023
dc3e83a
Merge remote-tracking branch 'upstream/master'
mysport12 Jul 27, 2023
505a1a5
Merge pull request #3183 from atultiwaree/js-syntax-error-fix
freeboub Aug 3, 2023
236d17e
Merge branch 'master' into fix-memleak
freeboub Aug 3, 2023
5c9d7b8
Merge pull request #3123 from BasixKOR/fix-memleak
freeboub Aug 3, 2023
6c4e90e
Merge pull request #3173 from vemarav/fix-flatlist-ios-ui-block
freeboub Aug 3, 2023
90fe971
Merge pull request #3179 from vemarav/shuttercolor
freeboub Aug 3, 2023
feccb1c
chore: fix missing readme comments
Aug 3, 2023
d869da0
Merge pull request #3194 from iFeelSmart/fix/fix_README
freeboub Aug 3, 2023
4762f77
6.0.0-alpha.7
Aug 3, 2023
30d8146
Merge pull request #3175 from react-native-yeouido/feature/fabric-exa…
freeboub Aug 3, 2023
f4851ba
chore: add tvOS example project
Duell10111 Aug 11, 2023
a7a0390
fix: fix tvos available compile errors
Duell10111 Aug 12, 2023
db6e73e
Merge remote-tracking branch 'upstream/master'
mysport12 Aug 23, 2023
90a8eb2
Revert formatting changes to keep diff cleaner
mysport12 Aug 23, 2023
d5551c9
Remove currentTime property which was removed in 6.0.0 alpha 6
mysport12 Aug 23, 2023
140cfe0
Additional formatting cleanup
mysport12 Aug 23, 2023
dbeea19
Formatting cleanup
mysport12 Aug 23, 2023
3bf0574
Merge pull request #3208 from Duell10111/tvos-example
freeboub Aug 25, 2023
6b60428
Merge pull request #3207 from Duell10111/tvos-fixes-only
freeboub Aug 25, 2023
fd2e396
fix: fix tvos available compile errors
Duell10111 Aug 12, 2023
b225b0f
chore: add custom titles, description and chapters
Duell10111 Aug 12, 2023
6cbc7cd
chore: add chapter images
Duell10111 Aug 13, 2023
ae17aa7
chore: fix iOS build for custom metadata
Duell10111 Aug 15, 2023
8bd5525
chore: use bunny example video again
Duell10111 Aug 25, 2023
b1c49de
docs: adapt API.md for new features
Duell10111 Aug 25, 2023
1111cdc
Move enum to its own file
mysport12 Aug 25, 2023
12edcf8
Add missing import
mysport12 Aug 25, 2023
8946427
Add missing import
mysport12 Aug 25, 2023
3525606
fixing PIP mode on iOS
lrusso Aug 28, 2023
a0450e0
activating the audio session
lrusso Aug 30, 2023
7c8244b
activating the audio session
lrusso Aug 30, 2023
03cba60
preventing the iOS pip to be closed automatically when sending to the…
lrusso Aug 31, 2023
0bf7f70
Merge pull request #3211 from mysport12/master
freeboub Aug 31, 2023
14f12df
rollback logic
lrusso Sep 4, 2023
63f0344
rollback logic
lrusso Sep 4, 2023
30dac90
Merge pull request #3221 from lrusso/master
freeboub Sep 4, 2023
42dc9de
chore: fix upper case type in doc internal links
Sep 4, 2023
ddc87ac
fix: implement lost presentFullscreenPlayer & dismissFullscreenPlayer
Sep 4, 2023
267181b
Merge pull request #3230 from iFeelSmart/fix/presentFullscreenPlayerI…
freeboub Sep 5, 2023
eaa0b94
Merge pull request #3229 from iFeelSmart/chore/fixDocUpperCaseLink
freeboub Sep 5, 2023
0678a2c
Fix: AudioOutput on Android
mysport12 Sep 5, 2023
0fac437
Merge pull request #3233 from mysport12/master
freeboub Sep 5, 2023
19c8134
chore: fix build by adding a fallback on kotlin version
Sep 5, 2023
bcc710e
Merge pull request #3234 from iFeelSmart/chore/fixSampleBuild
freeboub Sep 9, 2023
33c0be4
chore: outsource functions to own utils file
Duell10111 Sep 9, 2023
a0fa831
Merge pull request #3216 from Duell10111/tvos-custom-playback-exerpie…
freeboub Sep 13, 2023
bcc339a
chore: update changeLog for 6.0.0-alpha.8
Sep 14, 2023
d5ced4f
Merge pull request #3238 from iFeelSmart/chore/updateChangeLog
freeboub Sep 14, 2023
3f48c64
6.0.0-alpha.8
Sep 14, 2023
a18953e
fix: fix build on xcode 17 beta
Sep 14, 2023
59236c7
fix: not showing video ads in pip mode
lrusso Sep 17, 2023
65ea1b3
chore(ci): bump action runner node version
KrzysztofMoch Sep 18, 2023
85c9e8f
feat(ios): add playback functions to ref
KrzysztofMoch Sep 18, 2023
0066ec7
feat(android): add playback functions to ref
KrzysztofMoch Sep 18, 2023
e727692
docs: update API docs
KrzysztofMoch Sep 18, 2023
c991a0e
chore: update basic example
KrzysztofMoch Sep 18, 2023
01ce04c
docs: update change log
KrzysztofMoch Sep 18, 2023
50f59b8
Don't force Windows SDK versions
chrisglein Sep 18, 2023
0659334
Fix lack of `onError` event
chrisglein Sep 19, 2023
f39c97d
Update API.md to show onError for Windows
chrisglein Sep 19, 2023
bd4064f
Add changelog entry
chrisglein Sep 19, 2023
0d515b6
Add changelog
chrisglein Sep 19, 2023
a4e59f4
Merge pull request #3243 from TheWidlarzGroup/chore/bump-ci-node-version
freeboub Sep 19, 2023
ef5c63f
Merge pull request #3247 from chrisglein/windowsOnError
freeboub Sep 19, 2023
f066001
Merge branch 'master' into sdkVersion
freeboub Sep 19, 2023
be8cdfd
[bugfix] Player shows black screen on re-enter
Sep 19, 2023
362f80c
adding note regarding the pip mode on iOS
lrusso Sep 19, 2023
03306d9
Merge pull request #3241 from lrusso/master
freeboub Sep 19, 2023
300b583
Merge pull request #3246 from chrisglein/sdkVersion
freeboub Sep 20, 2023
01a4784
Merge pull request #3248 from yooasd11/master
freeboub Sep 20, 2023
4217128
chore: rename `setPlayerStatus` to `setPlayerPauseState`
KrzysztofMoch Sep 21, 2023
106257a
Revert "chore: update basic example"
KrzysztofMoch Sep 21, 2023
f9743fd
chore: invert `setPlayerPauseState` logic
KrzysztofMoch Sep 22, 2023
812e9dc
feat(android): update `isCodecSupported` to return enum
KrzysztofMoch Sep 25, 2023
04b5202
chore: update basic example
KrzysztofMoch Sep 25, 2023
f79e68b
docs: update API docs
KrzysztofMoch Sep 25, 2023
eb77617
docs: update changelog
KrzysztofMoch Sep 25, 2023
4ad210b
chore(android/gradle): update namespace handler
KrzysztofMoch Sep 25, 2023
842a156
chore(android/gradle): remove doubled `compileOptions`
KrzysztofMoch Sep 25, 2023
01c8e54
chore(android/gradle): add suport for AGP 8
KrzysztofMoch Sep 25, 2023
9f93868
Merge pull request #3255 from TheWidlarzGroup/chore/update-namespace-…
freeboub Sep 27, 2023
0655e9d
Merge pull request #3239 from iFeelSmart/fix/compile_xcode_17_beta
freeboub Sep 27, 2023
a279a0c
chore(example/basic): bump react native version
KrzysztofMoch Sep 28, 2023
f85983b
docs: update changelog
KrzysztofMoch Sep 28, 2023
21de75e
Merge pull request #3254 from TheWidlarzGroup/feat/is-codec-supported…
freeboub Sep 29, 2023
4dd2319
Merge pull request #3263 from TheWidlarzGroup/chore/bump-example-reac…
freeboub Sep 29, 2023
6e98cb9
Merge branch 'master' into feat/playback-ref-functions
KrzysztofMoch Sep 29, 2023
c6ee294
Merge pull request #3245 from TheWidlarzGroup/feat/playback-ref-funct…
freeboub Sep 30, 2023
0bf60d3
Merge remote-tracking branch 'upstream/master' into m56-rn-video-alpha-8
mihailapuste Oct 4, 2023
f434a75
add onEnd
mihailapuste Oct 4, 2023
a4b49b1
add back missing observer
mihailapuste Oct 4, 2023
e976f78
add back removed code
mihailapuste Oct 5, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 8 additions & 21 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,37 +10,24 @@ assignees: ''
# Bug

<!--
Before opening a ticket
* Ensure the issue has not been already reported
* Please test using the latest release of the library, as maybe said bug has been already fixed.
* Provide a clear and concise description of what the bug is.
* If the library has multiple install methods, describe installation method (e.g., pod, not pod, with jetifier etc)
* Include screenshots if needed.
Very important, before opening a ticket:
1) Ensure the issue has not been already reported
2) lease test using the latest release (including 6.0.0 preRelease) of the library, as maybe the bug has been already fixed.
3) please don't use emulator to reproduce issues. if you have strange or sporadic error check if this is not devices specific (understand that this library is just a binding to player).
4) ensure you cannot solve the issue by yourself using following guide: https://github.com/react-native-video/react-native-video/blob/master/docs/DEBUGGING.md
-->

## Platform
<!--
Platform where your bug is happening.
-->
Which player are you experiencing the problem on:
* iOS
* Android
* Windows UWP
* Windows WPF
* Windows

## Environment info

<!--
Run `react-native info` in your terminal and copy the results here. Also, include the *precise* version number of this library that you are using in the project
-->

React native info output:

```bash
// paste it here
```

<!-- This fields are mandatory -->
Library version: x.x.x
Device:

## Steps To Reproduce

Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16.x
- run: yarn --no-lockfile
- run: yarn lint
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,5 @@ android/keystores/debug.keystore

# windows
Deploy.binlog
msbuild.binlog
msbuild.binlog
android/buildOutput_*
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v18
136 changes: 108 additions & 28 deletions API.md

Large diffs are not rendered by default.

25 changes: 25 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,30 @@
## Changelog

## Next
- iOS, Android: expose playback functions to ref [#3245](https://github.com/react-native-video/react-native-video/pull/3245)
- Windows: fix build error from over-specified SDK version [#3246](https://github.com/react-native-video/react-native-video/pull/3246)
- Windows: fix `onError` not being raised [#3247](https://github.com/react-native-video/react-native-video/pull/3247)
- **BREAKING CHANGE**❗️Android: update isCodecSupported to return enum [#3254](https://github.com/react-native-video/react-native-video/pull/3254)

### Version 6.0.0-alpha.8
- All: Playing audio over earpiece [#2887](https://github.com/react-native-video/react-native-video/issues/2887)
- All: Prepare for fabric [#3175](https://github.com/react-native-video/react-native-video/pull/3175) [#]()
- iOS: Fix Pip [#3221](https://github.com/react-native-video/react-native-video/pull/3221)
- iOS: Fix regression in presentFullscreenPlayer & dismissFullscreenPlayer [#3230](https://github.com/react-native-video/react-native-video/pull/3230)
- tvOS: Fix build [#3207](https://github.com/react-native-video/react-native-video/pull/3207)
- tvOS: Add sample [#3208](https://github.com/react-native-video/react-native-video/pull/3208)
- tvOS: Allow chapter customization [#3216](https://github.com/react-native-video/react-native-video/pull/3216)
- doc: Fix internal links [#3229](https://github.com/react-native-video/react-native-video/pull/3229)

### Version 6.0.0-alpha.7
- All: clean JS warnings (https://github.com/react-native-video/react-native-video/pull/3183)
- Android: Add shutterView color configurtion (https://github.com/react-native-video/react-native-video/pull/3179)
- Android: React native 0.73 support (https://github.com/react-native-video/react-native-video/pull/3163)
- Android: Fix memory leaks from AudioManager [#3123](https://github.com/react-native-video/react-native-video/pull/3123)
- Android: Fixed syntax error [#3182](https://github.com/react-native-video/react-native-video/issues/3182)
- iOS: Fix freeze at playback startup (https://github.com/react-native-video/react-native-video/pull/3173)
- iOS: Various safety checks (https://github.com/react-native-video/react-native-video/pull/3168)

### Version 6.0.0-alpha.6
- Feature: Video range support [#3030](https://github.com/react-native-video/react-native-video/pull/3030)
- iOS: remove undocumented `currentTime` property [#3064](https://github.com/react-native-video/react-native-video/pull/3064)
Expand Down
49 changes: 31 additions & 18 deletions Video.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ const styles = StyleSheet.create({
},
});

const { VideoDecoderProperties } = NativeModules
export { TextTrackType, FilterType, DRMType, VideoDecoderProperties }
const { VideoDecoderProperties } = NativeModules;
export { TextTrackType, FilterType, DRMType, VideoDecoderProperties };

export default class Video extends Component {

Expand Down Expand Up @@ -77,10 +77,22 @@ export default class Video extends Component {
this.setNativeProps({ fullscreen: false });
};

save = async (options?) => {
save = async (options) => {
return await NativeModules.VideoManager.save(options, findNodeHandle(this._root));
}

pause = async () => {
await this.setPlayerPauseState(true);
};

play = async () => {
await this.setPlayerPauseState(false);
};

setPlayerPauseState = async (paused) => {
return await NativeModules.VideoManager.setPlayerPauseState(paused, findNodeHandle(this._root));
};

restoreUserInterfaceForPictureInPictureStopCompleted = (restored) => {
this.setNativeProps({ restoreUserInterfaceForPIPStopCompletionHandler: restored });
};
Expand Down Expand Up @@ -343,7 +355,11 @@ export default class Video extends Component {
patchVer: source.patchVer || 0,
requestHeaders: source.headers ? this.stringsOnlyObject(source.headers) : {},
startTime: source.startTime || 0,
endTime: source.endTime
endTime: source.endTime,
// Custom Metadata
title: source.title,
subtitle: source.subtitle,
description: source.description,
},
onVideoLoadStart: this._onLoadStart,
onVideoPlaybackStateChanged: this._onPlaybackStateChanged,
Expand All @@ -355,6 +371,7 @@ export default class Video extends Component {
onVideoProgress: this._onProgress,
onVideoSeek: this._onSeek,
onVideoEnd: this._onEnd,
onEnd: this._onEnd,
onVideoBuffer: this._onBuffer,
onVideoBandwidthUpdate: this._onBandwidthUpdate,
onTimedMetadata: this._onTimedMetadata,
Expand Down Expand Up @@ -416,13 +433,6 @@ Video.propTypes = {
FilterType.SEPIA,
]),
filterEnabled: PropTypes.bool,
/* Native only */
src: PropTypes.object,
seek: PropTypes.oneOfType([
PropTypes.number,
PropTypes.object,
]),
fullscreen: PropTypes.bool,
onVideoLoadStart: PropTypes.func,
onVideoLoad: PropTypes.func,
onVideoBuffer: PropTypes.func,
Expand Down Expand Up @@ -499,6 +509,13 @@ Video.propTypes = {
language: PropTypes.string.isRequired,
})
),
chapters: PropTypes.arrayOf(
PropTypes.shape({
title: PropTypes.string,
startTime: PropTypes.number.isRequired,
endTime: PropTypes.number.isRequired,
})
),
paused: PropTypes.bool,
muted: PropTypes.bool,
volume: PropTypes.number,
Expand All @@ -522,6 +539,7 @@ Video.propTypes = {
disableBuffering: PropTypes.bool,
controls: PropTypes.bool,
audioOnly: PropTypes.bool,
audioOutput: PropTypes.oneOf(['earpiece', 'speaker']),
fullscreenAutorotate: PropTypes.bool,
fullscreenOrientation: PropTypes.oneOf(['all', 'landscape', 'portrait']),
progressUpdateInterval: PropTypes.number,
Expand All @@ -535,6 +553,7 @@ Video.propTypes = {
useTextureView: PropTypes.bool,
useSecureView: PropTypes.bool,
hideShutterView: PropTypes.bool,
shutterColor: PropTypes.string,
onLoadStart: PropTypes.func,
onPlaybackStateChanged: PropTypes.func,
onLoad: PropTypes.func,
Expand Down Expand Up @@ -566,10 +585,4 @@ Video.propTypes = {
...ViewPropTypes,
};

const RCTVideo = requireNativeComponent('RCTVideo', Video, {
nativeOnly: {
src: true,
seek: true,
fullscreen: true,
},
});
const RCTVideo = requireNativeComponent('RCTVideo');
111 changes: 102 additions & 9 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,9 +1,45 @@
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'

buildscript {
def kotlin_version = rootProject.ext.has('kotlinVersion') ? rootProject.ext.get('kotlinVersion') :
(project.properties['RNSAC_kotlinVersion'] ? project.properties['RNSAC_kotlinVersion'] : "1.6.10")

repositories {
mavenCentral()
}

dependencies {
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version")
}
}

def safeExtGet(prop, fallback) {
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
}

def getExtOrDefault(name, defaultValue) {
return rootProject.ext.has(name) ? rootProject.ext.get(name) : defaultValue
}

def isNewArchitectureEnabled() {
return rootProject.hasProperty("newArchEnabled") && rootProject.getProperty("newArchEnabled") == "true"
}

def supportsNamespace() {
def parsed = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION.tokenize('.')
def major = parsed[0].toInteger()
def minor = parsed[1].toInteger()

// Namespace support was added in 7.3.0
if (major == 7 && minor >= 3) {
return true
}

return major >= 8
}

def useExoplayerIMA = safeExtGet("RNVUseExoplayerIMA", false)

println "useExoplayerIMA:" + useExoplayerIMA
Expand All @@ -16,25 +52,54 @@ def configStringPath = (
'useExoplayerIMA' + useExoplayerIMA \
).md5()

if (isNewArchitectureEnabled()) {
apply plugin: "com.facebook.react"
}

android {
if (supportsNamespace()) {
namespace 'com.brentvatne.react'

sourceSets {
main {
manifest.srcFile "src/main/AndroidManifestNew.xml"
}
}
}

compileSdkVersion safeExtGet('compileSdkVersion', 31)
buildToolsVersion safeExtGet('buildToolsVersion', '30.0.2')

compileOptions {
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_1_8
def agpVersion = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION
if (agpVersion.tokenize('.')[0].toInteger() < 8) {
compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}

kotlinOptions {
jvmTarget = JavaVersion.VERSION_11.majorVersion
}
}

defaultConfig {
minSdkVersion safeExtGet('minSdkVersion', 21)
targetSdkVersion safeExtGet('targetSdkVersion', 28)
versionCode 1
versionName "1.0"
buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()

ndk {
abiFilters(*reactNativeArchitectures())
}
}

buildFeatures {
buildConfig true
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
packagingOptions {
exclude "**/libreact_render*.so"
}

buildDir 'buildOutput_' + configStringPath
Expand All @@ -49,15 +114,42 @@ android {
}
}
}

sourceSets.main {
java {
if (isNewArchitectureEnabled()) {
srcDirs += [
"src/fabric/java",
"${project.buildDir}/generated/source/codegen/java"
]
} else {
srcDirs += [
"src/oldarch/java"
]
}
}
}
}

def reactNativeArchitectures() {
def value = project.getProperties().get("reactNativeArchitectures")
return value ? value.split(",") : ["armeabi-v7a", "x86", "x86_64", "arm64-v8a"]
}

repositories {
google()
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url "$rootDir/../node_modules/react-native/android"
}
mavenCentral()
}

def kotlin_version = getExtOrDefault('kotlinVersion', project.properties['RNSAC_kotlinVersion'])

dependencies {
implementation "com.facebook.react:react-native:${safeExtGet('reactNativeVersion', '+')}"
implementation('com.google.android.exoplayer:exoplayer:2.18.1') {
implementation('com.google.android.exoplayer:exoplayer:2.18.6') {
exclude group: 'com.android.support'
}

Expand All @@ -67,12 +159,13 @@ dependencies {
implementation "androidx.media:media:1.1.0"
implementation "androidx.activity:activity:1.4.0"

implementation('com.google.android.exoplayer:extension-okhttp:2.18.1') {
implementation('com.google.android.exoplayer:extension-okhttp:2.18.6') {
exclude group: 'com.squareup.okhttp3', module: 'okhttp'
}

if (useExoplayerIMA) {
implementation 'com.google.android.exoplayer:extension-ima:2.18.1'
implementation 'com.google.android.exoplayer:extension-ima:2.18.6'
}
implementation "com.squareup.okhttp3:okhttp:" + '$OKHTTP_VERSION'
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
}
2 changes: 2 additions & 0 deletions android/src/main/AndroidManifestNew.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
</manifest>
Loading