Skip to content

Commit

Permalink
(sync): Update to 6.4.3 (#32)
Browse files Browse the repository at this point in the history
  • Loading branch information
romansavka-mq authored Jul 29, 2024
2 parents d0eec15 + fd9c14f commit 6b0c759
Show file tree
Hide file tree
Showing 33 changed files with 393 additions and 229 deletions.
22 changes: 22 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,25 @@
# [6.4.3+dolbyxp.1.6](https://github.com/miquido/react-native-video/compare/6.4.2+dolbyxp.1.6...miquido:react-native-video:6.4.3+dolbyxp.1.6)

Sync with 6.4.3.

## [6.4.3](https://github.com/TheWidlarzGroup/react-native-video/compare/v6.4.2...v6.4.3) (2024-07-24)


### Bug Fixes

* **android:** app crash at boot with old arch ([#4022](https://github.com/TheWidlarzGroup/react-native-video/issues/4022)) ([1ee5811](https://github.com/TheWidlarzGroup/react-native-video/commit/1ee5811c8e0ecfc2486f5120b575b57c6396e0f8)), closes [#3875](https://github.com/TheWidlarzGroup/react-native-video/issues/3875)
* **android:** fix backward compatibility ([#4020](https://github.com/TheWidlarzGroup/react-native-video/issues/4020)) ([ab7e02e](https://github.com/TheWidlarzGroup/react-native-video/commit/ab7e02e4538c97340f13fb052b1cad94408b48fa))
* **android:** resize mode cover calculation ([#4010](https://github.com/TheWidlarzGroup/react-native-video/issues/4010)) ([9f38216](https://github.com/TheWidlarzGroup/react-native-video/commit/9f382163d83c3331518e2784b335da28179ac91d))
* index of the selected track ([#4012](https://github.com/TheWidlarzGroup/react-native-video/issues/4012)) ([fb1d6bd](https://github.com/TheWidlarzGroup/react-native-video/commit/fb1d6bdef7210d43f9e34f673691a9a17b95424e))
* **sample:** boot failure on emulator ([#4016](https://github.com/TheWidlarzGroup/react-native-video/issues/4016)) ([ffbc977](https://github.com/TheWidlarzGroup/react-native-video/commit/ffbc977ff90248aeb270626620f5c3553f955617))


### Features

* add ability to define `poster` props as Image type and render poster as custom component ([#3972](https://github.com/TheWidlarzGroup/react-native-video/issues/3972)) ([adbd06e](https://github.com/TheWidlarzGroup/react-native-video/commit/adbd06e2df557b22b8a3a19073a2de1cbb964833))
* **android:** add error handling for Kotlin version ([#4018](https://github.com/TheWidlarzGroup/react-native-video/issues/4018)) ([6189080](https://github.com/TheWidlarzGroup/react-native-video/commit/6189080c9aac89aa3d2a4e60049999d8880bc971))
* **android:** set originalFitsSystemWindows on fullscreen open ([#4013](https://github.com/TheWidlarzGroup/react-native-video/issues/4013)) ([2f70c02](https://github.com/TheWidlarzGroup/react-native-video/commit/2f70c02cdcf6488338df197feb61eeb10ed3281f))

# [6.4.2+dolbyxp.1.6](https://github.com/miquido/react-native-video/compare/6.4.2+dolbyxp.1.5...miquido:react-native-video:6.4.2+dolbyxp.1.6)

### Bug Fixes
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# react-native-video
🎬 `<Video>` component for React Native

This repository is fork of [thewidlarzgroup.github.io/react-native-video/](https://thewidlarzgroup.github.io/react-native-video/).
This repository is fork of [miquido.github.io/react-native-video/](https://miquido.github.io/react-native-video/).

All modifications are described in `CHANGELOG.md` using version names with `+dolbyxp` suffix.

# Banches

`main-oss` - fork source, synchronized periodically to refrect state of source `master`.
`main-oss` - fork source, synchronized periodically to reflect state of source `master`.

`main-dxp` - modified fork, synchronized periodically to contain oss changes. Main branch of repository.

Expand Down
14 changes: 14 additions & 0 deletions SYNCING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Syncing OSS changes to fork

1. Make sure latest `main-dxp` branch is checked out
1. Create `feature/sync` branch `git checkout -b feature/sync`
1. Make sure OSS repository is added as separate remote. `git remote add oss [email protected]:TheWidlarzGroup/react-native-video.git`
1. Fetch all tags `git fetch --all --tags`
1. List OSS release tags `git ls-remote --tags oss`
1. Merge OSS release tag `git merge v6.X.X`
1. Solve conflicts
1. Make sure CHANGELOG is ordered properly: OSS release X -> fork releases based on X -> OSS release Y
1. Check is sample is working
1. Add all changes `git add .`
1. Commit all changes `git commit -m "Sync 6.X.X"`
1. Push changes `git push -u origin feature/sync`
31 changes: 26 additions & 5 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,21 @@ apply plugin: 'kotlin-android'

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

def isVersionAtLeast = { version, requiredVersion ->
def (v1, v2) = [version, requiredVersion].collect { it.tokenize('.')*.toInteger() }
for (int i = 0; i < Math.max(v1.size(), v2.size()); i++) {
int val1 = i < v1.size() ? v1[i] : 0
int val2 = i < v2.size() ? v2[i] : 0
if (val1 < val2) {
return false
} else if (val1 > val2) {
return true
}
}
return true
}

repositories {
mavenCentral()
Expand All @@ -13,9 +28,17 @@ buildscript {
dependencies {
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version")
}

ext {
if (!isVersionAtLeast(kotlin_version, requiredKotlinVersion)) {
throw new GradleException("Kotlin version mismatch: Project is using Kotlin version $kotlin_version, but it must be at least $requiredKotlinVersion. Please update the Kotlin version.")
} else {
println("Kotlin version is correct: $kotlin_version")
}
}
}

// This looks funny but it's necessary to keep backwards compatibility (:
// This looks funny but it's necessary to keep backwards compatibility (:
def safeExtGet(prop) {
return rootProject.ext.has(prop) ?
rootProject.ext.get(prop) : rootProject.ext.has("RNVideo_" + prop) ?
Expand Down Expand Up @@ -184,7 +207,6 @@ repositories {
}

def media3_version = safeExtGet('media3Version')
def kotlin_version = safeExtGet('kotlinVersion')
def androidxCore_version = safeExtGet('androidxCoreVersion')
def androidxActivity_version = safeExtGet('androidxActivityVersion')

Expand Down Expand Up @@ -239,7 +261,7 @@ dependencies {
implementation "androidx.media3:media3-exoplayer-rtsp:$media3_version"
}
}

// For ad insertion using the Interactive Media Ads SDK with ExoPlayer
if (ExoplayerDependencies["useExoplayerIMA"]) {
if (media3_buildFromSource) {
Expand Down Expand Up @@ -280,5 +302,4 @@ dependencies {
// Common functionality used across multiple media libraries
implementation "androidx.media3:media3-common:$media3_version"
}
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
}
}
2 changes: 1 addition & 1 deletion android/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
RNVideo_kotlinVersion=1.7.0
RNVideo_kotlinVersion=1.8.0
RNVideo_minSdkVersion=23
RNVideo_targetSdkVersion=34
RNVideo_compileSdkVersion=34
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ enum class EventTypes(val eventName: String) {
fun toMap() =
mutableMapOf<String, Any>().apply {
EventTypes.values().toList().forEach { eventType ->
put("top${eventType.eventName.removePrefix("on")}", mapOf("registrationName" to eventType.eventName))
put("top${eventType.eventName.removePrefix("on")}", hashMapOf("registrationName" to eventType.eventName))
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@ class AspectRatioFrameLayout(context: Context) : FrameLayout(context) {

// Scale video if it doesn't fill the measuredWidth
if (width < measuredWidth) {
val scaleFactor: Int = measuredWidth / width
width *= scaleFactor
height = measuredHeight * scaleFactor
val scaleFactor: Float = measuredWidth.toFloat() / width
width = (scaleFactor * width).toInt()
height = (scaleFactor * height).toInt()
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -272,12 +272,11 @@ private void updateForCurrentTrackSelections(Tracks tracks) {
// There are weird cases when video height and width did not change with rotation so we need change aspect ration to fix it
switch (format.rotationDegrees) {
// update aspect ratio !
case 90, 270 -> {
case 90:
case 270:
layout.setVideoAspectRatio(format.width == 0 ? 1 : (format.height * format.pixelWidthHeightRatio) / format.width);
}
default -> {
default:
layout.setVideoAspectRatio(format.height == 0 ? 1 : (format.width * format.pixelWidthHeightRatio) / format.height);
}
}
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ public class ReactExoplayerView extends FrameLayout implements
private long resumePosition;
private boolean loadVideoStarted;
private boolean isFullscreen;
private boolean originalFitsSystemWindows;
private boolean isInBackground;
private boolean isPaused;
private boolean isBuffering;
Expand Down Expand Up @@ -1833,6 +1834,7 @@ public void setFullscreen(boolean fullscreen) {
fullScreenPlayerView.show();
}
UiThreadUtil.runOnUiThread(() -> {
originalFitsSystemWindows = window.getDecorView().getFitsSystemWindows();
WindowCompat.setDecorFitsSystemWindows(window, false);
controller.hide(WindowInsetsCompat.Type.systemBars());
controller.setSystemBarsBehavior(WindowInsetsControllerCompat.BEHAVIOR_SHOW_TRANSIENT_BARS_BY_SWIPE);
Expand All @@ -1846,7 +1848,7 @@ public void setFullscreen(boolean fullscreen) {
setControls(controls);
}
UiThreadUtil.runOnUiThread(() -> {
WindowCompat.setDecorFitsSystemWindows(window, true);
WindowCompat.setDecorFitsSystemWindows(window, originalFitsSystemWindows);
controller.show(WindowInsetsCompat.Type.systemBars());
eventEmitter.onVideoFullscreenPlayerDidDismiss.invoke();
});
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package com.brentvatne.receiver

interface BecomingNoisyListener {
companion object {
val NO_OP = object : BecomingNoisyListener {
override fun onAudioBecomingNoisy() {
// NO_OP
}
}
}
fun onAudioBecomingNoisy()
}
2 changes: 1 addition & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# react-native-video-docs

This is the documentation for the [react-native-video](github.com/TheWidlarzGroup/react-native-video).
This is the documentation for the [react-native-video](github.com/miquido/react-native-video).
Project is using [bun](https://bun.sh) to build and run the documentation.
Framework for static site generation is [Nextra](https://nextra.site/docs)

Expand Down
2 changes: 1 addition & 1 deletion docs/pages/_meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"changelog": {
"title": "Changelog",
"newWindow": true,
"href": "https://github.com/TheWidlarzGroup/react-native-video/blob/master/CHANGELOG.md"
"href": "https://github.com/miquido/react-native-video/blob/master/CHANGELOG.md"
},
"separator_community": {
"type": "separator",
Expand Down
2 changes: 1 addition & 1 deletion docs/pages/component/ads.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ adTagUrl="https://pubads.g.doubleclick.net/gampad/ads?iu=/21775744923/external/v
> NOTE: Video ads cannot start when you are using the PIP on iOS (more info available at [Google IMA SDK Docs](https://developers.google.com/interactive-media-ads/docs/sdks/ios/client-side/picture_in_picture?hl=en#starting_ads)). If you are using custom controls, you must hide your PIP button when you receive the ```STARTED``` event from ```onReceiveAdEvent``` and show it again when you receive the ```ALL_ADS_COMPLETED``` event.
### Events
To receive events from IMA SDK, you need to pass `onReceiveAdEvent` prop to `Video` component. List of events, you can find [here](https://github.com/TheWidlarzGroup/react-native-video/blob/master/src/types/Ads.ts)
To receive events from IMA SDK, you need to pass `onReceiveAdEvent` prop to `Video` component. List of events, you can find [here](https://github.com/miquido/react-native-video/blob/master/src/types/Ads.ts)

Example:

Expand Down
33 changes: 31 additions & 2 deletions docs/pages/component/props.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -441,13 +441,26 @@ Determine whether the media should continue playing when notifications or the Co
### `poster`

<PlatformsList types={['All']} />
> [!WARNING]
> Value: string with a URL for the poster is deprecated, use `poster` as object instead
An image to display while the video is loading

Value: string with a URL for the poster, e.g. "https://baconmockup.com/300/200/"
Value: Props for the `Image` component. The poster is visible when the source attribute is provided.

### `posterResizeMode`
```javascript
<Video>
poster={{
source: { uri: "https://baconmockup.com/300/200/" },
resizeMode: "cover",
// ...
}}
</Video>
````

### `posterResizeMode`
> [!WARNING]
> deprecated, use `poster` with `resizeMode` key instead
<PlatformsList types={['All']} />

Determines how to resize the poster image when the frame doesn't match the raw video dimensions.
Expand Down Expand Up @@ -493,6 +506,22 @@ Speed at which the media should play.
- **1.0** - Play at normal speed (default)
- **Other values** - Slow down or speed up playback

### `renderLoader`

<PlatformsList types={['All']} />

Allows you to create custom components to display while the video is loading. If `renderLoader` is provided, `poster` and `posterResizeMode` will be ignored.

```javascript
<Video>
renderLoader={
<View>
<Text>Custom Loader</Text>
</View>
}
</Video>
````
### `repeat`
<PlatformsList types={['All']} />
Expand Down
10 changes: 6 additions & 4 deletions docs/pages/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Run `pod install` in the `ios` directory of your project.

### Enable custom feature in podfile file

Samples available in sample app see [sample pod file](https://github.com/TheWidlarzGroup/react-native-video/blob/9c669a2d8a53df36773fd82ff0917280d0659bc7/examples/basic/ios/Podfile#L34)
Samples available in sample app see [sample pod file](https://github.com/miquido/react-native-video/blob/9c669a2d8a53df36773fd82ff0917280d0659bc7/examples/basic/ios/Podfile#L34)

#### Video caching

Expand Down Expand Up @@ -57,12 +57,14 @@ $RNVideoUseGoogleIMA=true

## Android

From version >= 6.0.0, your application needs to have kotlin version >= 1.7.0
From version >= 6.0.0, your application needs to have kotlin version >= 1.8.0

```:
buildscript {
...
ext.kotlinVersion = '1.7.0'
ext.kotlinVersion = '1.8.0',
ext.compileSdkVersion = 34
ext.targetSdkVersion = 34
...
}
```
Expand Down Expand Up @@ -98,7 +100,7 @@ buildscript {
}
```

See [sample app](https://github.com/TheWidlarzGroup/react-native-video/blob/9c669a2d8a53df36773fd82ff0917280d0659bc7/examples/basic/android/build.gradle#L14C5-L14C5)
See [sample app](https://github.com/miquido/react-native-video/blob/9c669a2d8a53df36773fd82ff0917280d0659bc7/examples/basic/android/build.gradle#L14C5-L14C5)

</details>
<details>
Expand Down
2 changes: 1 addition & 1 deletion docs/pages/other/debug.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ This repository contains multiple a sample implementation in example folder.
It is always preferable to test behavior on a sample app than in a full app implementation.
The basic sample allow to test a lot of feature.
To use the sample you will need to do steps:
- Clone this repository: ``` git clone [email protected]:TheWidlarzGroup/react-native-video.git```
- Clone this repository: ``` git clone [email protected]:miquido/react-native-video.git```
- Go to root folder and build it. It will generate a transpiled version of the package in lib folder: ```cd react-native-video && yarn && yarn build```
- Go to the sample and install it: ```cd example/basic && yarn install```
- Build it ! for android ```yarn android``` for ios ```cd ios && pod install && cd .. && yarn ios```
Expand Down
8 changes: 4 additions & 4 deletions docs/theme.config.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export default {
/>
<meta
name="og:image"
content="https://thewidlarzgroup.github.io/react-native-video/thumbnail.jpg"
content="https://miquido.github.io/react-native-video/thumbnail.jpg"
/>
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:title" content="React Native Video" />
Expand All @@ -23,7 +23,7 @@ export default {
/>
<meta
name="twitter:image"
content="https://thewidlarzgroup.github.io/react-native-video/thumbnail.jpg"
content="https://miquido.github.io/react-native-video/thumbnail.jpg"
/>
<meta name="twitter:image:alt" content="React Native Video" />
<link rel="preconnect" href="https://fonts.googleapis.com" />
Expand All @@ -41,10 +41,10 @@ export default {
),
faviconGlyph: '🎬',
project: {
link: 'https://github.com/TheWidlarzGroup/react-native-video',
link: 'https://github.com/miquido/react-native-video',
},
docsRepositoryBase:
'https://github.com/TheWidlarzGroup/react-native-video/tree/master/docs/',
'https://github.com/miquido/react-native-video/tree/main-dxp/docs',
footer: {
text: (
<span>
Expand Down
6 changes: 4 additions & 2 deletions examples/basic/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,10 @@ android {
namespace "com.videoplayer"

compileOptions {
// These options are necessary to be able to build fro source
coreLibraryDesugaringEnabled true
// These options are necessary to be able to build from source
// coreLibraryDesugaringEnabled is mandatory to be able to build exoplayer from source
// uncomment this line if you want to build from source
// coreLibraryDesugaringEnabled true
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}
Expand Down
Loading

0 comments on commit 6b0c759

Please sign in to comment.