\hypertarget{classio_1_1agora_1_1rte_1_1_player_observer}{}\doxysection{io.\+agora.\+rte.\+Player\+Observer Class Reference}
\label{classio_1_1agora_1_1rte_1_1_player_observer}\index{io.agora.rte.PlayerObserver@{io.agora.rte.PlayerObserver}}
\doxysubsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\mbox{\Hypertarget{classio_1_1agora_1_1rte_1_1_player_observer_a7be80b90ca0489ca04bf8a7dbd7702cd}\label{classio_1_1agora_1_1rte_1_1_player_observer_a7be80b90ca0489ca04bf8a7dbd7702cd}} 
long {\bfseries get\+Native\+Handle} ()
\item 
void \mbox{\hyperlink{classio_1_1agora_1_1rte_1_1_player_observer_a1423840afe85bf1ee3fae7f168fec6d2}{on\+State\+Changed}} (int old\+\_\+state, int new\+\_\+state, \mbox{\hyperlink{classio_1_1agora_1_1rte_1_1_error}{Error}} error)
\item 
void \mbox{\hyperlink{classio_1_1agora_1_1rte_1_1_player_observer_a9a50ad81ad2eb3d292347dd644d8f9bd}{on\+Position\+Changed}} (long curr\+\_\+time, long utc\+\_\+time)
\begin{DoxyCompactList}\small\item\em Reports current playback progress.\+This callback will be triggered when the playback position changed. \end{DoxyCompactList}\item 
void \mbox{\hyperlink{classio_1_1agora_1_1rte_1_1_player_observer_af125fc35e9f3a533ef2bb5d927bd625d}{on\+Resolution\+Changed}} (int width, int height)
\item 
void \mbox{\hyperlink{classio_1_1agora_1_1rte_1_1_player_observer_ad483ea90351634426239ffccdbabe36d}{on\+Event}} (int event)
\item 
void \mbox{\hyperlink{classio_1_1agora_1_1rte_1_1_player_observer_a202ef7582b3895cce659e8c208997a17}{on\+Metadata}} (int type, byte\mbox{[}$\,$\mbox{]} data)
\item 
void \mbox{\hyperlink{classio_1_1agora_1_1rte_1_1_player_observer_af660c74cf1136d2ae309599251270565}{on\+Player\+Info\+Updated}} (\mbox{\hyperlink{classio_1_1agora_1_1rte_1_1_player_info}{Player\+Info}} info)
\item 
void \mbox{\hyperlink{classio_1_1agora_1_1rte_1_1_player_observer_adf3498cf1ae00a83a6b068fc2dbf3671}{on\+Audio\+Volume\+Indication}} (int volume)
\end{DoxyCompactItemize}
\doxysubsection*{Protected Member Functions}
\begin{DoxyCompactItemize}
\item 
\mbox{\Hypertarget{classio_1_1agora_1_1rte_1_1_player_observer_aefc29d5353fd43829999f32ce734d1ac}\label{classio_1_1agora_1_1rte_1_1_player_observer_aefc29d5353fd43829999f32ce734d1ac}} 
void {\bfseries finalize} ()
\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
\mbox{\hyperlink{classio_1_1agora_1_1rte_1_1_player}{Player}} \mbox{\hyperlink{classio_1_1agora_1_1rte_1_1_observer}{Observer}}, an interface for receiving player event callbacks. \begin{DoxySince}{Since}
v4.\+4.\+0 
\end{DoxySince}


\doxysubsection{Member Function Documentation}
\mbox{\Hypertarget{classio_1_1agora_1_1rte_1_1_player_observer_a1423840afe85bf1ee3fae7f168fec6d2}\label{classio_1_1agora_1_1rte_1_1_player_observer_a1423840afe85bf1ee3fae7f168fec6d2}} 
\index{io.agora.rte.PlayerObserver@{io.agora.rte.PlayerObserver}!onStateChanged@{onStateChanged}}
\index{onStateChanged@{onStateChanged}!io.agora.rte.PlayerObserver@{io.agora.rte.PlayerObserver}}
\doxysubsubsection{\texorpdfstring{onStateChanged()}{onStateChanged()}}
{\footnotesize\ttfamily void io.\+agora.\+rte.\+Player\+Observer.\+on\+State\+Changed (\begin{DoxyParamCaption}\item[{int}]{old\+\_\+state,  }\item[{int}]{new\+\_\+state,  }\item[{\mbox{\hyperlink{classio_1_1agora_1_1rte_1_1_error}{Error}}}]{error }\end{DoxyParamCaption})}

