fix(android): allow chunk less preparation (#3913)
This commit is contained in:
parent
84bb910d10
commit
264b57aa2e
@ -46,10 +46,10 @@ class Source {
|
|||||||
/** http header list */
|
/** http header list */
|
||||||
val headers: MutableMap<String, String> = HashMap()
|
val headers: MutableMap<String, String> = HashMap()
|
||||||
|
|
||||||
/** enable chunckless preparation for HLS
|
/** enable chunkless preparation for HLS
|
||||||
* see:
|
* see:
|
||||||
*/
|
*/
|
||||||
var textTracksAllowChuncklessPreparation: Boolean = false
|
var textTracksAllowChunklessPreparation: Boolean = false
|
||||||
|
|
||||||
override fun hashCode(): Int = Objects.hash(uriString, uri, startPositionMs, cropStartMs, cropEndMs, extension, metadata, headers)
|
override fun hashCode(): Int = Objects.hash(uriString, uri, startPositionMs, cropStartMs, cropEndMs, extension, metadata, headers)
|
||||||
|
|
||||||
@ -123,7 +123,7 @@ class Source {
|
|||||||
private const val PROP_SRC_TYPE = "type"
|
private const val PROP_SRC_TYPE = "type"
|
||||||
private const val PROP_SRC_METADATA = "metadata"
|
private const val PROP_SRC_METADATA = "metadata"
|
||||||
private const val PROP_SRC_HEADERS = "requestHeaders"
|
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")
|
@SuppressLint("DiscouragedApi")
|
||||||
private fun getUriFromAssetId(context: Context, uriString: String): Uri? {
|
private fun getUriFromAssetId(context: Context, uriString: String): Uri? {
|
||||||
@ -180,7 +180,7 @@ class Source {
|
|||||||
source.cropStartMs = safeGetInt(src, PROP_SRC_CROP_START, -1)
|
source.cropStartMs = safeGetInt(src, PROP_SRC_CROP_START, -1)
|
||||||
source.cropEndMs = safeGetInt(src, PROP_SRC_CROP_END, -1)
|
source.cropEndMs = safeGetInt(src, PROP_SRC_CROP_END, -1)
|
||||||
source.extension = safeGetString(src, PROP_SRC_TYPE, null)
|
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)
|
val propSrcHeadersArray = safeGetArray(src, PROP_SRC_HEADERS)
|
||||||
if (propSrcHeadersArray != null) {
|
if (propSrcHeadersArray != null) {
|
||||||
|
@ -1046,7 +1046,7 @@ public class ReactExoplayerView extends FrameLayout implements
|
|||||||
|
|
||||||
mediaSourceFactory = new HlsMediaSource.Factory(
|
mediaSourceFactory = new HlsMediaSource.Factory(
|
||||||
mediaDataSourceFactory
|
mediaDataSourceFactory
|
||||||
).setAllowChunklessPreparation(source.getTextTracksAllowChuncklessPreparation());
|
).setAllowChunklessPreparation(source.getTextTracksAllowChunklessPreparation());
|
||||||
break;
|
break;
|
||||||
case CONTENT_TYPE_OTHER:
|
case CONTENT_TYPE_OTHER:
|
||||||
if ("asset".equals(uri.getScheme())) {
|
if ("asset".equals(uri.getScheme())) {
|
||||||
|
@ -150,6 +150,7 @@ class VideoPlayer extends Component {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
description: '(hls|live) red bull tv',
|
description: '(hls|live) red bull tv',
|
||||||
|
textTracksAllowChunklessPreparation: false,
|
||||||
uri: 'https://rbmn-live.akamaized.net/hls/live/590964/BoRB-AT/master_928.m3u8',
|
uri: 'https://rbmn-live.akamaized.net/hls/live/590964/BoRB-AT/master_928.m3u8',
|
||||||
metadata: {
|
metadata: {
|
||||||
title: 'Custom Title',
|
title: 'Custom Title',
|
||||||
|
@ -170,6 +170,8 @@ const Video = forwardRef<VideoRef, ReactVideoProps>(
|
|||||||
cropStart: resolvedSource.cropStart || 0,
|
cropStart: resolvedSource.cropStart || 0,
|
||||||
cropEnd: resolvedSource.cropEnd,
|
cropEnd: resolvedSource.cropEnd,
|
||||||
metadata: resolvedSource.metadata,
|
metadata: resolvedSource.metadata,
|
||||||
|
textTracksAllowChunklessPreparation:
|
||||||
|
resolvedSource.textTracksAllowChunklessPreparation,
|
||||||
};
|
};
|
||||||
}, [source]);
|
}, [source]);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user