JUCE  v5.4.1-191-g0ab5e696f
JUCE API
Looking for a senior C++ dev?
I'm looking for work. Hire me!
VideoComponent::Pimpl::MediaSession::Player Class Reference
Inheritance diagram for VideoComponent::Pimpl::MediaSession::Player:
Collaboration diagram for VideoComponent::Pimpl::MediaSession::Player:

Classes

struct  StateInfo
 

Public Member Functions

 Player (MediaSession &ownerToUse)
 
void closeVideo ()
 
int getAllowedActions () const noexcept
 
float getAudioVolume () const
 
int getPlaybackStateFlag () const noexcept
 
jint getPlayPosition () const
 
double getPlaySpeed () const
 
jlong getVideoDuration () const
 
Rectangle< intgetVideoNativeSize () const
 
bool isPlaying () const
 
bool isVideoOpen () const noexcept
 
void load (const LocalRef< jstring > &mediaId, const LocalRef< jobject > &extras)
 
void pause ()
 
void play ()
 
void setAudioVolume (float newVolume)
 
void setDisplay (const LocalRef< jobject > &surfaceHolder)
 
void setPlayPosition (jint newPositionMs)
 
void setPlaySpeed (double newSpeed)
 

Private Types

enum  {
  MEDIA_INFO_UNKNOWN = 1,
  MEDIA_INFO_VIDEO_RENDERING_START = 3,
  MEDIA_INFO_VIDEO_TRACK_LAGGING = 700,
  MEDIA_INFO_BUFFERING_START = 701,
  MEDIA_INFO_BUFFERING_END = 702,
  MEDIA_INFO_NETWORK_BANDWIDTH = 703,
  MEDIA_INFO_BAD_INTERLEAVING = 800,
  MEDIA_INFO_NOT_SEEKABLE = 801,
  MEDIA_INFO_METADATA_UPDATE = 802,
  MEDIA_INFO_AUDIO_NOT_PLAYING = 804,
  MEDIA_INFO_VIDEO_NOT_PLAYING = 805,
  MEDIA_INFO_UNSUPPORTED_SUBTITE = 901,
  MEDIA_INFO_SUBTITLE_TIMED_OUT = 902
}
 
enum  State {
  State::idle,
  State::initialised,
  State::preparing,
  State::prepared,
  State::started,
  State::paused,
  State::stopped,
  State::complete,
  State::error,
  State::end
}
 

Private Member Functions

StateInfo getCurrentStateInfo () const noexcept
 
void onBufferingUpdate (LocalRef< jobject > &mediaPlayer, int progress) override
 
void onCompletion (LocalRef< jobject > &mediaPlayer) override
 
bool onError (LocalRef< jobject > &mediaPlayer, int what, int extra) override
 
bool onInfo (LocalRef< jobject > &mediaPlayer, int what, int extra) override
 
void onPrepared (LocalRef< jobject > &mediaPlayer) override
 
void onSeekComplete (LocalRef< jobject > &mediaPlayer) override
 

Static Private Member Functions

static String errorCodeToString (int code)
 
static StringArray getNativeMediaPlayerListenerInterfaces ()
 
static String infoCodeToString (int code)
 

Private Attributes

State currentState = State::idle
 
float lastAudioVolume = std::numeric_limits<float>::min()
 
MediaPlayerListener mediaPlayerListener
 
GlobalRef nativeMediaPlayer
 
GlobalRef nativeMediaPlayerListener
 
MediaSessionowner
 
GlobalRef videoSurfaceHolder
 

Static Private Attributes

static constexpr StateInfo stateInfos []
 

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
private
Enumerator
MEDIA_INFO_UNKNOWN 
MEDIA_INFO_VIDEO_RENDERING_START 
MEDIA_INFO_VIDEO_TRACK_LAGGING 
MEDIA_INFO_BUFFERING_START 
MEDIA_INFO_BUFFERING_END 
MEDIA_INFO_NETWORK_BANDWIDTH 
MEDIA_INFO_BAD_INTERLEAVING 
MEDIA_INFO_NOT_SEEKABLE 
MEDIA_INFO_METADATA_UPDATE 
MEDIA_INFO_AUDIO_NOT_PLAYING 
MEDIA_INFO_VIDEO_NOT_PLAYING 
MEDIA_INFO_UNSUPPORTED_SUBTITE 
MEDIA_INFO_SUBTITLE_TIMED_OUT 

◆ State

Enumerator
idle 
initialised 
preparing 
prepared 
started 
paused 
stopped 
complete 
error 
end 

Constructor & Destructor Documentation

◆ Player()

VideoComponent::Pimpl::MediaSession::Player::Player ( MediaSession ownerToUse)
inline

Member Function Documentation

◆ closeVideo()

void VideoComponent::Pimpl::MediaSession::Player::closeVideo ( )
inline

References juce::getEnv().

◆ errorCodeToString()

static String VideoComponent::Pimpl::MediaSession::Player::errorCodeToString ( int  code)
inlinestaticprivate

◆ getAllowedActions()

int VideoComponent::Pimpl::MediaSession::Player::getAllowedActions ( ) const
inlinenoexcept

