Class: VideoBaseTexture

VideoBaseTexture

A texture of a [playing] Video.

Video base textures mimic Pixi BaseTexture.from.... method in their creation process.

This can be used in several ways, such as:

var texture = PIXI.VideoBaseTexture.fromUrl('http://mydomain.com/video.mp4');

var texture = PIXI.VideoBaseTexture.fromUrl({ src: 'http://mydomain.com/video.mp4', mime: 'video/mp4' });

var texture = PIXI.VideoBaseTexture.fromUrls(['/video.webm', '/video.mp4']);

var texture = PIXI.VideoBaseTexture.fromUrls([
    { src: '/video.webm', mime: 'video/webm' },
    { src: '/video.mp4', mime: 'video/mp4' }
]);

See the "deus" demo.


new VideoBaseTexture(source [, scaleMode])

Parameters:
Name Type Argument Description
source HTMLVideoElement
scaleMode number <optional>

See PIXI.SCALE_MODES for possible values

Source:

Extends

  • PIXI.BaseTexture

Methods


<static> fromUrl(videoSrc, scaleMode)

Helper function that creates a new BaseTexture based on the given video element.
This BaseTexture can then be used to create a texture

Parameters:
Name Type Description
videoSrc string | object | Array.<string> | Array.<object>

The URL(s) for the video.

Properties
Name Type Argument Description
src string <optional>

One of the source urls for the video

mime string <optional>

The mimetype of the video (e.g. 'video/mp4'). If not specified
the url's extension will be used as the second part of the mime type.

scaleMode number

See PIXI.SCALE_MODES for possible values

Source:
Returns:
Type
PIXI.VideoBaseTexture

<static> fromVideo(video, scaleMode)

Mimic Pixi BaseTexture.from.... method.

Parameters:
Name Type Description
video HTMLVideoElement
scaleMode number

See PIXI.SCALE_MODES for possible values

Source:
Returns:
Type
PIXI.VideoBaseTexture

destroy()

Destroys this texture

Source: