Class NullMediaPlayer
This media player fakes video playback for platforms that aren't supported
Inheritance
System.Object
NullMediaPlayer
Implements
System.IDisposable
Assembly: cs.temp.dll.dll
public sealed class NullMediaPlayer : BaseMediaPlayer, IMediaPlayer, IMediaControl, IMediaInfo, IMediaCache, ITextureProducer, IMediaSubtitles, IVideoTracks, IAudioTracks, ITextTracks, IBufferedDisplay, IDisposable
Methods
Declaration
public override bool CanPlay()
Returns
Type |
Description |
System.Boolean |
|
Overrides
Declaration
public override void CloseMedia()
Overrides
Declaration
public override void Dispose()
Overrides
Returns the current video time in seconds
Declaration
public override double GetCurrentTime()
Returns
Type |
Description |
System.Double |
|
Overrides
Returns media duration in seconds
Declaration
public override double GetDuration()
Returns
Type |
Description |
System.Double |
|
Overrides
Declaration
public override string GetExpectedVersion()
Returns
Type |
Description |
System.String |
|
Overrides
Declaration
public override float GetPlaybackRate()
Returns
Type |
Description |
System.Single |
|
Overrides
GetTexture(Int32)
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.
Declaration
public override Texture GetTexture(int index)
Parameters
Type |
Name |
Description |
System.Int32 |
index |
|
Returns
Overrides
GetTextureFrameCount()
Returns a count of how many times the texture has been updated
Declaration
public override int GetTextureFrameCount()
Returns
Type |
Description |
System.Int32 |
|
Overrides
Declaration
public override string GetVersion()
Returns
Type |
Description |
System.String |
|
Overrides
Returns the current achieved display rate in frames per second
Declaration
public override float GetVideoDisplayRate()
Returns
Type |
Description |
System.Single |
|
Overrides
Returns the frame rate of the media.
Declaration
public override float GetVideoFrameRate()
Returns
Type |
Description |
System.Single |
|
Overrides
Returns video height in pixels
Declaration
public override int GetVideoHeight()
Returns
Type |
Description |
System.Int32 |
|
Overrides
Returns video width in pixels
Declaration
public override int GetVideoWidth()
Returns
Type |
Description |
System.Int32 |
|
Overrides
Declaration
public override float GetVolume()
Returns
Type |
Description |
System.Single |
|
Overrides
Returns true if the media has a audio track
Declaration
public override bool HasAudio()
Returns
Type |
Description |
System.Boolean |
|
Overrides
Declaration
public override bool HasMetaData()
Returns
Type |
Description |
System.Boolean |
|
Overrides
Returns true if the media has a visual track
Declaration
public override bool HasVideo()
Returns
Type |
Description |
System.Boolean |
|
Overrides
Declaration
public override bool IsBuffering()
Returns
Type |
Description |
System.Boolean |
|
Overrides
Declaration
public override bool IsFinished()
Returns
Type |
Description |
System.Boolean |
|
Overrides
Declaration
public override bool IsLooping()
Returns
Type |
Description |
System.Boolean |
|
Overrides
Declaration
public override bool IsMuted()
Returns
Type |
Description |
System.Boolean |
|
Overrides
Declaration
public override bool IsPaused()
Returns
Type |
Description |
System.Boolean |
|
Overrides
Declaration
public override bool IsPlaying()
Returns
Type |
Description |
System.Boolean |
|
Overrides
Declaration
public override bool IsSeeking()
Returns
Type |
Description |
System.Boolean |
|
Overrides
Declaration
public override void MuteAudio(bool bMuted)
Parameters
Type |
Name |
Description |
System.Boolean |
bMuted |
|
Overrides
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"=
Declaration
public override bool OpenMedia(string path, long offset, string httpHeader, MediaHints mediaHints, int forceFileFormat = 0, bool startWithHighestBitrate = false)
Parameters
Type |
Name |
Description |
System.String |
path |
|
System.Int64 |
offset |
|
System.String |
httpHeader |
|
MediaHints |
mediaHints |
|
System.Int32 |
forceFileFormat |
|
System.Boolean |
startWithHighestBitrate |
|
Returns
Type |
Description |
System.Boolean |
|
Overrides
Declaration
public override void Pause()
Overrides
Declaration
public override void Play()
Overrides
Declaration
public override void Render()
Overrides
Returns true if the image on the texture is upside-down
Declaration
public override bool RequiresVerticalFlip()
Returns
Type |
Description |
System.Boolean |
|
Overrides
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
Declaration
public override void Seek(double time)
Parameters
Type |
Name |
Description |
System.Double |
time |
|
Overrides
The time in seconds seeked will be to the closest keyframe
Declaration
public override void SeekFast(double time)
Parameters
Type |
Name |
Description |
System.Double |
time |
|
Overrides
Declaration
public override void SetLooping(bool bLooping)
Parameters
Type |
Name |
Description |
System.Boolean |
bLooping |
|
Overrides
Declaration
public override void SetPlaybackRate(float rate)
Parameters
Type |
Name |
Description |
System.Single |
rate |
|
Overrides
Declaration
public override void SetVolume(float volume)
Parameters
Type |
Name |
Description |
System.Single |
volume |
|
Overrides
Declaration
public override void Stop()
Overrides
Declaration
public override void Update()
Overrides
Implements
System.IDisposable