Table of Contents

Class WebGLMediaPlayer

Namespace
RenderHeads.Media.AVProVideo
Assembly
AVProVideo.Runtime.dll

WebGL implementation of BaseMediaPlayer

public sealed class WebGLMediaPlayer : BaseMediaPlayer, IVideoTracks, IAudioTracks, ITextTracks, IMediaPlayer, IMediaControl, IMediaInfo, IMediaCache, ITextureProducer, IMediaSubtitles, IBufferedDisplay
Inheritance
object
WebGLMediaPlayer
Implements
Inherited Members

Constructors

Name Description
WebGLMediaPlayer(OptionsWebGL)

Methods

Name Description
CanPlay()
CloseMedia()
Dispose()
GetCurrentTime()

Returns the current video time in seconds

GetDuration()

Returns media duration in seconds

GetExpectedVersion()
GetPlaybackRate()
GetTexture(int)

Returns the Unity texture containing the current frame image. The texture pointer will return null while the video is loading This texture usually remains the same for the duration of the video. There are cases when this texture can change, for instance: if the graphics device is recreated, a new video is loaded, or if an adaptive stream (eg HLS) is used and it switches video streams.

GetTextureFrameCount()

Returns a count of how many times the texture has been updated

GetVersion()
GetVideoFrameRate()

Returns the frame rate of the media.

GetVideoHeight()

Returns video height in pixels

GetVideoWidth()

Returns video width in pixels

GetVolume()
HasAudio()

Returns true if the media has a audio track

HasMetaData()
HasVideo()

Returns true if the media has a visual track

InitialisePlatform()
IsBuffering()
IsFinished()
IsLooping()
IsMuted()
IsPaused()
IsPlaybackStalled()

Checks if the playback is in a stalled state

IsPlaying()
IsSeeking()
MuteAudio(bool)
OpenMedia(string, long, string, MediaHints, int, bool)

Be careful using this method directly. It is best to instead use the OpenMedia() method in the MediaPlayer component as this will set up the events correctly and also perform other checks customHttpHeaders is in the format "key1:value1\r\nkey2:value2\r\n"=

Pause()
Play()
Render()
RequiresVerticalFlip()

Returns true if the image on the texture is upside-down

Seek(double)

The time in seconds seeked will be to the exact time This can take a long time is the keyframes are far apart Some platforms don't support this and instead seek to the closest keyframe

SeekFast(double)

The time in seconds seeked will be to the closest keyframe

SetLooping(bool)
SetOptions(OptionsWebGL)
SetPlaybackRate(float)
SetVolume(float)
Stop()
SupportsTextureFrameCount()

Returns whether this platform supports counting the number of times the texture has been updated

Update()