Home Identifier Source
public class | source

MediaSource

You can directly use instance of this class. mediaSource

Constructor Summary

Public Constructor
public

constructor(properties: Object, gl: WebGLContext)

Parent class of all MediaSources

Member Summary

Public Members
public
public
public

element: *

public

gl: *

public

height: *

public

id: *

public
public
public
public

src: *

public

start: *

public

texture: *

public

width: *

Method Summary

Public Methods
public
Clean up the MediaSource for detruction.
public
Check if the MediaSource is ready to start playing.
public
Set the MediaSource loading, when it's ready isReady() will return true.
public

onready(mediaSource: *)

public

pause()

Pause the MediaSource if it is playing.
public

play()

Set the MediaSource playing.
public

render(program: *, renderParameters: *, textures: *)

Render the MediaSource to the WebGL context passed into the constructor.
public

seek(seekTime: number)

Seek the MediaSource to an appropriate point for the passed time.

Public Constructors

public constructor(properties: Object, gl: WebGLContext) source

Parent class of all MediaSources

A MediaSource is the manifestation of a mediaSourceReference from a playlist object. It typically contains the original DOM element to be composited along with a number of functions to load, play, pause, seek and render that element to the webgl context.

A MediaSource exists for a period slightly before a MediaSource is to play in order to give it time to preload and is destroyed as soon as the MediaSource has finished playing.

Params:

NameTypeAttributeDescription
properties Object

An object with the following attributes: id, duration, start, and src or element. Where src is the URL of something that can be used to create a DOM element that can be rendered to canvas, or element is a DOM element that can be rendered to a canvas.

gl WebGLContext

a webGl context to render too.

Public Members

public disposeOfElementOnDestroy: boolean source

public duration: * source

public element: * source

public gl: * source

public height: * source

public id: * source

public mediaSourceListeners: * source

public playing: boolean source

public ready: boolean source

public src: * source

public start: * source

public texture: * source

public width: * source

Public Methods

public destroy() source

Clean up the MediaSource for detruction.

public isReady(): boolean source

Check if the MediaSource is ready to start playing.

Return:

boolean

public load(): boolean source

Set the MediaSource loading, when it's ready isReady() will return true.

Return:

boolean

public onready(mediaSource: *) source

Params:

NameTypeAttributeDescription
mediaSource *

public pause() source

Pause the MediaSource if it is playing.

public play() source

Set the MediaSource playing.

public render(program: *, renderParameters: *, textures: *) source

Render the MediaSource to the WebGL context passed into the constructor.

Params:

NameTypeAttributeDescription
program *
renderParameters *
textures *

public seek(seekTime: number) source

Seek the MediaSource to an appropriate point for the passed time.

Params:

NameTypeAttributeDescription
seekTime number

The time to seek too, this is the overall time for the whole playlist.