\mbox{\hyperlink{classio_1_1agora_1_1rte_1_1_player}{Player}} state callback. This function is called when the player state changes. \begin{DoxySince}{Since}
v4.\+4.\+0 
\end{DoxySince}

\begin{DoxyParams}{Parameters}
{\em old\+\_\+state} & The previous state. \\
\hline
{\em new\+\_\+state} & The new state. \\
\hline
{\em error} & Possible Error\+Code returns. Only when the new\+\_\+state value corresponds to \mbox{\hyperlink{enumio_1_1agora_1_1rte_1_1_constants_1_1_player_state_a87b9a8b7508d7f3dd5c60ef231a01a98}{Constants.\+Player\+State.\+F\+A\+I\+L\+ED}}, you need to check the value of this parameter.
\begin{DoxyItemize}
\item Error\+Code.\+D\+E\+F\+A\+U\+LT. For specific reasons, see Error.\+Message, including the following situations\+:
\begin{DoxyItemize}
\item Failed to connect to the channel.
\end{DoxyItemize}
\item Error\+Code.\+I\+N\+V\+A\+L\+I\+D\+\_\+\+A\+R\+G\+U\+M\+E\+NT.
\begin{DoxyItemize}
\item Invalid appid.
\item Invalid channelid.
\item Invalid uid.
\end{DoxyItemize}
\item Error\+Code.\+A\+U\+T\+H\+E\+N\+T\+I\+C\+A\+T\+I\+O\+N\+\_\+\+F\+A\+I\+L\+ED.
\begin{DoxyItemize}
\item Invalid token.
\item Token expired.
\end{DoxyItemize}
\item Error\+Code.\+S\+T\+R\+E\+A\+M\+\_\+\+N\+O\+T\+\_\+\+F\+O\+U\+ND. After entering the channel, no stream was received from the broadcaster. for more than 10 seconds. 
\end{DoxyItemize}\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
void 
\end{DoxyReturn}
\mbox{\Hypertarget{classio_1_1agora_1_1rte_1_1_player_observer_a9a50ad81ad2eb3d292347dd644d8f9bd}\label{classio_1_1agora_1_1rte_1_1_player_observer_a9a50ad81ad2eb3d292347dd644d8f9bd}} 
\index{io.agora.rte.PlayerObserver@{io.agora.rte.PlayerObserver}!onPositionChanged@{onPositionChanged}}
\index{onPositionChanged@{onPositionChanged}!io.agora.rte.PlayerObserver@{io.agora.rte.PlayerObserver}}
\doxysubsubsection{\texorpdfstring{onPositionChanged()}{onPositionChanged()}}
{\footnotesize\ttfamily void io.\+agora.\+rte.\+Player\+Observer.\+on\+Position\+Changed (\begin{DoxyParamCaption}\item[{long}]{curr\+\_\+time,  }\item[{long}]{utc\+\_\+time }\end{DoxyParamCaption})}



Reports current playback progress.\+This callback will be triggered when the playback position changed. 

\begin{DoxySince}{Since}
v4.\+4.\+0 
\end{DoxySince}

\begin{DoxyParams}{Parameters}
{\em curr\+\_\+time} & Current playback progress (milisecond). \\
\hline
{\em utc\+\_\+time} & Current N\+T\+P(\+Network Time Protocol) time (milisecond). \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
void 
\end{DoxyReturn}
\mbox{\Hypertarget{classio_1_1agora_1_1rte_1_1_player_observer_af125fc35e9f3a533ef2bb5d927bd625d}\label{classio_1_1agora_1_1rte_1_1_player_observer_af125fc35e9f3a533ef2bb5d927bd625d}} 
\index{io.agora.rte.PlayerObserver@{io.agora.rte.PlayerObserver}!onResolutionChanged@{onResolutionChanged}}
\index{onResolutionChanged@{onResolutionChanged}!io.agora.rte.PlayerObserver@{io.agora.rte.PlayerObserver}}
\doxysubsubsection{\texorpdfstring{onResolutionChanged()}{onResolutionChanged()}}
{\footnotesize\ttfamily void io.\+agora.\+rte.\+Player\+Observer.\+on\+Resolution\+Changed (\begin{DoxyParamCaption}\item[{int}]{width,  }\item[{int}]{height }\end{DoxyParamCaption})}

