Class: VirtualSourceBuffer

VirtualSourceBuffer

new VirtualSourceBuffer(mediaSource, codecs)

VirtualSourceBuffers exist so that we can transmux non native formats into a native format, but keep the same api as a native source buffer. It creates a transmuxer, that works in its own thread (a web worker) and that transmuxer muxes the data into a native format. VirtualSourceBuffer will then send all of that data to the naive sourcebuffer so that it is indestinguishable from a natively supported format.
Parameters:
Name Type Description
mediaSource HtmlMediaSource the parent mediaSource
codecs Array array of codecs that we will be dealing with
Source:

Extends

  • video.js.EventTarget

Methods

abort()

Emulate the native mediasource function. abort any soureBuffer actions and throw out any un-appended data.
Source:

appendBuffer(segment)

Emulate the native mediasource function, but our function will send all of the proposed segments to the transmuxer so that we can transmux them before we append them to our internal native source buffers in the correct format.
Parameters:
Name Type Description
segment Uint8Array the segment to append to the buffer
Source:

remove(start, end)

Emulate the native mediasource function and remove parts of the buffer from any of our internal buffers that exist
Parameters:
Name Type Description
start Double position to start the remove at
end Double position to end the remove at
Source: