Table of Contents

Class AndroidMediaPlayer

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

Android implementation of BaseMediaPlayer

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

Constructors

Name Description
AndroidMediaPlayer(OptionsAndroid)

Fields

Name Description
m_Video
m_iPlayerIndex
s_ActivityContext
s_Interface
s_bInitialised

Methods

Name Description
AddMediaToCache(string, string, MediaCachingOptions)

Cache the media specified by url.

ApplyTextureProperties(Texture)
CanPlay()
CancelDownloadOfMediaToCache(string)

Cancels the download of the media specified by url.

CloseMedia()
DeinitPlatform()
Dispose()
GetAffineTransform()

The affine transform of the texture as an array of six floats: [a, b, c, d, tx, ty].

GetAudioBufferedSampleCount()
GetAudioChannelCount()
GetBalance()
GetCachedMediaStatus(string, ref float)

Get the cached status for the media specified.

GetCurrentTime()

Returns the current video time in seconds

GetDuration()

Returns media duration in seconds

GetEstimatedTotalBandwidthUsed()

Gets the estimated bandwidth used by all video players (in bits per second) Currently only supported on Android when using ExoPlayer API

GetExpectedVersion()
GetPlaybackRate()
GetProgramDateTime()

Returns the current video date and time usually from the EXT-X-PROGRAM-DATE-TIME tag on HLS streams Only supported on macOS, iOS, tvOS and Android (using ExoPlayer API) And Windows 10 using WinRT API

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

GetTextureMatrix()

The full 4x4 transform of the texture

GetTextureTimeStamp()

Returns the presentation time stamp of the current texture

GetTextureTransform()

The affine transform of the texture as an array of six floats: a, b, c, d, tx, ty.

GetVersion()
GetVideoDisplayRate()

Returns the current achieved display rate in frames per second

GetVideoFrameRate()

Returns the frame rate of the media.

GetVideoHeight()

Returns video height in pixels

GetVideoWidth()

Returns video width in pixels

GetVolume()
GrabAudio(float[], int, int)

Copies the specified amount of audio into the buffer If the specified amount is not yet available then nothing no samples are copied The number of audio samples grabbed are returned

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()
IsMediaCachingSupported()

Test to see if the player can cache media.

IsMuted()
IsPaused()
IsPlaying()
IsSeeking()
MuteAudio(bool)
OnEnable()
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()
PauseDownloadOfMediaToCache(string)

Pause the download of the media specified by url.

Play()
PlayerSupportsLinearColorSpace()

Whether this MediaPlayer instance supports linear color space If it doesn't then a correction may have to be made in the shader

RemoveMediaFromCache(string)

Remove the cached media specified by url.

Render()
RequiresVerticalFlip()

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

ResetAudioFocus()
ResetAudioHeadRotation()
ResumeDownloadOfMediaToCache(string)

Resume the download of the media specified by url.

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

SetAudioFocusEnabled(bool)
SetAudioFocusProperties(float, float)
SetAudioFocusRotation(Quaternion)
SetAudioHeadRotation(Quaternion)
SetBalance(float)
SetKeyServerAuthToken(string)
SetLooping(bool)
SetOptions(bool, bool)
SetOverrideDecryptionKey(byte[])
SetPlaybackRate(float)
SetVolume(float)
Stop()
Update()
WaitForNextFrame(Camera, int)