ChunkIndexMerger


@UnstableApi
class ChunkIndexMerger


A utility class for merging multiple ChunkIndex instances into a single .

This is useful in scenarios where media is split across multiple segments or sources, and a unified index is needed for seeking or playback.

Summary

Public constructors

Creates an instance.

Public functions

Unit
add(chunk: ChunkIndex!)

Adds a ChunkIndex to be merged.

Unit

Clears all added chunk indices and internal state.

ChunkIndex!

Returns a single ChunkIndex that merges all added chunk indices.

Int

Returns the number of chunk indices added so far.

Public constructors

ChunkIndexMerger

ChunkIndexMerger()

Creates an instance.

Public functions

add

fun add(chunk: ChunkIndex!): Unit

Adds a ChunkIndex to be merged.

Chunk indices with duplicate starting timestamps are ignored to avoid redundant data.

Parameters
chunk: ChunkIndex!

The ChunkIndex to add.

clear

fun clear(): Unit

Clears all added chunk indices and internal state.

merge

fun merge(): ChunkIndex!

Returns a single ChunkIndex that merges all added chunk indices.

size

fun size(): Int

Returns the number of chunk indices added so far.