Video resolution change callback. \begin{DoxySince}{Since}
v4.\+4.\+0 
\end{DoxySince}

\begin{DoxyParams}{Parameters}
{\em width} & The width of the video frame. \\
\hline
{\em height} & The height of the video frame. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
void 
\end{DoxyReturn}
\mbox{\Hypertarget{classio_1_1agora_1_1rte_1_1_player_observer_ad483ea90351634426239ffccdbabe36d}\label{classio_1_1agora_1_1rte_1_1_player_observer_ad483ea90351634426239ffccdbabe36d}} 
\index{io.agora.rte.PlayerObserver@{io.agora.rte.PlayerObserver}!onEvent@{onEvent}}
\index{onEvent@{onEvent}!io.agora.rte.PlayerObserver@{io.agora.rte.PlayerObserver}}
\doxysubsubsection{\texorpdfstring{onEvent()}{onEvent()}}
{\footnotesize\ttfamily void io.\+agora.\+rte.\+Player\+Observer.\+on\+Event (\begin{DoxyParamCaption}\item[{int}]{event }\end{DoxyParamCaption})}

Event callback. \begin{DoxySince}{Since}
v4.\+4.\+0 
\end{DoxySince}

\begin{DoxyParams}{Parameters}
{\em event} & The event notified by the callback. Refer to \mbox{\hyperlink{enumio_1_1agora_1_1rte_1_1_constants_1_1_player_event}{Constants.\+Player\+Event}} type. Currently, the following events can be handled accordingly\+:
\begin{DoxyItemize}
\item \mbox{\hyperlink{enumio_1_1agora_1_1rte_1_1_constants_1_1_player_event_a76d847657453be509821e16081b4f12f}{Constants.\+Player\+Event.\+F\+R\+E\+E\+Z\+E\+\_\+\+S\+T\+A\+RT}}\+: Indicates that stuttering has occurred or shows a loading animation.
\item \mbox{\hyperlink{enumio_1_1agora_1_1rte_1_1_constants_1_1_player_event_a7ca55dc72cc9b38cf7d5d4ac438dd6a7}{Constants.\+Player\+Event.\+F\+R\+E\+E\+Z\+E\+\_\+\+S\+T\+OP}}\+: Indicates that stuttering has ended or stops the loading animation.
\item \mbox{\hyperlink{enumio_1_1agora_1_1rte_1_1_constants_1_1_player_event_abad65150e712f1b223ef661f511419fd}{Constants.\+Player\+Event.\+A\+U\+T\+H\+E\+N\+T\+I\+C\+A\+T\+I\+O\+N\+\_\+\+W\+I\+L\+L\+\_\+\+E\+X\+P\+I\+RE}}\+: Regenerate the token, use the new token to construct the rte U\+RL, and call \mbox{\hyperlink{classio_1_1agora_1_1rte_1_1_player_a3362b1868a8849c0e1042be2e55ed594}{Player.\+open\+With\+Url}} to refresh the token.
\item \mbox{\hyperlink{enumio_1_1agora_1_1rte_1_1_constants_1_1_player_event_ae99f0a77cd8f190075119d28836047f3}{Constants.\+Player\+Event.\+A\+B\+R\+\_\+\+F\+A\+L\+L\+B\+A\+C\+K\+\_\+\+T\+O\+\_\+\+A\+U\+D\+I\+O\+\_\+\+O\+N\+L\+Y\+\_\+\+L\+A\+Y\+ER}}\+: Indicates that due to network reasons, it has fallen back to audio-\/only mode.
\item \mbox{\hyperlink{enumio_1_1agora_1_1rte_1_1_constants_1_1_player_event_ab8df29aa06d2163e3378e815b3d0fc61}{Constants.\+Player\+Event.\+A\+B\+R\+\_\+\+R\+E\+C\+O\+V\+E\+R\+\_\+\+F\+R\+O\+M\+\_\+\+A\+U\+D\+I\+O\+\_\+\+O\+N\+L\+Y\+\_\+\+L\+A\+Y\+ER}}\+: Indicates that it has recovered from audio-\/only mode to video mode. 
\end{DoxyItemize}\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
void 
\end{DoxyReturn}
\mbox{\Hypertarget{classio_1_1agora_1_1rte_1_1_player_observer_a202ef7582b3895cce659e8c208997a17}\label{classio_1_1agora_1_1rte_1_1_player_observer_a202ef7582b3895cce659e8c208997a17}} 
\index{io.agora.rte.PlayerObserver@{io.agora.rte.PlayerObserver}!onMetadata@{onMetadata}}
\index{onMetadata@{onMetadata}!io.agora.rte.PlayerObserver@{io.agora.rte.PlayerObserver}}
\doxysubsubsection{\texorpdfstring{onMetadata()}{onMetadata()}}
{\footnotesize\ttfamily void io.\+agora.\+rte.\+Player\+Observer.\+on\+Metadata (\begin{DoxyParamCaption}\item[{int}]{type,  }\item[{byte\mbox{[}$\,$\mbox{]}}]{data }\end{DoxyParamCaption})}

