\hypertarget{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_observer}{}\doxysection{io.\+agora.\+mediaplayer.\+I\+Media\+Player\+Observer Interface Reference}
\label{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_observer}\index{io.agora.mediaplayer.IMediaPlayerObserver@{io.agora.mediaplayer.IMediaPlayerObserver}}
\doxysubsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
void \mbox{\hyperlink{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_observer_a572fe1760046b9dd299bd28c73f40928}{on\+Player\+State\+Changed}} (Constants.\+Media\+Player\+State state, Constants.\+Media\+Player\+Reason reason)
\begin{DoxyCompactList}\small\item\em Reports the changes of playback state. \end{DoxyCompactList}\item 
void \mbox{\hyperlink{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_observer_acb4c4b8738411ebd959755369baabf8f}{on\+Position\+Changed}} (long position\+Ms, long timestamp\+Ms)
\begin{DoxyCompactList}\small\item\em Reports the playback progress of the media file. \end{DoxyCompactList}\item 
void \mbox{\hyperlink{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_observer_a308c779d14be1516d0f135b615d0a6c0}{on\+Player\+Event}} (Constants.\+Media\+Player\+Event event\+Code, long elapsed\+Time, String message)
\begin{DoxyCompactList}\small\item\em Reports the player events. \end{DoxyCompactList}\item 
void \mbox{\hyperlink{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_observer_ac23df946c337f3b1585977996146eba5}{on\+Meta\+Data}} (Constants.\+Media\+Player\+Metadata\+Type type, byte\mbox{[}$\,$\mbox{]} data)
\begin{DoxyCompactList}\small\item\em Occurs when the media metadata is received. \end{DoxyCompactList}\item 
void \mbox{\hyperlink{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_observer_af9e4f6341c8c81c87ea1199a6cfecc15}{on\+Play\+Buffer\+Updated}} (long play\+Cached\+Buffer)
\begin{DoxyCompactList}\small\item\em Reports the playback duration that the buffered data can support. \end{DoxyCompactList}\item 
void \mbox{\hyperlink{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_observer_a3756c2515c9a5be0b32b96248d3a32d2}{on\+Preload\+Event}} (String src, Constants.\+Media\+Player\+Preload\+Event event)
\begin{DoxyCompactList}\small\item\em Reports the events of preloaded media resources. \end{DoxyCompactList}\item 
void \mbox{\hyperlink{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_observer_a0da5fafac9bef28071e97a27a4905d10}{on\+Agora\+C\+D\+N\+Token\+Will\+Expire}} ()
\begin{DoxyCompactList}\small\item\em Agora\+C\+DN Token has expired and needs to be set up with renew\+Agora\+C\+D\+N\+Src\+Token. \end{DoxyCompactList}\item 
void \mbox{\hyperlink{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_observer_a32c17b1de5ff92fbacb03aa500e3c13b}{on\+Player\+Src\+Info\+Changed}} (\mbox{\hyperlink{classio_1_1agora_1_1mediaplayer_1_1data_1_1_src_info}{Src\+Info}} from, \mbox{\hyperlink{classio_1_1agora_1_1mediaplayer_1_1data_1_1_src_info}{Src\+Info}} to)
\begin{DoxyCompactList}\small\item\em Occurs when the video bitrate of the media resource changes. \end{DoxyCompactList}\item 
void \mbox{\hyperlink{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_observer_a13240f2c9eab25361c5733fb5a5b9c93}{on\+Player\+Info\+Updated}} (\mbox{\hyperlink{classio_1_1agora_1_1mediaplayer_1_1data_1_1_player_updated_info}{Player\+Updated\+Info}} info)
\begin{DoxyCompactList}\small\item\em Occurs when information related to the media player changes. \end{DoxyCompactList}\item 
void \mbox{\hyperlink{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_observer_a06bea4d261f3ed7c13291de72ba4609c}{on\+Player\+Cache\+Stats}} (\mbox{\hyperlink{classio_1_1agora_1_1mediaplayer_1_1data_1_1_cache_statistics}{Cache\+Statistics}} stats)
\begin{DoxyCompactList}\small\item\em Reports the statistics of the media file being cached. \end{DoxyCompactList}\item 
void \mbox{\hyperlink{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_observer_af62255e22e951a10af34fead414e0a34}{on\+Player\+Playback\+Stats}} (\mbox{\hyperlink{classio_1_1agora_1_1mediaplayer_1_1data_1_1_player_playback_stats}{Player\+Playback\+Stats}} stats)
\begin{DoxyCompactList}\small\item\em Reports the statistics of the media file being played. \end{DoxyCompactList}\item 
void \mbox{\hyperlink{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_observer_a71038b35b1b11f43330cdc869caaff5e}{on\+Audio\+Volume\+Indication}} (int volume)
\begin{DoxyCompactList}\small\item\em Reports the volume of the media player. \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsection{Member Function Documentation}
\mbox{\Hypertarget{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_observer_a572fe1760046b9dd299bd28c73f40928}\label{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_observer_a572fe1760046b9dd299bd28c73f40928}} 
\index{io.agora.mediaplayer.IMediaPlayerObserver@{io.agora.mediaplayer.IMediaPlayerObserver}!onPlayerStateChanged@{onPlayerStateChanged}}
\index{onPlayerStateChanged@{onPlayerStateChanged}!io.agora.mediaplayer.IMediaPlayerObserver@{io.agora.mediaplayer.IMediaPlayerObserver}}
\doxysubsubsection{\texorpdfstring{onPlayerStateChanged()}{onPlayerStateChanged()}}
{\footnotesize\ttfamily void io.\+agora.\+mediaplayer.\+I\+Media\+Player\+Observer.\+on\+Player\+State\+Changed (\begin{DoxyParamCaption}\item[{Constants.\+Media\+Player\+State}]{state,  }\item[{Constants.\+Media\+Player\+Reason}]{reason }\end{DoxyParamCaption})}



Reports the changes of playback state. 

When the state of the media player changes, the S\+DK triggers this callback to report the current playback state.


\begin{DoxyParams}{Parameters}
{\em state} & The playback state. See {\ttfamily Media\+Player\+State}. \\
\hline
{\em reason} & The reason for the changes in the media player status. See {\ttfamily Media\+Player\+Reason}. \\
\hline
\end{DoxyParams}
\mbox{\Hypertarget{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_observer_acb4c4b8738411ebd959755369baabf8f}\label{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_observer_acb4c4b8738411ebd959755369baabf8f}} 
\index{io.agora.mediaplayer.IMediaPlayerObserver@{io.agora.mediaplayer.IMediaPlayerObserver}!onPositionChanged@{onPositionChanged}}
\index{onPositionChanged@{onPositionChanged}!io.agora.mediaplayer.IMediaPlayerObserver@{io.agora.mediaplayer.IMediaPlayerObserver}}
\doxysubsubsection{\texorpdfstring{onPositionChanged()}{onPositionChanged()}}
{\footnotesize\ttfamily void io.\+agora.\+mediaplayer.\+I\+Media\+Player\+Observer.\+on\+Position\+Changed (\begin{DoxyParamCaption}\item[{long}]{position\+Ms,  }\item[{long}]{timestamp\+Ms }\end{DoxyParamCaption})}



Reports the playback progress of the media file. 

When playing media files, the S\+DK triggers this callback every two second to report current playback progress.


\begin{DoxyParams}{Parameters}
{\em position\+Ms} & The playback position (ms) of media files. \\
\hline
{\em time\+Stamp\+Ms} & The N\+TP timestamp (ms) of the current playback progress. \\
\hline
\end{DoxyParams}
\mbox{\Hypertarget{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_observer_a308c779d14be1516d0f135b615d0a6c0}\label{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_observer_a308c779d14be1516d0f135b615d0a6c0}} 
\index{io.agora.mediaplayer.IMediaPlayerObserver@{io.agora.mediaplayer.IMediaPlayerObserver}!onPlayerEvent@{onPlayerEvent}}
\index{onPlayerEvent@{onPlayerEvent}!io.agora.mediaplayer.IMediaPlayerObserver@{io.agora.mediaplayer.IMediaPlayerObserver}}
\doxysubsubsection{\texorpdfstring{onPlayerEvent()}{onPlayerEvent()}}
{\footnotesize\ttfamily void io.\+agora.\+mediaplayer.\+I\+Media\+Player\+Observer.\+on\+Player\+Event (\begin{DoxyParamCaption}\item[{Constants.\+Media\+Player\+Event}]{event\+Code,  }\item[{long}]{elapsed\+Time,  }\item[{String}]{message }\end{DoxyParamCaption})}



Reports the player events. 


\begin{DoxyItemize}
\item After calling the {\ttfamily seek} method, the S\+DK triggers the callback to report the results of the seek operation.
\end{DoxyItemize}


\begin{DoxyParams}{Parameters}
{\em event\+Code} & The player event. See {\ttfamily Media\+Player\+Event}. \\
\hline
{\em elapsed\+Time} & The time (ms) when the event occurs. \\
\hline
{\em message} & Information about the event. \\
\hline
\end{DoxyParams}
\mbox{\Hypertarget{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_observer_ac23df946c337f3b1585977996146eba5}\label{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_observer_ac23df946c337f3b1585977996146eba5}} 
\index{io.agora.mediaplayer.IMediaPlayerObserver@{io.agora.mediaplayer.IMediaPlayerObserver}!onMetaData@{onMetaData}}
\index{onMetaData@{onMetaData}!io.agora.mediaplayer.IMediaPlayerObserver@{io.agora.mediaplayer.IMediaPlayerObserver}}
\doxysubsubsection{\texorpdfstring{onMetaData()}{onMetaData()}}
{\footnotesize\ttfamily void io.\+agora.\+mediaplayer.\+I\+Media\+Player\+Observer.\+on\+Meta\+Data (\begin{DoxyParamCaption}\item[{Constants.\+Media\+Player\+Metadata\+Type}]{type,  }\item[{byte\mbox{[}$\,$\mbox{]}}]{data }\end{DoxyParamCaption})}



Occurs when the media metadata is received. 

The callback occurs when the player receives the media metadata and reports the detailed information of the media metadata.


\begin{DoxyParams}{Parameters}
{\em type} & The type of media metadata. See {\ttfamily Media\+Player\+Metadata\+Type}. \\
\hline
{\em data} & The detailed data of the media metadata. \\
\hline
\end{DoxyParams}
\mbox{\Hypertarget{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_observer_af9e4f6341c8c81c87ea1199a6cfecc15}\label{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_observer_af9e4f6341c8c81c87ea1199a6cfecc15}} 
\index{io.agora.mediaplayer.IMediaPlayerObserver@{io.agora.mediaplayer.IMediaPlayerObserver}!onPlayBufferUpdated@{onPlayBufferUpdated}}
\index{onPlayBufferUpdated@{onPlayBufferUpdated}!io.agora.mediaplayer.IMediaPlayerObserver@{io.agora.mediaplayer.IMediaPlayerObserver}}
\doxysubsubsection{\texorpdfstring{onPlayBufferUpdated()}{onPlayBufferUpdated()}}
{\footnotesize\ttfamily void io.\+agora.\+mediaplayer.\+I\+Media\+Player\+Observer.\+on\+Play\+Buffer\+Updated (\begin{DoxyParamCaption}\item[{long}]{play\+Cached\+Buffer }\end{DoxyParamCaption})}



Reports the playback duration that the buffered data can support. 

When playing online media resources, the S\+DK triggers this callback every two seconds to report the playback duration that the currently buffered data can support.
\begin{DoxyItemize}
\item When the playback duration supported by the buffered data is less than the threshold (0 by default), the S\+DK returns {\ttfamily P\+L\+A\+Y\+E\+R\+\_\+\+E\+V\+E\+N\+T\+\_\+\+B\+U\+F\+F\+E\+R\+\_\+\+L\+OW} (6).
\item When the playback duration supported by the buffered data is greater than the threshold (0 by default), the S\+DK returns {\ttfamily P\+L\+A\+Y\+E\+R\+\_\+\+E\+V\+E\+N\+T\+\_\+\+B\+U\+F\+F\+E\+R\+\_\+\+R\+E\+C\+O\+V\+ER} (7).
\end{DoxyItemize}


\begin{DoxyParams}{Parameters}
{\em play\+Cached\+Buffer} & The playback duration (ms) that the buffered data can support. \\
\hline
\end{DoxyParams}
\mbox{\Hypertarget{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_observer_a3756c2515c9a5be0b32b96248d3a32d2}\label{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_observer_a3756c2515c9a5be0b32b96248d3a32d2}} 
\index{io.agora.mediaplayer.IMediaPlayerObserver@{io.agora.mediaplayer.IMediaPlayerObserver}!onPreloadEvent@{onPreloadEvent}}
\index{onPreloadEvent@{onPreloadEvent}!io.agora.mediaplayer.IMediaPlayerObserver@{io.agora.mediaplayer.IMediaPlayerObserver}}
\doxysubsubsection{\texorpdfstring{onPreloadEvent()}{onPreloadEvent()}}
{\footnotesize\ttfamily void io.\+agora.\+mediaplayer.\+I\+Media\+Player\+Observer.\+on\+Preload\+Event (\begin{DoxyParamCaption}\item[{String}]{src,  }\item[{Constants.\+Media\+Player\+Preload\+Event}]{event }\end{DoxyParamCaption})}



Reports the events of preloaded media resources. 


\begin{DoxyParams}{Parameters}
{\em src} & The U\+RL of the media resource. \\
\hline
{\em event} & Events that occur when media resources are preloaded. See {\ttfamily Media\+Player\+Preload\+Event}. \\
\hline
\end{DoxyParams}
\mbox{\Hypertarget{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_observer_a0da5fafac9bef28071e97a27a4905d10}\label{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_observer_a0da5fafac9bef28071e97a27a4905d10}} 
\index{io.agora.mediaplayer.IMediaPlayerObserver@{io.agora.mediaplayer.IMediaPlayerObserver}!onAgoraCDNTokenWillExpire@{onAgoraCDNTokenWillExpire}}
\index{onAgoraCDNTokenWillExpire@{onAgoraCDNTokenWillExpire}!io.agora.mediaplayer.IMediaPlayerObserver@{io.agora.mediaplayer.IMediaPlayerObserver}}
\doxysubsubsection{\texorpdfstring{onAgoraCDNTokenWillExpire()}{onAgoraCDNTokenWillExpire()}}
{\footnotesize\ttfamily void io.\+agora.\+mediaplayer.\+I\+Media\+Player\+Observer.\+on\+Agora\+C\+D\+N\+Token\+Will\+Expire (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Agora\+C\+DN Token has expired and needs to be set up with renew\+Agora\+C\+D\+N\+Src\+Token. 

\begin{DoxyRefDesc}{Deprecated}
\item[\mbox{\hyperlink{deprecated__deprecated000008}{Deprecated}}]4.\+6.\+0 \end{DoxyRefDesc}
\mbox{\Hypertarget{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_observer_a32c17b1de5ff92fbacb03aa500e3c13b}\label{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_observer_a32c17b1de5ff92fbacb03aa500e3c13b}} 
\index{io.agora.mediaplayer.IMediaPlayerObserver@{io.agora.mediaplayer.IMediaPlayerObserver}!onPlayerSrcInfoChanged@{onPlayerSrcInfoChanged}}
\index{onPlayerSrcInfoChanged@{onPlayerSrcInfoChanged}!io.agora.mediaplayer.IMediaPlayerObserver@{io.agora.mediaplayer.IMediaPlayerObserver}}
\doxysubsubsection{\texorpdfstring{onPlayerSrcInfoChanged()}{onPlayerSrcInfoChanged()}}
{\footnotesize\ttfamily void io.\+agora.\+mediaplayer.\+I\+Media\+Player\+Observer.\+on\+Player\+Src\+Info\+Changed (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{classio_1_1agora_1_1mediaplayer_1_1data_1_1_src_info}{Src\+Info}}}]{from,  }\item[{\mbox{\hyperlink{classio_1_1agora_1_1mediaplayer_1_1data_1_1_src_info}{Src\+Info}}}]{to }\end{DoxyParamCaption})}



Occurs when the video bitrate of the media resource changes. 


\begin{DoxyParams}{Parameters}
{\em from} & Information about the video bitrate of the media resource being played. See {\ttfamily Src\+Info}. \\
\hline
{\em to} & Information about the changed video bitrate of media resource being played. See {\ttfamily Src\+Info}. \\
\hline
\end{DoxyParams}
\mbox{\Hypertarget{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_observer_a13240f2c9eab25361c5733fb5a5b9c93}\label{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_observer_a13240f2c9eab25361c5733fb5a5b9c93}} 
\index{io.agora.mediaplayer.IMediaPlayerObserver@{io.agora.mediaplayer.IMediaPlayerObserver}!onPlayerInfoUpdated@{onPlayerInfoUpdated}}
\index{onPlayerInfoUpdated@{onPlayerInfoUpdated}!io.agora.mediaplayer.IMediaPlayerObserver@{io.agora.mediaplayer.IMediaPlayerObserver}}
\doxysubsubsection{\texorpdfstring{onPlayerInfoUpdated()}{onPlayerInfoUpdated()}}
{\footnotesize\ttfamily void io.\+agora.\+mediaplayer.\+I\+Media\+Player\+Observer.\+on\+Player\+Info\+Updated (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{classio_1_1agora_1_1mediaplayer_1_1data_1_1_player_updated_info}{Player\+Updated\+Info}}}]{info }\end{DoxyParamCaption})}



Occurs when information related to the media player changes. 

When the information about the media player changes, the S\+DK triggers this callback. You can use this callback for troubleshooting.


\begin{DoxyParams}{Parameters}
{\em info} & Information related to the media player. See {\ttfamily Player\+Updated\+Info}. \\
\hline
\end{DoxyParams}
\mbox{\Hypertarget{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_observer_a06bea4d261f3ed7c13291de72ba4609c}\label{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_observer_a06bea4d261f3ed7c13291de72ba4609c}} 
\index{io.agora.mediaplayer.IMediaPlayerObserver@{io.agora.mediaplayer.IMediaPlayerObserver}!onPlayerCacheStats@{onPlayerCacheStats}}
\index{onPlayerCacheStats@{onPlayerCacheStats}!io.agora.mediaplayer.IMediaPlayerObserver@{io.agora.mediaplayer.IMediaPlayerObserver}}
\doxysubsubsection{\texorpdfstring{onPlayerCacheStats()}{onPlayerCacheStats()}}
{\footnotesize\ttfamily void io.\+agora.\+mediaplayer.\+I\+Media\+Player\+Observer.\+on\+Player\+Cache\+Stats (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{classio_1_1agora_1_1mediaplayer_1_1data_1_1_cache_statistics}{Cache\+Statistics}}}]{stats }\end{DoxyParamCaption})}



Reports the statistics of the media file being cached. 

After you call the {\ttfamily open\+With\+Media\+Source} method and set {\ttfamily enable\+Cache} as {\ttfamily true}, the S\+DK triggers this callback once per second to report the statistics of the media file being cached.


\begin{DoxyParams}{Parameters}
{\em stats} & The statistics of the media file being cached. See {\ttfamily Cache\+Statistics}. \\
\hline
\end{DoxyParams}
\mbox{\Hypertarget{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_observer_af62255e22e951a10af34fead414e0a34}\label{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_observer_af62255e22e951a10af34fead414e0a34}} 
\index{io.agora.mediaplayer.IMediaPlayerObserver@{io.agora.mediaplayer.IMediaPlayerObserver}!onPlayerPlaybackStats@{onPlayerPlaybackStats}}
\index{onPlayerPlaybackStats@{onPlayerPlaybackStats}!io.agora.mediaplayer.IMediaPlayerObserver@{io.agora.mediaplayer.IMediaPlayerObserver}}
\doxysubsubsection{\texorpdfstring{onPlayerPlaybackStats()}{onPlayerPlaybackStats()}}
{\footnotesize\ttfamily void io.\+agora.\+mediaplayer.\+I\+Media\+Player\+Observer.\+on\+Player\+Playback\+Stats (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{classio_1_1agora_1_1mediaplayer_1_1data_1_1_player_playback_stats}{Player\+Playback\+Stats}}}]{stats }\end{DoxyParamCaption})}



Reports the statistics of the media file being played. 

The S\+DK triggers this callback once per second to report the statistics of the media file being played.


\begin{DoxyParams}{Parameters}
{\em stats} & The statistics of the media file. See {\ttfamily Player\+Playback\+Stats}. \\
\hline
\end{DoxyParams}
\mbox{\Hypertarget{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_observer_a71038b35b1b11f43330cdc869caaff5e}\label{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_observer_a71038b35b1b11f43330cdc869caaff5e}} 
\index{io.agora.mediaplayer.IMediaPlayerObserver@{io.agora.mediaplayer.IMediaPlayerObserver}!onAudioVolumeIndication@{onAudioVolumeIndication}}
\index{onAudioVolumeIndication@{onAudioVolumeIndication}!io.agora.mediaplayer.IMediaPlayerObserver@{io.agora.mediaplayer.IMediaPlayerObserver}}
\doxysubsubsection{\texorpdfstring{onAudioVolumeIndication()}{onAudioVolumeIndication()}}
{\footnotesize\ttfamily void io.\+agora.\+mediaplayer.\+I\+Media\+Player\+Observer.\+on\+Audio\+Volume\+Indication (\begin{DoxyParamCaption}\item[{int}]{volume }\end{DoxyParamCaption})}



Reports the volume of the media player. 

The S\+DK triggers this callback every 200 milliseconds to report the current volume of the media player.


\begin{DoxyParams}{Parameters}
{\em volume} & The volume of the media player. The value ranges from 0 to 255. \\
\hline
\end{DoxyParams}
