Interface nsIWebVTTParserWrapperType

Interface for a wrapper of a JS WebVTT parser (vtt.js).

Hierarchy

Methods

  • Increases the reference count for this interface. The associated instance will not be deleted unless the reference count is returned to zero.

    Returns

    The resulting reference count.

    Returns number

  • Parameters

    • aIID: object
    • Optional aInstancePtr: object

    Returns any

  • A run time mechanism for interface discovery.

    Returns

    NS_OK if the interface is supported by the associated instance, NS_NOINTERFACE if it is not.

    aInstancePtr must not be null.

    Parameters

    • aIID: object

      [in] A requested interface IID

    • aInstancePtr: object

      [out] A pointer to an interface pointer to receive the result.

    Returns void

  • Decreases the reference count for this interface. Generally, if the reference count returns to zero, the associated instance is deleted.

    Returns

    The resulting reference count.

    Returns number

  • Cancel watching notifications which parser would send.

    Returns void

  • Convert the text content of a WebVTT cue to a document fragment so that we can display it on the page.

    Parameters

    • window: mozIDOMWindow

      A window object with which the document fragment will be created.

    • cue: nsISupports

      The cue whose content will be converted to a document fragment.

    Returns DocumentFragment

  • Flush indicates that no more data is expected from the stream. As such the parser should try to parse any kind of partial data it has.

    Returns void

  • Loads the JS WebVTTParser and sets it to use the passed window to create VTTRegions and VTTCues. This function must be called before calling parse, flush, or watch.

    Parameters

    • window: mozIDOMWindow

      The window that the parser will use to create VTTCues and VTTRegions.

    Returns void

  • Attempts to parse the stream's data as WebVTT format. When it successfully parses a WebVTT region or WebVTT cue it will create a VTTRegion or VTTCue object and pass it back to the callee through its callbacks.

    Parameters

    • data: string

      The buffer that contains the WebVTT data received by the Necko consumer so far.

    Returns void

  • Compute the display state of the VTTCues in cues along with any VTTRegions that they might be in. First, it computes the positioning and styling of the cues and regions passed and converts them into a DOM tree rooted at a containing HTMLDivElement. It then adjusts those computed divs for overlap avoidance using the dimensions of 'overlay'. Finally, it adds the computed divs to the VTTCues display state property for use later.

    Parameters

    • window: mozIDOMWindow

      A window object with which it will create the DOM tree and containing div element.

    • cues: nsIVariant

      An array of VTTCues who need there display state to be computed.

    • overlay: nsISupports

      The HTMLElement that the cues will be displayed within.

    • controls: nsISupports

      The video control element that will affect cues position.

    Returns void

  • Set this parser object to use an nsIWebVTTListener object for its onCue and onRegion callbacks.

    Parameters

    • callback: nsIWebVTTListener

      The nsIWebVTTListener object that exposes onCue and onRegion callbacks for the parser.

    Returns void

Generated using TypeDoc