Metadata callback. \begin{DoxySince}{Since}
v4.\+4.\+0 
\end{DoxySince}

\begin{DoxyParams}{Parameters}
{\em type} & The type of metadata. \\
\hline
{\em data} & The metadata buffer. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
void 
\end{DoxyReturn}
\mbox{\Hypertarget{classio_1_1agora_1_1rte_1_1_player_observer_af660c74cf1136d2ae309599251270565}\label{classio_1_1agora_1_1rte_1_1_player_observer_af660c74cf1136d2ae309599251270565}} 
\index{io.agora.rte.PlayerObserver@{io.agora.rte.PlayerObserver}!onPlayerInfoUpdated@{onPlayerInfoUpdated}}
\index{onPlayerInfoUpdated@{onPlayerInfoUpdated}!io.agora.rte.PlayerObserver@{io.agora.rte.PlayerObserver}}
\doxysubsubsection{\texorpdfstring{onPlayerInfoUpdated()}{onPlayerInfoUpdated()}}
{\footnotesize\ttfamily void io.\+agora.\+rte.\+Player\+Observer.\+on\+Player\+Info\+Updated (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{classio_1_1agora_1_1rte_1_1_player_info}{Player\+Info}}}]{info }\end{DoxyParamCaption})}

\mbox{\hyperlink{classio_1_1agora_1_1rte_1_1_player}{Player}} information update callback. This is called when fields in \mbox{\hyperlink{classio_1_1agora_1_1rte_1_1_player_info}{Player\+Info}} are updated. \begin{DoxySince}{Since}
v4.\+4.\+0 
\end{DoxySince}

\begin{DoxyParams}{Parameters}
{\em info} & The current \mbox{\hyperlink{classio_1_1agora_1_1rte_1_1_player_info}{Player\+Info}} information. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
void 
\end{DoxyReturn}
\mbox{\Hypertarget{classio_1_1agora_1_1rte_1_1_player_observer_adf3498cf1ae00a83a6b068fc2dbf3671}\label{classio_1_1agora_1_1rte_1_1_player_observer_adf3498cf1ae00a83a6b068fc2dbf3671}} 
\index{io.agora.rte.PlayerObserver@{io.agora.rte.PlayerObserver}!onAudioVolumeIndication@{onAudioVolumeIndication}}
\index{onAudioVolumeIndication@{onAudioVolumeIndication}!io.agora.rte.PlayerObserver@{io.agora.rte.PlayerObserver}}
\doxysubsubsection{\texorpdfstring{onAudioVolumeIndication()}{onAudioVolumeIndication()}}
{\footnotesize\ttfamily void io.\+agora.\+rte.\+Player\+Observer.\+on\+Audio\+Volume\+Indication (\begin{DoxyParamCaption}\item[{int}]{volume }\end{DoxyParamCaption})}

Broadcaster audio volume update callback. \begin{DoxySince}{Since}
v4.\+4.\+0 
\end{DoxySince}

\begin{DoxyParams}{Parameters}
{\em volume} & The current volume of the player. The value range is \mbox{[}0, 255\mbox{]}. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
void 
\end{DoxyReturn}
