Skip to content

Commit

Permalink
(sync): Update to 6.3.0 (#28)
Browse files Browse the repository at this point in the history
  • Loading branch information
romansavka-mq authored Jul 3, 2024
2 parents f5c1b58 + 9accb51 commit 577dc6b
Show file tree
Hide file tree
Showing 43 changed files with 4,038 additions and 546 deletions.
24 changes: 24 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,27 @@
# [6.3.0+dolbyxp.1.4](https://github.com/miquido/react-native-video/compare/6.2.0+dolbyxp.1.4...miquido:react-native-video:6.3.0+dolbyxp.1.4)

Sync with 6.3.0.

# [6.3.0](https://github.com/TheWidlarzGroup/react-native-video/compare/v6.2.0...v6.3.0) (2024-06-22)


### Bug Fixes

* **android:** allow chunk less preparation ([#3913](https://github.com/TheWidlarzGroup/react-native-video/issues/3913)) ([264b57a](https://github.com/TheWidlarzGroup/react-native-video/commit/264b57aa2ed01b52c09b2992d5ca61e33871315b))
* **android:** avoid crash multiplayer with notification ([#3931](https://github.com/TheWidlarzGroup/react-native-video/issues/3931)) ([104ee70](https://github.com/TheWidlarzGroup/react-native-video/commit/104ee703bac0f7d5fb162d17c30f65f8071d07a6))
* **android:** show controls in notification on older androids ([#3886](https://github.com/TheWidlarzGroup/react-native-video/issues/3886)) ([098a754](https://github.com/TheWidlarzGroup/react-native-video/commit/098a754110a2c58fc18062769f4dd83775d20de4))
* **android:** use UI thread to pause when lost audio focus ([#3916](https://github.com/TheWidlarzGroup/react-native-video/issues/3916)) ([856b1dd](https://github.com/TheWidlarzGroup/react-native-video/commit/856b1dd58ba9bb1832397ee0fc86f778f737798f))
* **ios:** crash on ads after leaving the app ([#3911](https://github.com/TheWidlarzGroup/react-native-video/issues/3911)) ([3d6bc94](https://github.com/TheWidlarzGroup/react-native-video/commit/3d6bc9409c2111760620a821466b0ea0f1970681))
* **ios:** missing notification controls when enabled from start ([#3898](https://github.com/TheWidlarzGroup/react-native-video/issues/3898)) ([2d793db](https://github.com/TheWidlarzGroup/react-native-video/commit/2d793dbde16cc140d1e7b873c40ff4dec285e253))
* **JS:** safety check on resolve uri ([#3915](https://github.com/TheWidlarzGroup/react-native-video/issues/3915)) ([84bb910](https://github.com/TheWidlarzGroup/react-native-video/commit/84bb910d10e3e3d70f9e92b57c17de829d73218a))
* **typescript:** type checks on selectedTextTrack, selectedAudioTrack, selectedVideoTrack ([#3910](https://github.com/TheWidlarzGroup/react-native-video/issues/3910)) ([dc2a2ab](https://github.com/TheWidlarzGroup/react-native-video/commit/dc2a2ab863dc53fb2da1c2cea99e59e6d8387803))


### Features

* **android:** add `onControlsVisiblityChange` ([#3925](https://github.com/TheWidlarzGroup/react-native-video/issues/3925)) ([c2ce372](https://github.com/TheWidlarzGroup/react-native-video/commit/c2ce372bcf21e21b97878e7efe77780168d09a79))
* **ios:** add live key to now playing dict to decorate when livestream playing ([#3922](https://github.com/TheWidlarzGroup/react-native-video/issues/3922)) ([91751ab](https://github.com/TheWidlarzGroup/react-native-video/commit/91751abc870109e0a2667dfffbd2baa2e4cf997b))

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


Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
package androidx.media3.exoplayer.dash;

import androidx.media3.common.MediaItem;
import androidx.media3.datasource.DataSource;
import androidx.media3.exoplayer.drm.DrmSessionManagerProvider;
import androidx.media3.exoplayer.source.MediaSource;
import androidx.media3.exoplayer.upstream.LoadErrorHandlingPolicy;

public class DashMediaSource {
public static class Factory implements MediaSource.Factory {

public Factory(DefaultDashChunkSource.Factory factory, DataSource.Factory factory1) {
}

@Override
public MediaSource.Factory setDrmSessionManagerProvider(DrmSessionManagerProvider drmSessionManagerProvider) {
return null;
}

@Override
public MediaSource.Factory setLoadErrorHandlingPolicy(LoadErrorHandlingPolicy loadErrorHandlingPolicy) {
return null;
}

@Override
public int[] getSupportedTypes() {
return new int[0];
}

@Override
public MediaSource createMediaSource(MediaItem mediaItem) {
return null;
}
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package androidx.media3.exoplayer.dash;

import androidx.media3.datasource.DataSource;

public class DefaultDashChunkSource {
public static final class Factory {
public Factory(DataSource.Factory mediaDataSourceFactory) {
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package androidx.media3.exoplayer.hls;

import androidx.media3.common.MediaItem;
import androidx.media3.datasource.DataSource;
import androidx.media3.exoplayer.drm.DrmSessionManagerProvider;
import androidx.media3.exoplayer.source.MediaSource;
import androidx.media3.exoplayer.upstream.LoadErrorHandlingPolicy;

public class HlsMediaSource {
public static class Factory implements MediaSource.Factory {
public Factory(DataSource.Factory mediaDataSourceFactory) {
}

@Override
public MediaSource.Factory setDrmSessionManagerProvider(DrmSessionManagerProvider drmSessionManagerProvider) {
return null;
}

@Override
public MediaSource.Factory setLoadErrorHandlingPolicy(LoadErrorHandlingPolicy loadErrorHandlingPolicy) {
return null;
}

@Override
public int[] getSupportedTypes() {
return new int[0];
}

@Override
public MediaSource createMediaSource(MediaItem mediaItem) {
return null;
}

public Factory setAllowChunklessPreparation(boolean allowChunklessPreparation) {
return this;
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package androidx.media3.exoplayer.rtsp;

import androidx.media3.common.MediaItem;
import androidx.media3.exoplayer.drm.DrmSessionManagerProvider;
import androidx.media3.exoplayer.source.MediaSource;
import androidx.media3.exoplayer.upstream.LoadErrorHandlingPolicy;

public class RtspMediaSource {
public RtspMediaSource() {

}

public static class Factory implements MediaSource.Factory {
@Override
public MediaSource.Factory setDrmSessionManagerProvider(DrmSessionManagerProvider drmSessionManagerProvider) {
return null;
}

@Override
public MediaSource.Factory setLoadErrorHandlingPolicy(LoadErrorHandlingPolicy loadErrorHandlingPolicy) {
return null;
}

@Override
public int[] getSupportedTypes() {
return new int[0];
}

@Override
public MediaSource createMediaSource(MediaItem mediaItem) {
return null;
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package androidx.media3.exoplayer.smoothstreaming;

import androidx.media3.common.MediaItem;
import androidx.media3.datasource.DataSource;
import androidx.media3.exoplayer.drm.DrmSessionManagerProvider;
import androidx.media3.exoplayer.source.MediaSource;
import androidx.media3.exoplayer.upstream.LoadErrorHandlingPolicy;

public class DefaultSsChunkSource {
public static class Factory implements MediaSource.Factory {
public Factory(DataSource.Factory mediaDataSourceFactory) {
}

@Override
public MediaSource.Factory setDrmSessionManagerProvider(DrmSessionManagerProvider drmSessionManagerProvider) {
return null;
}

@Override
public MediaSource.Factory setLoadErrorHandlingPolicy(LoadErrorHandlingPolicy loadErrorHandlingPolicy) {
return null;
}

@Override
public int[] getSupportedTypes() {
return new int[0];
}

@Override
public MediaSource createMediaSource(MediaItem mediaItem) {
return null;
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package androidx.media3.exoplayer.smoothstreaming;

import androidx.media3.common.MediaItem;
import androidx.media3.datasource.DataSource;
import androidx.media3.exoplayer.drm.DrmSessionManagerProvider;
import androidx.media3.exoplayer.source.MediaSource;
import androidx.media3.exoplayer.upstream.LoadErrorHandlingPolicy;

public class SsMediaSource {
public static class Factory implements MediaSource.Factory {
public Factory(DefaultSsChunkSource.Factory factory, DataSource.Factory factory1) {
}

@Override
public MediaSource.Factory setDrmSessionManagerProvider(DrmSessionManagerProvider drmSessionManagerProvider) {
return null;
}

@Override
public MediaSource.Factory setLoadErrorHandlingPolicy(LoadErrorHandlingPolicy loadErrorHandlingPolicy) {
return null;
}

@Override
public int[] getSupportedTypes() {
return new int[0];
}

@Override
public MediaSource createMediaSource(MediaItem mediaItem) {
return null;
}
}
}
66 changes: 66 additions & 0 deletions android/src/main/java/com/brentvatne/common/api/DRMProps.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
package com.brentvatne.common.api

import com.brentvatne.common.toolbox.ReactBridgeUtils.safeGetArray
import com.brentvatne.common.toolbox.ReactBridgeUtils.safeGetString
import com.facebook.react.bridge.ReadableMap
import java.util.UUID

/**
* Class representing DRM props for host.
* Only generic code here, no reference to the player.
*/
class DRMProps {
/**
* string version of configured UUID for drm prop
*/
var drmType: String? = null

/**
* Configured UUID for drm prop
*/
var drmUUID: UUID? = null

/**
* DRM license server to be used
*/
var drmLicenseServer: String? = null

/**
* DRM Http Header to access to license server
*/
var drmLicenseHeader: Array<String> = emptyArray<String>()
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"

/** parse the source ReadableMap received from app */
@JvmStatic
fun parse(src: ReadableMap?): DRMProps? {
var drm: DRMProps? = null
if (src != null && src.hasKey(PROP_DRM_TYPE)) {
drm = DRMProps()
drm.drmType = safeGetString(src, PROP_DRM_TYPE)
drm.drmLicenseServer = safeGetString(src, PROP_DRM_LICENSE_SERVER)
val drmHeadersArray = safeGetArray(src, PROP_DRM_HEADERS)
if (drm.drmType != null && drm.drmLicenseServer != null) {
if (drmHeadersArray != null) {
val drmKeyRequestPropertiesList = ArrayList<String?>()
for (i in 0 until drmHeadersArray.size()) {
val current = drmHeadersArray.getMap(i)
drmKeyRequestPropertiesList.add(safeGetString(current, PROP_DRM_HEADERS_KEY))
drmKeyRequestPropertiesList.add(safeGetString(current, PROP_DRM_HEADERS_VALUE))
}
val array = emptyArray<String>()
drm.drmLicenseHeader = drmKeyRequestPropertiesList.toArray(array)
}
} else {
return null
}
}
return drm
}
}
}
8 changes: 4 additions & 4 deletions android/src/main/java/com/brentvatne/common/api/Source.kt
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ class Source {
/** http header list */
val headers: MutableMap<String, String> = HashMap()

/** enable chunckless preparation for HLS
/** enable chunkless preparation for HLS
* see:
*/
var textTracksAllowChuncklessPreparation: Boolean = false
var textTracksAllowChunklessPreparation: Boolean = false

override fun hashCode(): Int = Objects.hash(uriString, uri, startPositionMs, cropStartMs, cropEndMs, extension, metadata, headers)

Expand Down Expand Up @@ -123,7 +123,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_TEXT_TRACKS_ALLOW_CHUNCKLESS_PREPARATION = "textTracksAllowChunklessPreparation"
private const val PROP_SRC_TEXT_TRACKS_ALLOW_CHUNKLESS_PREPARATION = "textTracksAllowChunklessPreparation"

@SuppressLint("DiscouragedApi")
private fun getUriFromAssetId(context: Context, uriString: String): Uri? {
Expand Down Expand Up @@ -180,7 +180,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.textTracksAllowChuncklessPreparation = safeGetBool(src, PROP_SRC_TEXT_TRACKS_ALLOW_CHUNCKLESS_PREPARATION, true)
source.textTracksAllowChunklessPreparation = safeGetBool(src, PROP_SRC_TEXT_TRACKS_ALLOW_CHUNKLESS_PREPARATION, true)

val propSrcHeadersArray = safeGetArray(src, PROP_SRC_HEADERS)
if (propSrcHeadersArray != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ public VideoEventEmitter(ReactContext reactContext) {
private static final String EVENT_ERROR = "onVideoError";
private static final String EVENT_PROGRESS = "onVideoProgress";
private static final String EVENT_BANDWIDTH = "onVideoBandwidthUpdate";
private static final String EVENT_CONTROLS_VISIBILITY_CHANGE = "onControlsVisibilityChange";
private static final String EVENT_SEEK = "onVideoSeek";
private static final String EVENT_END = "onVideoEnd";
private static final String EVENT_FULLSCREEN_WILL_PRESENT = "onVideoFullscreenPlayerWillPresent";
Expand Down Expand Up @@ -95,6 +96,7 @@ public VideoEventEmitter(ReactContext reactContext) {
EVENT_TEXT_TRACK_DATA_CHANGED,
EVENT_VIDEO_TRACKS,
EVENT_BANDWIDTH,
EVENT_CONTROLS_VISIBILITY_CHANGE,
EVENT_ON_RECEIVE_AD_EVENT
};

Expand Down Expand Up @@ -126,6 +128,7 @@ public VideoEventEmitter(ReactContext reactContext) {
EVENT_TEXT_TRACK_DATA_CHANGED,
EVENT_VIDEO_TRACKS,
EVENT_BANDWIDTH,
EVENT_CONTROLS_VISIBILITY_CHANGE,
EVENT_ON_RECEIVE_AD_EVENT
})
@interface VideoEvents {
Expand Down Expand Up @@ -170,6 +173,8 @@ public VideoEventEmitter(ReactContext reactContext) {

private static final String EVENT_PROP_IS_PLAYING = "isPlaying";

private static final String EVENT_CONTROLS_VISIBLE = "isVisible";

public void setViewId(int viewId) {
this.viewId = viewId;
}
Expand Down Expand Up @@ -324,6 +329,12 @@ public void end() {
receiveEvent(EVENT_END, null);
}

public void controlsVisibilityChanged(boolean isVisible) {
WritableMap map = Arguments.createMap();
map.putBoolean(EVENT_CONTROLS_VISIBLE, isVisible);
receiveEvent(EVENT_CONTROLS_VISIBILITY_CHANGE, map);
}

public void fullscreenWillPresent() {
receiveEvent(EVENT_FULLSCREEN_WILL_PRESENT, null);
}
Expand Down
Loading

0 comments on commit 577dc6b

Please sign in to comment.