Skip to content

Commit

Permalink
(sync): Update to 6.4.2 (#29)
Browse files Browse the repository at this point in the history
  • Loading branch information
romansavka-mq authored Jul 17, 2024
2 parents b12736c + 0c5f1f3 commit b6b8d4d
Show file tree
Hide file tree
Showing 159 changed files with 8,423 additions and 6,720 deletions.
58 changes: 58 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,61 @@
# [6.4.2+dolbyxp.1.5](https://github.com/miquido/react-native-video/compare/6.3.0+dolbyxp.1.5...miquido:react-native-video:6.4.2+dolbyxp.1.5)

Sync with 6.4.2.

## [6.4.2](https://github.com/TheWidlarzGroup/react-native-video/compare/v6.4.1...v6.4.2) (2024-07-15)


### Bug Fixes

* **android:** exit fullscreen mode after finishing video playback ([#3978](https://github.com/TheWidlarzGroup/react-native-video/issues/3978)) ([4b8d09e](https://github.com/TheWidlarzGroup/react-native-video/commit/4b8d09e61f79a319ba5816dd342b5c0fd02d6e07))
* **android:** fix android notification controller order ([#4002](https://github.com/TheWidlarzGroup/react-native-video/issues/4002)) ([05623c9](https://github.com/TheWidlarzGroup/react-native-video/commit/05623c9f5447f67acb535487de8918210b5ffec7))
* **android:** fix onVideoLoad event field key ([#4001](https://github.com/TheWidlarzGroup/react-native-video/issues/4001)) ([f82268b](https://github.com/TheWidlarzGroup/react-native-video/commit/f82268be1bc33e5c61dbb031d7937197da0b67e5))
* **android:** handle aspect ratio for rotated videos ([#4000](https://github.com/TheWidlarzGroup/react-native-video/issues/4000)) ([0a55ace](https://github.com/TheWidlarzGroup/react-native-video/commit/0a55ace0ca92f56394235f7c651d3a160e6a3c90))
* **android:** resolve compatibility issue ([5cd5e5e](https://github.com/TheWidlarzGroup/react-native-video/commit/5cd5e5efe70b49d76fb27e3220a1df12b32901a6))
* **example/basic:** select resizeMode ([#3989](https://github.com/TheWidlarzGroup/react-native-video/issues/3989)) ([39cf477](https://github.com/TheWidlarzGroup/react-native-video/commit/39cf477ceb37c6ecc38cbdd9077a556c81fd9c3d))
* **ts:** make multiDrm prop optional type ([#3999](https://github.com/TheWidlarzGroup/react-native-video/issues/3999)) ([79c3076](https://github.com/TheWidlarzGroup/react-native-video/commit/79c30767fcf67e75e70ceb64a17736b5e3de63c6))

## [6.4.1](https://github.com/TheWidlarzGroup/react-native-video/compare/v6.4.0...v6.4.1) (2024-07-12)


### Bug Fixes

* expo plugin export ([#3992](https://github.com/TheWidlarzGroup/react-native-video/issues/3992)) ([de8ade0](https://github.com/TheWidlarzGroup/react-native-video/commit/de8ade06202cfdb3dd7fec635b6e8c6cdfd04e47))

## [6.4.0](https://github.com/TheWidlarzGroup/react-native-video/compare/v6.3.0...v6.4.0) (2024-07-12)


* fix(ios): remove pip check for other platforms (#3991) (40a72825)
* feat: add `isSeeking` to `onPlaybackStateChanged` (#3899) (111a5d21)
* chore(android): migrate DataSourceUtil to Kotlin (#3984) (b25e43ee)
* chore(android): migrate AspectRatioFrameLayout to Kotlin (#3985) (452e42f1)
* refactor: move view type and drm in source (#3867) (66dcf32b)
* feat: add expo plugins (#3933) (08f6caa6)
* docs: update deprecated tool (#3982) (25c74e05)
* chore(android): migrate DefaultReactExoplayerConfig to Kotlin (#3983) (1728373d)
* fix(ios): don't pause playback when entering background (#3973) (ccffcfd7)
* chore(example/basic): refactor state variable (#3949) (a3ecc010)
* feat(android): Bump default media3 version from v1.1.1 to v1.3.1 (#3977) :warning: need targetSdkVersion 34 (7562669f)
* feat: modified Fabric example android build.gradle for resolving build issue (#3976) (1d6fb297)
* chore: upgrade react-native & expo version in the basic example app (#3964) (01a00b12)
* refactor(android): migrate VideoEventEmitter to Kotlin (#3962) (3c9b1b57)
* fix(ios): fix fullscreen view controller ANR (#3952) (7def3ac3)
* chore(example/fabric): bump up fabric example android deps (#3957) (de6e7196)
* refactor(ios): refactor NowPlayingInfoCenerManager.swift (#3968) (76c63291)
* fix(android): build issue on the latest react-native version (#3963) (530686ca)
* feat(fabric): updated ios podspec for implementing new architecture (#3961) (df29c231)
* fix(android): fix wrong module name (#3959) (3f11894c)
* refactor(android): migrate ReactVideoPackage to Kotlin (#3955) (702a0d9d)
* refactor(android): migrate VideoDecoderPropertiesModule to Kotlin (#3954) (99585987)
* feat: bump up fabric example react-native iOS (#3951) (e5a2ee3b)
* fix(android): added setAllowChunklessPreparation to HlsMediaSource.Factory to allow build success on projects without HLS support (#3948) (#3950) (322d7e99)
* refactor: basic example from class component to functional component (#3934) (d4f16486)
* chore(android): rework view type (#3940) (b431d09e)
* chore: update homepage field in package.json (#3945) (6e133768)
* feat(android): allow building exoplayer from source (#3932) (a7d834a8)
* feat: add plugins management (#3909) (91d27a60)
* Chore(docs): fix typo (#3938) (3cfb96ad)

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


Expand Down
90 changes: 69 additions & 21 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,11 @@ buildscript {
}
}

// This looks funny but it's necessary to keep backwards compatibility (:
def safeExtGet(prop) {
return rootProject.ext.has(prop) ? rootProject.ext.get(prop) : project.properties["RNVideo_" + prop]
return rootProject.ext.has(prop) ?
rootProject.ext.get(prop) : rootProject.ext.has("RNVideo_" + prop) ?
rootProject.ext.get("RNVideo_" + prop) : project.properties["RNVideo_" + prop]
}

def isNewArchitectureEnabled() {
Expand All @@ -43,6 +46,7 @@ def ExoplayerDependenciesList = [
"useExoplayerHls",
"useExoplayerRtsp",
]
def media3_buildFromSource = safeExtGet('buildFromMedia3Source').toBoolean() ?: false

def ExoplayerDependencies = ExoplayerDependenciesList.collectEntries { property ->
[(property): safeExtGet(property)?.toBoolean() ?: false]
Expand All @@ -52,14 +56,17 @@ ExoplayerDependenciesList.each { propertyName ->
def propertyValue = ExoplayerDependencies[propertyName]
println "$propertyName: $propertyValue"
}
println "buildFromSource: $media3_buildFromSource"

// This string is used to define build path.
// As react native build output directory is react-native path of the module.
// We need to force a new path on each configuration change.
// If you add a new build parameter, please add the new value in this string
def configStringPath = ExoplayerDependencies.collect { property, value ->
property + value
}.join('').md5()
def configStringPath = ExoplayerDependencies
.collect { property, value -> property + value}
.join('')
.concat("buildFromSource:$media3_buildFromSource")
.md5()

if (isNewArchitectureEnabled()) {
apply plugin: "com.facebook.react"
Expand Down Expand Up @@ -191,46 +198,87 @@ dependencies {
implementation "androidx.activity:activity-ktx:$androidxActivity_version"

// For media playback using ExoPlayer
implementation "androidx.media3:media3-exoplayer:$media3_version"
if (media3_buildFromSource) {
implementation(project(":media-lib-exoplayer"))
} else {
implementation "androidx.media3:media3-exoplayer:$media3_version"
}

if (ExoplayerDependencies["useExoplayerSmoothStreaming"]) {
// For Smooth Streaming playback support with ExoPlayer
implementation "androidx.media3:media3-exoplayer-smoothstreaming:$media3_version"
if (media3_buildFromSource) {
implementation(project(":media-lib-exoplayer-smoothstreaming"))
} else {
implementation "androidx.media3:media3-exoplayer-smoothstreaming:$media3_version"
}
}

if (ExoplayerDependencies["useExoplayerDash"]) {
// For DASH playback support with ExoPlayer
implementation "androidx.media3:media3-exoplayer-dash:$media3_version"
if (media3_buildFromSource) {
implementation(project(":media-lib-exoplayer-dash"))
} else {
implementation "androidx.media3:media3-exoplayer-dash:$media3_version"
}
}

if (ExoplayerDependencies["useExoplayerHls"]) {
// For HLS playback support with ExoPlayer
implementation "androidx.media3:media3-exoplayer-hls:$media3_version"
// For HLS playback support with ExoPlayer
if (media3_buildFromSource) {
implementation(project(":media-lib-exoplayer-hls"))
} else {
implementation "androidx.media3:media3-exoplayer-hls:$media3_version"
}
}

// For RTSP playback support with ExoPlayer
if (ExoplayerDependencies["useExoplayerRtsp"]) {
implementation "androidx.media3:media3-exoplayer-rtsp:$media3_version"
if (media3_buildFromSource) {
implementation(project(":media-lib-exoplayer-rtsp"))
} else {
implementation "androidx.media3:media3-exoplayer-rtsp:$media3_version"
}
}

// For ad insertion using the Interactive Media Ads SDK with ExoPlayer
if (ExoplayerDependencies["useExoplayerIMA"]) {
implementation "androidx.media3:media3-exoplayer-ima:$media3_version"
if (media3_buildFromSource) {
implementation(project(":media-lib-exoplayer-ima"))
} else {
implementation "androidx.media3:media3-exoplayer-ima:$media3_version"
}
}

// For loading data using the OkHttp network stack
implementation "androidx.media3:media3-datasource-okhttp:$media3_version"
if (media3_buildFromSource) {
// For loading data using the OkHttp network stack
implementation(project(":media-lib-datasource-okhttp"))

// For building media playback UIs
implementation "androidx.media3:media3-ui:$media3_version"
// For building media playback UIs
implementation(project(":media-lib-ui"))

// For exposing and controlling media sessions
implementation "androidx.media3:media3-session:$media3_version"
// For exposing and controlling media sessions
implementation(project(":media-lib-session"))

// Common functionality for loading data
implementation "androidx.media3:media3-datasource:$media3_version"
// Common functionality used across multiple media libraries
implementation "androidx.media3:media3-common:$media3_version"
// Common functionality for loading data
implementation(project(":media-lib-datasource"))

// Common functionality used across multiple media libraries
implementation(project(":media-lib-common"))
} else {
// For loading data using the OkHttp network stack
implementation "androidx.media3:media3-datasource-okhttp:$media3_version"

// For building media playback UIs
implementation "androidx.media3:media3-ui:$media3_version"

// For exposing and controlling media sessions
implementation "androidx.media3:media3-session:$media3_version"

// Common functionality for loading data
implementation "androidx.media3:media3-datasource:$media3_version"

// Common functionality used across multiple media libraries
implementation "androidx.media3:media3-common:$media3_version"
}
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
}
13 changes: 7 additions & 6 deletions android/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
RNVideo_kotlinVersion=1.7.0
RNVideo_minSdkVersion=21
RNVideo_targetSdkVersion=31
RNVideo_compileSdkVersion=31
RNVideo_ndkversion=21.4.7075529
RNVideo_buildToolsVersion=30.0.2
RNVideo_media3Version=1.1.1
RNVideo_minSdkVersion=23
RNVideo_targetSdkVersion=34
RNVideo_compileSdkVersion=34
RNVideo_ndkversion=26.1.10909125
RNVideo_buildToolsVersion=34.0.0
RNVideo_media3Version=1.3.1
RNVideo_useExoplayerIMA=false
RNVideo_useExoplayerRtsp=false
RNVideo_useExoplayerSmoothStreaming=true
RNVideo_useExoplayerDash=true
RNVideo_useExoplayerHls=true
RNVideo_androidxCoreVersion=1.9.0
RNVideo_androidxActivityVersion=1.7.0
RNVideo_buildFromMedia3Source=false
18 changes: 18 additions & 0 deletions android/src/main/java/com/brentvatne/common/api/DRMProps.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.brentvatne.common.api

import com.brentvatne.common.toolbox.ReactBridgeUtils.safeGetArray
import com.brentvatne.common.toolbox.ReactBridgeUtils.safeGetBool
import com.brentvatne.common.toolbox.ReactBridgeUtils.safeGetString
import com.facebook.react.bridge.ReadableMap
import java.util.UUID
Expand Down Expand Up @@ -29,12 +30,28 @@ class DRMProps {
* DRM Http Header to access to license server
*/
var drmLicenseHeader: Array<String> = emptyArray<String>()

/**
* Flag to enable key rotation support
*/
var multiDrm: Boolean = false

/** return true if this and src are equals */
override fun equals(other: Any?): Boolean {
if (other == null || other !is DRMProps) return false
return drmType == other.drmType &&
drmLicenseServer == other.drmLicenseServer &&
multiDrm == other.multiDrm &&
drmLicenseHeader.contentDeepEquals(other.drmLicenseHeader) // drmLicenseHeader is never null
}

companion object {
private const val PROP_DRM_TYPE = "type"
private const val PROP_DRM_LICENSE_SERVER = "licenseServer"
private const val PROP_DRM_HEADERS = "headers"
private const val PROP_DRM_HEADERS_KEY = "key"
private const val PROP_DRM_HEADERS_VALUE = "value"
private const val PROP_DRM_MULTI_DRM = "multiDrm"

/** parse the source ReadableMap received from app */
@JvmStatic
Expand All @@ -44,6 +61,7 @@ class DRMProps {
drm = DRMProps()
drm.drmType = safeGetString(src, PROP_DRM_TYPE)
drm.drmLicenseServer = safeGetString(src, PROP_DRM_LICENSE_SERVER)
drm.multiDrm = safeGetBool(src, PROP_DRM_MULTI_DRM, false)
val drmHeadersArray = safeGetArray(src, PROP_DRM_HEADERS)
if (drm.drmType != null && drm.drmLicenseServer != null) {
if (drmHeadersArray != null) {
Expand Down
11 changes: 10 additions & 1 deletion android/src/main/java/com/brentvatne/common/api/Source.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import android.content.Context
import android.content.res.Resources
import android.net.Uri
import android.text.TextUtils
import com.brentvatne.common.api.DRMProps.Companion.parse
import com.brentvatne.common.toolbox.DebugLog
import com.brentvatne.common.toolbox.DebugLog.e
import com.brentvatne.common.toolbox.ReactBridgeUtils.safeGetArray
Expand Down Expand Up @@ -46,6 +47,11 @@ class Source {
/** http header list */
val headers: MutableMap<String, String> = HashMap()

/**
* DRM properties linked to the source
*/
var drmProps: DRMProps? = null

/** enable chunkless preparation for HLS
* see:
*/
Expand All @@ -61,7 +67,8 @@ class Source {
cropStartMs == other.cropStartMs &&
cropEndMs == other.cropEndMs &&
startPositionMs == other.startPositionMs &&
extension == other.extension
extension == other.extension &&
drmProps == other.drmProps
)
}

Expand Down Expand Up @@ -123,6 +130,7 @@ class Source {
private const val PROP_SRC_TYPE = "type"
private const val PROP_SRC_METADATA = "metadata"
private const val PROP_SRC_HEADERS = "requestHeaders"
private const val PROP_SRC_DRM = "drm"
private const val PROP_SRC_TEXT_TRACKS_ALLOW_CHUNKLESS_PREPARATION = "textTracksAllowChunklessPreparation"

@SuppressLint("DiscouragedApi")
Expand Down Expand Up @@ -180,6 +188,7 @@ class Source {
source.cropStartMs = safeGetInt(src, PROP_SRC_CROP_START, -1)
source.cropEndMs = safeGetInt(src, PROP_SRC_CROP_END, -1)
source.extension = safeGetString(src, PROP_SRC_TYPE, null)
source.drmProps = parse(safeGetMap(src, PROP_SRC_DRM))
source.textTracksAllowChunklessPreparation = safeGetBool(src, PROP_SRC_TEXT_TRACKS_ALLOW_CHUNKLESS_PREPARATION, true)

val propSrcHeadersArray = safeGetArray(src, PROP_SRC_HEADERS)
Expand Down
19 changes: 19 additions & 0 deletions android/src/main/java/com/brentvatne/common/api/ViewType.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package com.brentvatne.common.api

internal object ViewType {
/**
* View used will be a TextureView.
*/
const val VIEW_TYPE_TEXTURE = 0

/**
* View used will be a SurfaceView.
*/
const val VIEW_TYPE_SURFACE = 1

/**
* View used will be a SurfaceView with secure flag set.
*/
const val VIEW_TYPE_SURFACE_SECURE = 2
annotation class ViewType
}
Loading

0 comments on commit b6b8d4d

Please sign in to comment.