Function: readTrun()
ts
function readTrun(cursor): TrackRunBox;Defined in: readers/readTrun.ts:28
Read the trun box (TrackRunBox).
ISO/IEC 14496-12:2015 - 8.8.8
If the box sets at least one of the flags 0x000100 to 0x000800, the reader creates one object for each sample of sample_count. Each object has the four sample fields in the same order. A field that the flags exclude is undefined. If the box sets none of these flags, the sample records have 0 bytes. The reader then returns sample_count as sampleCount and creates no sample objects.
Parameters
cursor
The read cursor at the first byte after the box header
Returns
A parsed TrackRunBox
Throws
RangeError if the sample records of sample_count pass the end of the box. The reader checks the count before it creates the objects.