FragmentTracker
Extends:
Constructor Summary
Public Constructor | ||
public |
|
Member Summary
Public Members | ||
public |
|
|
public |
config: * |
|
public |
fragments: * |
|
public |
timeRanges: * |
Method Summary
Public Methods | ||
public |
destroy() |
|
public |
detectEvictedFragments(elementaryStream: String, timeRange: TimeRanges) Partial fragments effected by coded frame eviction will be removed The browser will unload parts of the buffer to free up memory for new buffer data Fragments will need to be reloaded when the buffer is freed up, removing partial fragments will allow them to reload(since there might be parts that are still playable) |
|
public |
detectPartialFragments(fragment: Object) Checks if the fragment passed in is loaded in the buffer properly Partially loaded fragments will be registered as a partial fragment |
|
public |
getBufferedFrag(position: number, levelType: LevelType): Fragment | null Return a Fragment that match the position and levelType. |
|
public |
getBufferedTimes(startPTS: *, endPTS: *, timeRange: *): {"time": *, "partial": *} |
|
public |
getFragmentKey(fragment: *): string |
|
public |
getPartialFragment(time: Number): Object Gets the partial fragment for a certain time |
|
public |
|
|
public |
hasFragment(fragment: Object): boolean Return true if fragment tracker has the fragment. |
|
public |
isPartial(fragmentEntity: *): * |
|
public |
isTimeBuffered(startPTS: *, endPTS: *, timeRange: *): boolean |
|
public |
onBufferAppended(e: *) Fires when the buffer is updated |
|
public |
onFragBuffered(e: *) Fires after a fragment has been loaded into the source buffer |
|
public |
onFragLoaded(e: *) Fires when a fragment loading is completed |
|
public |
Remove all fragments from fragment tracker. |
|
public |
removeFragment(fragment: Object) Remove a fragment from fragment tracker until it is loaded again |
Public Constructors
public constructor() source
Public Methods
public destroy() source
public detectEvictedFragments(elementaryStream: String, timeRange: TimeRanges) source
Partial fragments effected by coded frame eviction will be removed The browser will unload parts of the buffer to free up memory for new buffer data Fragments will need to be reloaded when the buffer is freed up, removing partial fragments will allow them to reload(since there might be parts that are still playable)
Params:
Name | Type | Attribute | Description |
elementaryStream | String | The elementaryStream of media this is (eg. video/audio) |
|
timeRange | TimeRanges | TimeRange object from a sourceBuffer |
public detectPartialFragments(fragment: Object) source
Checks if the fragment passed in is loaded in the buffer properly Partially loaded fragments will be registered as a partial fragment
Params:
Name | Type | Attribute | Description |
fragment | Object | Check the fragment against all sourceBuffers loaded |
public getBufferedFrag(position: number, levelType: LevelType): Fragment | null source
Return a Fragment that match the position and levelType. If not found any Fragment, return null
Params:
Name | Type | Attribute | Description |
position | number | ||
levelType | LevelType |
public getBufferedTimes(startPTS: *, endPTS: *, timeRange: *): {"time": *, "partial": *} source
Params:
Name | Type | Attribute | Description |
startPTS | * | ||
endPTS | * | ||
timeRange | * |
Return:
{"time": *, "partial": *} |
public getPartialFragment(time: Number): Object source
Gets the partial fragment for a certain time
Params:
Name | Type | Attribute | Description |
time | Number |
Return:
Object | fragment Returns a partial fragment at a time or null if there is no partial fragment |
public getState(fragment: Object): String source
Params:
Name | Type | Attribute | Description |
fragment | Object | The fragment to check |
public hasFragment(fragment: Object): boolean source
Return true if fragment tracker has the fragment.
Params:
Name | Type | Attribute | Description |
fragment | Object |
public isPartial(fragmentEntity: *): * source
Params:
Name | Type | Attribute | Description |
fragmentEntity | * |
Return:
* |
public isTimeBuffered(startPTS: *, endPTS: *, timeRange: *): boolean source
Params:
Name | Type | Attribute | Description |
startPTS | * | ||
endPTS | * | ||
timeRange | * |
public onBufferAppended(e: *) source
Fires when the buffer is updated
Params:
Name | Type | Attribute | Description |
e | * |
public onFragBuffered(e: *) source
Fires after a fragment has been loaded into the source buffer
Params:
Name | Type | Attribute | Description |
e | * |
public onFragLoaded(e: *) source
Fires when a fragment loading is completed
Params:
Name | Type | Attribute | Description |
e | * |