◆ getAudioVolume()

float VideoComponent::Pimpl::MediaSession::Player::getAudioVolume ( ) const
inline

◆ getCurrentStateInfo()

StateInfo VideoComponent::Pimpl::MediaSession::Player::getCurrentStateInfo ( ) const
inlineprivatenoexcept

◆ getNativeMediaPlayerListenerInterfaces()

static StringArray VideoComponent::Pimpl::MediaSession::Player::getNativeMediaPlayerListenerInterfaces ( )
inlinestaticprivate

References IFPREFIX.

◆ getPlaybackStateFlag()

int VideoComponent::Pimpl::MediaSession::Player::getPlaybackStateFlag ( ) const
inlinenoexcept

◆ getPlayPosition()

◆ getPlaySpeed()

double VideoComponent::Pimpl::MediaSession::Player::getPlaySpeed ( ) const
inline

◆ getVideoDuration()

jlong VideoComponent::Pimpl::MediaSession::Player::getVideoDuration ( ) const
inline

◆ getVideoNativeSize()

Rectangle<int> VideoComponent::Pimpl::MediaSession::Player::getVideoNativeSize ( ) const
inline

References juce::getEnv(), int(), and jassertfalse.

◆ infoCodeToString()

static String VideoComponent::Pimpl::MediaSession::Player::infoCodeToString ( int  code)
inlinestaticprivate

◆ isPlaying()

bool VideoComponent::Pimpl::MediaSession::Player::isPlaying ( ) const
inline

◆ isVideoOpen()

bool VideoComponent::Pimpl::MediaSession::Player::isVideoOpen ( ) const
inlinenoexcept

◆ load()

void VideoComponent::Pimpl::MediaSession::Player::load ( const LocalRef< jstring > &  mediaId,
const LocalRef< jobject > &  extras 
)
inline

◆ onBufferingUpdate()

void VideoComponent::Pimpl::MediaSession::Player::onBufferingUpdate ( LocalRef< jobject > &  mediaPlayer,
int  progress 
)
inlineoverrideprivatevirtual

◆ onCompletion()

void VideoComponent::Pimpl::MediaSession::Player::onCompletion ( LocalRef< jobject > &  mediaPlayer)
inlineoverrideprivatevirtual

◆ onError()

bool VideoComponent::Pimpl::MediaSession::Player::onError ( LocalRef< jobject > &  mediaPlayer,
int  what,
int  extra 
)
inlineoverrideprivatevirtual

◆ onInfo()

bool VideoComponent::Pimpl::MediaSession::Player::onInfo ( LocalRef< jobject > &  mediaPlayer,
int  what,
int  extra 
)
inlineoverrideprivatevirtual

◆ onPrepared()

void VideoComponent::Pimpl::MediaSession::Player::onPrepared ( LocalRef< jobject > &  mediaPlayer)
inlineoverrideprivatevirtual

◆ onSeekComplete()

void VideoComponent::Pimpl::MediaSession::Player::onSeekComplete ( LocalRef< jobject > &  mediaPlayer)
inlineoverrideprivatevirtual

◆ pause()

void VideoComponent::Pimpl::MediaSession::Player::pause ( )
inline

◆ play()

void VideoComponent::Pimpl::MediaSession::Player::play ( )
inline

References juce::getEnv(), and jassertfalse.

◆ setAudioVolume()

void VideoComponent::Pimpl::MediaSession::Player::setAudioVolume ( float  newVolume)
inline

◆ setDisplay()

void VideoComponent::Pimpl::MediaSession::Player::setDisplay ( const LocalRef< jobject > &  surfaceHolder)
inline

References juce::getEnv().

◆ setPlayPosition()

void VideoComponent::Pimpl::MediaSession::Player::setPlayPosition ( jint  newPositionMs)
inline

◆ setPlaySpeed()

void VideoComponent::Pimpl::MediaSession::Player::setPlaySpeed ( double  newSpeed)
inline

Member Data Documentation

◆ currentState

State VideoComponent::Pimpl::MediaSession::Player::currentState = State::idle
private

◆ lastAudioVolume

float VideoComponent::Pimpl::MediaSession::Player::lastAudioVolume = std::numeric_limits<float>::min()
private

◆ mediaPlayerListener

MediaPlayerListener VideoComponent::Pimpl::MediaSession::Player::mediaPlayerListener
private

◆ nativeMediaPlayer

GlobalRef VideoComponent::Pimpl::MediaSession::Player::nativeMediaPlayer
private

◆ nativeMediaPlayerListener

GlobalRef VideoComponent::Pimpl::MediaSession::Player::nativeMediaPlayerListener
private

◆ owner

MediaSession& VideoComponent::Pimpl::MediaSession::Player::owner
private

◆ stateInfos

constexpr VideoComponent::Pimpl::MediaSession::Player::StateInfo VideoComponent::Pimpl::MediaSession::Player::stateInfos
staticprivate

◆ videoSurfaceHolder

GlobalRef VideoComponent::Pimpl::MediaSession::Player::videoSurfaceHolder
private

The documentation for this class was generated from the following file: