mirror of
https://github.com/androidx/media.git
synced 2025-05-12 10:09:55 +08:00
Add FLAG_MIGHT_NOT_USE_FULL_NETWORK_SPEED to HLS preload media chunks
Issue: #5011 PiperOrigin-RevId: 345425048
This commit is contained in:
parent
09509c2390
commit
4907c2153b
@ -15,6 +15,8 @@
|
||||
*/
|
||||
package com.google.android.exoplayer2.source.hls;
|
||||
|
||||
import static com.google.android.exoplayer2.upstream.DataSpec.FLAG_MIGHT_NOT_USE_FULL_NETWORK_SPEED;
|
||||
|
||||
import android.net.Uri;
|
||||
import androidx.annotation.Nullable;
|
||||
import com.google.android.exoplayer2.C;
|
||||
@ -92,10 +94,12 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
|
||||
// Media segment.
|
||||
HlsMediaPlaylist.SegmentBase mediaSegment = segmentBaseHolder.segmentBase;
|
||||
DataSpec dataSpec =
|
||||
new DataSpec(
|
||||
UriUtil.resolveToUri(mediaPlaylist.baseUri, mediaSegment.url),
|
||||
mediaSegment.byteRangeOffset,
|
||||
mediaSegment.byteRangeLength);
|
||||
new DataSpec.Builder()
|
||||
.setUri(UriUtil.resolveToUri(mediaPlaylist.baseUri, mediaSegment.url))
|
||||
.setPosition(mediaSegment.byteRangeOffset)
|
||||
.setLength(mediaSegment.byteRangeLength)
|
||||
.setFlags(segmentBaseHolder.isPreload ? FLAG_MIGHT_NOT_USE_FULL_NETWORK_SPEED : 0)
|
||||
.build();
|
||||
boolean mediaSegmentEncrypted = mediaSegmentKey != null;
|
||||
@Nullable
|
||||
byte[] mediaSegmentIv =
|
||||
|
Loading…
x
Reference in New Issue
Block a user