\hypertarget{classio_1_1agora_1_1rte_1_1_player}{}\doxysection{io.\+agora.\+rte.\+Player Class Reference}
\label{classio_1_1agora_1_1rte_1_1_player}\index{io.agora.rte.Player@{io.agora.rte.Player}}
\doxysubsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\mbox{\hyperlink{classio_1_1agora_1_1rte_1_1_player_a917e1b32d3e65e3f9785a5b3d2075490}{Player}} (\mbox{\hyperlink{classio_1_1agora_1_1rte_1_1_rte}{Rte}} rte, \mbox{\hyperlink{classio_1_1agora_1_1rte_1_1_player_initial_config}{Player\+Initial\+Config}} initial\+Config)
\begin{DoxyCompactList}\small\item\em Constructs a player object. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{classio_1_1agora_1_1rte_1_1_player_a88280ab24ee7a046e5dd98eb0862c142}\label{classio_1_1agora_1_1rte_1_1_player_a88280ab24ee7a046e5dd98eb0862c142}} 
long {\bfseries get\+Native\+Handle} ()
\item 
void \mbox{\hyperlink{classio_1_1agora_1_1rte_1_1_player_a3362b1868a8849c0e1042be2e55ed594}{open\+With\+Url}} (String url, long start\+Time, \mbox{\hyperlink{interfaceio_1_1agora_1_1rte_1_1callback_1_1_async_callback}{Async\+Callback}} callback)
\begin{DoxyCompactList}\small\item\em Opens a U\+RL resource. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{classio_1_1agora_1_1rte_1_1_player_a219d9214421d6d79bbb38b0a419d4319}\label{classio_1_1agora_1_1rte_1_1_player_a219d9214421d6d79bbb38b0a419d4319}} 
void {\bfseries open\+With\+Custom\+Source\+Provider} (\mbox{\hyperlink{classio_1_1agora_1_1rte_1_1_player_custom_source_provider}{Player\+Custom\+Source\+Provider}} provider, long start\+Time, \mbox{\hyperlink{interfaceio_1_1agora_1_1rte_1_1callback_1_1_async_callback}{Async\+Callback}} callback)
\item 
\mbox{\Hypertarget{classio_1_1agora_1_1rte_1_1_player_afff7197bddff44a12018cf32828d4909}\label{classio_1_1agora_1_1rte_1_1_player_afff7197bddff44a12018cf32828d4909}} 
void {\bfseries open\+With\+Stream} (\mbox{\hyperlink{classio_1_1agora_1_1rte_1_1_stream}{Stream}} stream, \mbox{\hyperlink{interfaceio_1_1agora_1_1rte_1_1callback_1_1_async_callback}{Async\+Callback}} callback)
\item 
void \mbox{\hyperlink{classio_1_1agora_1_1rte_1_1_player_a5e7ef73951b08213dc4cb78994756b96}{switch\+With\+Url}} (String url, boolean sync\+Pts, \mbox{\hyperlink{interfaceio_1_1agora_1_1rte_1_1callback_1_1_async_callback}{Async\+Callback}} callback)
\begin{DoxyCompactList}\small\item\em Switches to a new U\+RL during playback. \end{DoxyCompactList}\item 
void \mbox{\hyperlink{classio_1_1agora_1_1rte_1_1_player_a4d60a7b3ce500b85633316d958c32288}{get\+Stats}} (\mbox{\hyperlink{interfaceio_1_1agora_1_1rte_1_1callback_1_1_player_get_stats_callback}{Player\+Get\+Stats\+Callback}} callback)
\begin{DoxyCompactList}\small\item\em Retrieves statistics of the currently playing media resource in the player. \end{DoxyCompactList}\item 
void \mbox{\hyperlink{classio_1_1agora_1_1rte_1_1_player_a7d17448df479209d217bf4cf8e48a764}{set\+Canvas}} (\mbox{\hyperlink{classio_1_1agora_1_1rte_1_1_canvas}{Canvas}} canvas)  throws Rte\+Exception 
\begin{DoxyCompactList}\small\item\em Sets the view window to display video. \end{DoxyCompactList}\item 
void \mbox{\hyperlink{classio_1_1agora_1_1rte_1_1_player_a0dcaa97d267f163cb5b0682d23a0ae12}{play}} ()  throws Rte\+Exception 
\begin{DoxyCompactList}\small\item\em Plays a U\+RL resource. \end{DoxyCompactList}\item 
void \mbox{\hyperlink{classio_1_1agora_1_1rte_1_1_player_a6a9ec9bf1bc4d2ecc984073025481b5d}{stop}} ()  throws Rte\+Exception 
\begin{DoxyCompactList}\small\item\em Stops playing the media resource. \end{DoxyCompactList}\item 
void \mbox{\hyperlink{classio_1_1agora_1_1rte_1_1_player_a2b55b324408ff9ec105e6394934f1952}{pause}} ()  throws Rte\+Exception 
\begin{DoxyCompactList}\small\item\em Pauses playback. \end{DoxyCompactList}\item 
void \mbox{\hyperlink{classio_1_1agora_1_1rte_1_1_player_a9a6251e875016549fca3a69e4b7aecbb}{seek}} (long new\+Time)  throws Rte\+Exception 
\begin{DoxyCompactList}\small\item\em Seeks to a specified playback position. \end{DoxyCompactList}\item 
void \mbox{\hyperlink{classio_1_1agora_1_1rte_1_1_player_a36e4edc7b3c280299953b80d8e4eb9e5}{mute\+Audio}} (boolean mute)  throws Rte\+Exception 
\begin{DoxyCompactList}\small\item\em Starts or stops receiving the audio stream. \end{DoxyCompactList}\item 
void \mbox{\hyperlink{classio_1_1agora_1_1rte_1_1_player_a710cd051ff8059959f715f02971e081c}{mute\+Video}} (boolean mute)  throws Rte\+Exception 
\begin{DoxyCompactList}\small\item\em Starts or stops receiving remote video streams. \end{DoxyCompactList}\item 
long \mbox{\hyperlink{classio_1_1agora_1_1rte_1_1_player_a62173a025ba374da621e45c3ecc7c426}{get\+Position}} ()  throws Rte\+Exception 
\begin{DoxyCompactList}\small\item\em Gets the current playback position. \end{DoxyCompactList}\item 
void \mbox{\hyperlink{classio_1_1agora_1_1rte_1_1_player_a27fb0a75f54333ef5d2472840b739b61}{get\+Info}} (\mbox{\hyperlink{classio_1_1agora_1_1rte_1_1_player_info}{Player\+Info}} info)  throws Rte\+Exception 
\begin{DoxyCompactList}\small\item\em Retrieves information related to the player and media stream. \end{DoxyCompactList}\item 
void \mbox{\hyperlink{classio_1_1agora_1_1rte_1_1_player_ad796a4c4ee6017443786cdb0cc6cf1ca}{get\+Configs}} (\mbox{\hyperlink{classio_1_1agora_1_1rte_1_1_player_config}{Player\+Config}} config)  throws Rte\+Exception 
\begin{DoxyCompactList}\small\item\em Gets the current media player options. \end{DoxyCompactList}\item 
void \mbox{\hyperlink{classio_1_1agora_1_1rte_1_1_player_af315c87bcc2ea538c098e9857f4e29b1}{set\+Configs}} (\mbox{\hyperlink{classio_1_1agora_1_1rte_1_1_player_config}{Player\+Config}} config)  throws Rte\+Exception 
\begin{DoxyCompactList}\small\item\em Sets the player configurations. \end{DoxyCompactList}\item 
void \mbox{\hyperlink{classio_1_1agora_1_1rte_1_1_player_a472bb781b498f91da61017b7e6d471f4}{register\+Observer}} (\mbox{\hyperlink{classio_1_1agora_1_1rte_1_1_player_observer}{Player\+Observer}} observer)  throws Rte\+Exception 
\begin{DoxyCompactList}\small\item\em Registers an observer object for the player. \end{DoxyCompactList}\item 
void \mbox{\hyperlink{classio_1_1agora_1_1rte_1_1_player_ac39ed6a3afda5f66188be926ee28560c}{unregister\+Observer}} (\mbox{\hyperlink{classio_1_1agora_1_1rte_1_1_player_observer}{Player\+Observer}} observer)  throws Rte\+Exception 
\begin{DoxyCompactList}\small\item\em Unregisters the media player event observer object. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Static Public Member Functions}
\begin{DoxyCompactItemize}
\item 
static void \mbox{\hyperlink{classio_1_1agora_1_1rte_1_1_player_a7db73cb4e85581716756cf8fd9b9c773}{preload\+With\+Url}} (String url)  throws Rte\+Exception 
\begin{DoxyCompactList}\small\item\em Preloads a U\+RL resource. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Protected Member Functions}
\begin{DoxyCompactItemize}
\item 
\mbox{\Hypertarget{classio_1_1agora_1_1rte_1_1_player_a6f24c5b0517ab306c7c5362e4bfe900a}\label{classio_1_1agora_1_1rte_1_1_player_a6f24c5b0517ab306c7c5362e4bfe900a}} 
void {\bfseries finalize} ()
\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
The \mbox{\hyperlink{classio_1_1agora_1_1rte_1_1_player}{Player}} class can be used to play U\+RL resources. \begin{DoxySince}{Since}
v4.\+4.\+0 
\end{DoxySince}


\doxysubsection{Constructor \& Destructor Documentation}
\mbox{\Hypertarget{classio_1_1agora_1_1rte_1_1_player_a917e1b32d3e65e3f9785a5b3d2075490}\label{classio_1_1agora_1_1rte_1_1_player_a917e1b32d3e65e3f9785a5b3d2075490}} 
\index{io.agora.rte.Player@{io.agora.rte.Player}!Player@{Player}}
\index{Player@{Player}!io.agora.rte.Player@{io.agora.rte.Player}}
\doxysubsubsection{\texorpdfstring{Player()}{Player()}}
{\footnotesize\ttfamily io.\+agora.\+rte.\+Player.\+Player (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{classio_1_1agora_1_1rte_1_1_rte}{Rte}}}]{rte,  }\item[{\mbox{\hyperlink{classio_1_1agora_1_1rte_1_1_player_initial_config}{Player\+Initial\+Config}}}]{initial\+Config }\end{DoxyParamCaption})}



Constructs a player object. 

\begin{DoxySince}{Since}
v4.\+4.\+0
\end{DoxySince}
Call timing\+: This method must be called after {\ttfamily init\+Media\+Engine}.


\begin{DoxyParams}{Parameters}
{\em rte} & An {\ttfamily \mbox{\hyperlink{classio_1_1agora_1_1rte_1_1_rte}{Rte}}} object. \\
\hline
{\em initial\+Config} & Initialization settings for the player object. You can pass a null pointer. \\
\hline
\end{DoxyParams}


\doxysubsection{Member Function Documentation}
\mbox{\Hypertarget{classio_1_1agora_1_1rte_1_1_player_a7db73cb4e85581716756cf8fd9b9c773}\label{classio_1_1agora_1_1rte_1_1_player_a7db73cb4e85581716756cf8fd9b9c773}} 
\index{io.agora.rte.Player@{io.agora.rte.Player}!preloadWithUrl@{preloadWithUrl}}
\index{preloadWithUrl@{preloadWithUrl}!io.agora.rte.Player@{io.agora.rte.Player}}
\doxysubsubsection{\texorpdfstring{preloadWithUrl()}{preloadWithUrl()}}
{\footnotesize\ttfamily static void io.\+agora.\+rte.\+Player.\+preload\+With\+Url (\begin{DoxyParamCaption}\item[{String}]{url }\end{DoxyParamCaption}) throws \mbox{\hyperlink{classio_1_1agora_1_1rte_1_1exception_1_1_rte_exception}{Rte\+Exception}}\hspace{0.3cm}{\ttfamily [static]}}



Preloads a U\+RL resource. 

\begin{DoxySince}{Since}
v4.\+4.\+0
\end{DoxySince}
Successfully preloading a resource accelerates the speed of opening the U\+RL resource with {\ttfamily open\+With\+Url}. When you need to use these resources, they can be accessed more quickly, reducing wait time. Applicable scenarios\+: Preloading media resources before opening them can reduce user wait time and provide a smoother audiovisual experience. Call timing\+: You must call this method before {\ttfamily open\+With\+Url}.

\begin{DoxyNote}{Note}
This method currently only works for U\+R\+Ls with the {\ttfamily rte\+://} prefix. You can preload up to 20 U\+R\+Ls. If the limit is exceeded, newly preloaded U\+R\+Ls will replace the earliest ones.
\end{DoxyNote}

\begin{DoxyParams}{Parameters}
{\em url} & A U\+RL with the {\ttfamily rte\+://} prefix. For details on each field, refer to {\ttfamily Media Pull} on the audience side.\\
\hline
\end{DoxyParams}

\begin{DoxyExceptions}{Exceptions}
{\em Rte\+Exception} & If the method call fails, the S\+DK throws an {\ttfamily Rte\+Exception} with the corresponding error information. You need to catch and handle the exception. \\
\hline
\end{DoxyExceptions}
\mbox{\Hypertarget{classio_1_1agora_1_1rte_1_1_player_a3362b1868a8849c0e1042be2e55ed594}\label{classio_1_1agora_1_1rte_1_1_player_a3362b1868a8849c0e1042be2e55ed594}} 
\index{io.agora.rte.Player@{io.agora.rte.Player}!openWithUrl@{openWithUrl}}
\index{openWithUrl@{openWithUrl}!io.agora.rte.Player@{io.agora.rte.Player}}
\doxysubsubsection{\texorpdfstring{openWithUrl()}{openWithUrl()}}
{\footnotesize\ttfamily void io.\+agora.\+rte.\+Player.\+open\+With\+Url (\begin{DoxyParamCaption}\item[{String}]{url,  }\item[{long}]{start\+Time,  }\item[{\mbox{\hyperlink{interfaceio_1_1agora_1_1rte_1_1callback_1_1_async_callback}{Async\+Callback}}}]{callback }\end{DoxyParamCaption})}



Opens a U\+RL resource. 

\begin{DoxySince}{Since}
v4.\+4.\+0
\end{DoxySince}
This method supports opening real-\/time streaming media via a U\+RL. If you want to speed up the process of opening a U\+RL resource, you can call {\ttfamily preload\+With\+Url} to preload the resource before invoking this method. If the resource fails to open, you will receive an {\ttfamily on\+State\+Changed} callback reporting the player state as {\ttfamily F\+A\+I\+L\+ED}. In this case, you need to call {\ttfamily stop} first and then call {\ttfamily open\+With\+Url} again to reopen the U\+RL resource. If you have disabled autoplay, you can call {\ttfamily play} to start playback after the resource is opened. Call timing\+: This method must be called after {\ttfamily \mbox{\hyperlink{classio_1_1agora_1_1rte_1_1_player}{Player}}}. Related callbacks\+: After calling this method, the {\ttfamily on\+State\+Changed} callback is triggered, reporting the player state as {\ttfamily O\+P\+E\+N\+I\+NG}, indicating that the U\+RL is being opened. Once successfully opened, the player state is reported as {\ttfamily O\+P\+E\+N\+\_\+\+C\+O\+M\+P\+L\+E\+T\+ED}.

\begin{DoxyNote}{Note}
This method currently supports only U\+R\+Ls that start with {\ttfamily rte\+://}, direct C\+DN streaming U\+R\+Ls, and local media files.
\end{DoxyNote}

\begin{DoxyParams}{Parameters}
{\em url} & The U\+RL to open. It can be a direct C\+DN streaming U\+RL, a local media file, or a U\+RL prefixed with {\ttfamily rte\+://}. For detailed explanations of each field in the R\+TE U\+RL, see \char`\"{}\+Audience-\/side U\+R\+L playback\char`\"{}. \\
\hline
{\em start\+Time} & The start playback position in milliseconds. \\
\hline
{\em callback} & An asynchronous callback function used to notify the result of opening the U\+RL resource. If an error occurs during the process, you can get the specific error information through the {\ttfamily on\+Result} callback under {\ttfamily Async\+Callback}. \\
\hline
\end{DoxyParams}
\mbox{\Hypertarget{classio_1_1agora_1_1rte_1_1_player_a5e7ef73951b08213dc4cb78994756b96}\label{classio_1_1agora_1_1rte_1_1_player_a5e7ef73951b08213dc4cb78994756b96}} 
\index{io.agora.rte.Player@{io.agora.rte.Player}!switchWithUrl@{switchWithUrl}}
\index{switchWithUrl@{switchWithUrl}!io.agora.rte.Player@{io.agora.rte.Player}}
\doxysubsubsection{\texorpdfstring{switchWithUrl()}{switchWithUrl()}}
{\footnotesize\ttfamily void io.\+agora.\+rte.\+Player.\+switch\+With\+Url (\begin{DoxyParamCaption}\item[{String}]{url,  }\item[{boolean}]{sync\+Pts,  }\item[{\mbox{\hyperlink{interfaceio_1_1agora_1_1rte_1_1callback_1_1_async_callback}{Async\+Callback}}}]{callback }\end{DoxyParamCaption})}



Switches to a new U\+RL during playback. 

\begin{DoxySince}{Since}
v4.\+5.\+1
\end{DoxySince}
You must call this method when the S\+DK returns the player state as {\ttfamily O\+P\+E\+N\+\_\+\+C\+O\+M\+P\+L\+E\+T\+ED}.

\begin{DoxyNote}{Note}
This method is only effective when the player opens a non-\/\+R\+TE U\+RL.
\end{DoxyNote}

\begin{DoxyParams}{Parameters}
{\em url} & The U\+RL resource to switch to. \\
\hline
{\em sync\+Pts} & -\/ {\ttfamily true}\+: Synchronizes the playback position. ~\newline

\begin{DoxyItemize}
\item {\ttfamily false}\+: (Default) Does not synchronize the playback position. 
\end{DoxyItemize}\\
\hline
{\em callback} & Asynchronous callback used to notify the result of the switch operation. See {\ttfamily Async\+Callback} for details. \\
\hline
\end{DoxyParams}
\mbox{\Hypertarget{classio_1_1agora_1_1rte_1_1_player_a4d60a7b3ce500b85633316d958c32288}\label{classio_1_1agora_1_1rte_1_1_player_a4d60a7b3ce500b85633316d958c32288}} 
\index{io.agora.rte.Player@{io.agora.rte.Player}!getStats@{getStats}}
\index{getStats@{getStats}!io.agora.rte.Player@{io.agora.rte.Player}}
\doxysubsubsection{\texorpdfstring{getStats()}{getStats()}}
{\footnotesize\ttfamily void io.\+agora.\+rte.\+Player.\+get\+Stats (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{interfaceio_1_1agora_1_1rte_1_1callback_1_1_player_get_stats_callback}{Player\+Get\+Stats\+Callback}}}]{callback }\end{DoxyParamCaption})}



Retrieves statistics of the currently playing media resource in the player. 

\begin{DoxySince}{Since}
v4.\+4.\+0
\end{DoxySince}
This method retrieves player statistics, including decoding and rendering frame rates, audio and video bitrate, etc., and returns the result asynchronously through a callback function. Call timing\+: This method must be called after {\ttfamily open\+With\+Url}.


\begin{DoxyParams}{Parameters}
{\em callback} & Callback interface used to asynchronously receive statistics and possible error information. See the {\ttfamily on\+Result} callback under the {\ttfamily Player\+Get\+Stats\+Callback} interface class. \\
\hline
\end{DoxyParams}
\mbox{\Hypertarget{classio_1_1agora_1_1rte_1_1_player_a7d17448df479209d217bf4cf8e48a764}\label{classio_1_1agora_1_1rte_1_1_player_a7d17448df479209d217bf4cf8e48a764}} 
\index{io.agora.rte.Player@{io.agora.rte.Player}!setCanvas@{setCanvas}}
\index{setCanvas@{setCanvas}!io.agora.rte.Player@{io.agora.rte.Player}}
\doxysubsubsection{\texorpdfstring{setCanvas()}{setCanvas()}}
{\footnotesize\ttfamily void io.\+agora.\+rte.\+Player.\+set\+Canvas (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{classio_1_1agora_1_1rte_1_1_canvas}{Canvas}}}]{canvas }\end{DoxyParamCaption}) throws \mbox{\hyperlink{classio_1_1agora_1_1rte_1_1exception_1_1_rte_exception}{Rte\+Exception}}}



Sets the view window to display video. 

\begin{DoxySince}{Since}
v4.\+4.\+0
\end{DoxySince}
This method specifies a {\ttfamily \mbox{\hyperlink{classio_1_1agora_1_1rte_1_1_canvas}{Canvas}}} object to display video. Once the video stream plays successfully, the video image appears on the specified {\ttfamily \mbox{\hyperlink{classio_1_1agora_1_1rte_1_1_canvas}{Canvas}}}. Call timing\+: This method must be called after {\ttfamily \mbox{\hyperlink{classio_1_1agora_1_1rte_1_1_player}{Player}}}.


\begin{DoxyParams}{Parameters}
{\em canvas} & The {\ttfamily \mbox{\hyperlink{classio_1_1agora_1_1rte_1_1_canvas}{Canvas}}} object used to render video frames. See {\ttfamily \mbox{\hyperlink{classio_1_1agora_1_1rte_1_1_canvas}{Canvas}}} for details.\\
\hline
\end{DoxyParams}

\begin{DoxyExceptions}{Exceptions}
{\em Rte\+Exception} & If the method call fails, the S\+DK throws an {\ttfamily Rte\+Exception} with the corresponding error information. You need to catch and handle the exception. \\
\hline
\end{DoxyExceptions}
\mbox{\Hypertarget{classio_1_1agora_1_1rte_1_1_player_a0dcaa97d267f163cb5b0682d23a0ae12}\label{classio_1_1agora_1_1rte_1_1_player_a0dcaa97d267f163cb5b0682d23a0ae12}} 
\index{io.agora.rte.Player@{io.agora.rte.Player}!play@{play}}
\index{play@{play}!io.agora.rte.Player@{io.agora.rte.Player}}
\doxysubsubsection{\texorpdfstring{play()}{play()}}
{\footnotesize\ttfamily void io.\+agora.\+rte.\+Player.\+play (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) throws \mbox{\hyperlink{classio_1_1agora_1_1rte_1_1exception_1_1_rte_exception}{Rte\+Exception}}}



Plays a U\+RL resource. 

\begin{DoxySince}{Since}
v4.\+4.\+0
\end{DoxySince}
If you have disabled autoplay, after successfully opening a Media Pull stream using {\ttfamily open\+With\+Url}, you can call this method to start playback. Call timing\+: Call this method only after receiving the {\ttfamily on\+State\+Changed} callback with the state {\ttfamily O\+P\+E\+N\+\_\+\+C\+O\+M\+P\+L\+E\+T\+ED}. Related callbacks\+: After this method is successfully called, the {\ttfamily on\+State\+Changed} callback will be triggered to report the player state.

\begin{DoxyNote}{Note}
This method currently only supports U\+R\+Ls with the {\ttfamily rte\+://} prefix.
\end{DoxyNote}

\begin{DoxyExceptions}{Exceptions}
{\em Rte\+Exception} & If the method call fails, the S\+DK throws an {\ttfamily Rte\+Exception} with the corresponding error information. You need to catch and handle the exception. \\
\hline
\end{DoxyExceptions}
\mbox{\Hypertarget{classio_1_1agora_1_1rte_1_1_player_a6a9ec9bf1bc4d2ecc984073025481b5d}\label{classio_1_1agora_1_1rte_1_1_player_a6a9ec9bf1bc4d2ecc984073025481b5d}} 
\index{io.agora.rte.Player@{io.agora.rte.Player}!stop@{stop}}
\index{stop@{stop}!io.agora.rte.Player@{io.agora.rte.Player}}
\doxysubsubsection{\texorpdfstring{stop()}{stop()}}
{\footnotesize\ttfamily void io.\+agora.\+rte.\+Player.\+stop (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) throws \mbox{\hyperlink{classio_1_1agora_1_1rte_1_1exception_1_1_rte_exception}{Rte\+Exception}}}



Stops playing the media resource. 

\begin{DoxySince}{Since}
v4.\+4.\+0
\end{DoxySince}
After you successfully open a U\+RL stream using {\ttfamily open\+With\+Url} and start playback with {\ttfamily play}, you can call this method to stop playback. If you want to pause playback instead, call {\ttfamily pause}. If opening the U\+RL stream with {\ttfamily open\+With\+Url} fails, you need to call this method first before calling {\ttfamily open\+With\+Url} again to reopen the U\+RL. Call timing\+: This method must be called after {\ttfamily open\+With\+Url}. Related callbacks\+: Upon successful execution, this method triggers the {\ttfamily on\+State\+Changed} callback and reports the player state as {\ttfamily S\+T\+O\+P\+P\+ED}.


\begin{DoxyExceptions}{Exceptions}
{\em Rte\+Exception} & If the method call fails, the S\+DK throws an {\ttfamily Rte\+Exception} with the corresponding error information. You need to catch and handle the exception. \\
\hline
\end{DoxyExceptions}
\mbox{\Hypertarget{classio_1_1agora_1_1rte_1_1_player_a2b55b324408ff9ec105e6394934f1952}\label{classio_1_1agora_1_1rte_1_1_player_a2b55b324408ff9ec105e6394934f1952}} 
\index{io.agora.rte.Player@{io.agora.rte.Player}!pause@{pause}}
\index{pause@{pause}!io.agora.rte.Player@{io.agora.rte.Player}}
\doxysubsubsection{\texorpdfstring{pause()}{pause()}}
{\footnotesize\ttfamily void io.\+agora.\+rte.\+Player.\+pause (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) throws \mbox{\hyperlink{classio_1_1agora_1_1rte_1_1exception_1_1_rte_exception}{Rte\+Exception}}}



Pauses playback. 

\begin{DoxySince}{Since}
v4.\+4.\+0
\end{DoxySince}
After you call {\ttfamily play} to play a U\+RL resource, you can call this method if you want to pause the playback. If you want to stop the playback, call {\ttfamily stop} instead. ~\newline
 Call timing\+: This method must be called after {\ttfamily play}. Related callbacks\+: After this method is successfully called, the {\ttfamily on\+State\+Changed} callback is triggered to report the player state as {\ttfamily P\+A\+U\+S\+ED}.


\begin{DoxyExceptions}{Exceptions}
{\em Rte\+Exception} & If this method call fails, the S\+DK throws an {\ttfamily Rte\+Exception} with the corresponding error message. You need to catch and handle the exception. \\
\hline
\end{DoxyExceptions}
\mbox{\Hypertarget{classio_1_1agora_1_1rte_1_1_player_a9a6251e875016549fca3a69e4b7aecbb}\label{classio_1_1agora_1_1rte_1_1_player_a9a6251e875016549fca3a69e4b7aecbb}} 
\index{io.agora.rte.Player@{io.agora.rte.Player}!seek@{seek}}
\index{seek@{seek}!io.agora.rte.Player@{io.agora.rte.Player}}
\doxysubsubsection{\texorpdfstring{seek()}{seek()}}
{\footnotesize\ttfamily void io.\+agora.\+rte.\+Player.\+seek (\begin{DoxyParamCaption}\item[{long}]{new\+Time }\end{DoxyParamCaption}) throws \mbox{\hyperlink{classio_1_1agora_1_1rte_1_1exception_1_1_rte_exception}{Rte\+Exception}}}



Seeks to a specified playback position. 

\begin{DoxySince}{Since}
v4.\+5.\+1
\end{DoxySince}

\begin{DoxyParams}{Parameters}
{\em new\+Time} & The playback position to seek to, in milliseconds.\\
\hline
\end{DoxyParams}

\begin{DoxyExceptions}{Exceptions}
{\em Rte\+Exception} & If the method call fails, the S\+DK throws an {\ttfamily Rte\+Exception} with the corresponding error information. You need to catch and handle the exception. \\
\hline
\end{DoxyExceptions}
\mbox{\Hypertarget{classio_1_1agora_1_1rte_1_1_player_a36e4edc7b3c280299953b80d8e4eb9e5}\label{classio_1_1agora_1_1rte_1_1_player_a36e4edc7b3c280299953b80d8e4eb9e5}} 
\index{io.agora.rte.Player@{io.agora.rte.Player}!muteAudio@{muteAudio}}
\index{muteAudio@{muteAudio}!io.agora.rte.Player@{io.agora.rte.Player}}
\doxysubsubsection{\texorpdfstring{muteAudio()}{muteAudio()}}
{\footnotesize\ttfamily void io.\+agora.\+rte.\+Player.\+mute\+Audio (\begin{DoxyParamCaption}\item[{boolean}]{mute }\end{DoxyParamCaption}) throws \mbox{\hyperlink{classio_1_1agora_1_1rte_1_1exception_1_1_rte_exception}{Rte\+Exception}}}



Starts or stops receiving the audio stream. 

\begin{DoxySince}{Since}
v4.\+4.\+0
\end{DoxySince}
Call timing\+: You must call this method after {\ttfamily open\+With\+Url}. Related callbacks\+: After this method is successfully called, the {\ttfamily on\+Player\+Info\+Updated(\+Player\+Info info)} callback is triggered to report the latest player and Media Pull information.


\begin{DoxyParams}{Parameters}
{\em mute} & Whether to receive the audio stream\+:
\begin{DoxyItemize}
\item {\ttfamily true}\+: Do not receive the audio stream.
\item {\ttfamily false}\+: Receive the audio stream.
\end{DoxyItemize}\\
\hline
\end{DoxyParams}

\begin{DoxyExceptions}{Exceptions}
{\em Rte\+Exception} & If the method call fails, the S\+DK throws an {\ttfamily Rte\+Exception} with the corresponding error information. You need to catch and handle the exception. \\
\hline
\end{DoxyExceptions}
\mbox{\Hypertarget{classio_1_1agora_1_1rte_1_1_player_a710cd051ff8059959f715f02971e081c}\label{classio_1_1agora_1_1rte_1_1_player_a710cd051ff8059959f715f02971e081c}} 
\index{io.agora.rte.Player@{io.agora.rte.Player}!muteVideo@{muteVideo}}
\index{muteVideo@{muteVideo}!io.agora.rte.Player@{io.agora.rte.Player}}
\doxysubsubsection{\texorpdfstring{muteVideo()}{muteVideo()}}
{\footnotesize\ttfamily void io.\+agora.\+rte.\+Player.\+mute\+Video (\begin{DoxyParamCaption}\item[{boolean}]{mute }\end{DoxyParamCaption}) throws \mbox{\hyperlink{classio_1_1agora_1_1rte_1_1exception_1_1_rte_exception}{Rte\+Exception}}}



Starts or stops receiving remote video streams. 

\begin{DoxySince}{Since}
v4.\+4.\+0
\end{DoxySince}
Call timing\+: You must call this method after {\ttfamily open\+With\+Url}. Related callbacks\+: After this method is successfully called, the {\ttfamily on\+Player\+Info\+Updated(\+Player\+Info info)} callback is triggered to report the latest player and media stream information.


\begin{DoxyParams}{Parameters}
{\em mute} & Whether to receive remote video streams\+:
\begin{DoxyItemize}
\item {\ttfamily true}\+: Do not receive remote video streams.
\item {\ttfamily false}\+: Receive remote video streams.
\end{DoxyItemize}\\
\hline
\end{DoxyParams}

\begin{DoxyExceptions}{Exceptions}
{\em Rte\+Exception} & If the method call fails, the S\+DK throws an {\ttfamily Rte\+Exception} with the corresponding error information. You need to catch and handle the exception. \\
\hline
\end{DoxyExceptions}
\mbox{\Hypertarget{classio_1_1agora_1_1rte_1_1_player_a62173a025ba374da621e45c3ecc7c426}\label{classio_1_1agora_1_1rte_1_1_player_a62173a025ba374da621e45c3ecc7c426}} 
\index{io.agora.rte.Player@{io.agora.rte.Player}!getPosition@{getPosition}}
\index{getPosition@{getPosition}!io.agora.rte.Player@{io.agora.rte.Player}}
\doxysubsubsection{\texorpdfstring{getPosition()}{getPosition()}}
{\footnotesize\ttfamily long io.\+agora.\+rte.\+Player.\+get\+Position (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) throws \mbox{\hyperlink{classio_1_1agora_1_1rte_1_1exception_1_1_rte_exception}{Rte\+Exception}}}



Gets the current playback position. 

\begin{DoxySince}{Since}
v4.\+5.\+1
\end{DoxySince}
This method retrieves the current playback time position in milliseconds.

\begin{DoxyReturn}{Returns}
If the method call succeeds, returns the current playback position in milliseconds.
\end{DoxyReturn}

\begin{DoxyExceptions}{Exceptions}
{\em Rte\+Exception} & If the method call fails, the S\+DK throws an {\ttfamily Rte\+Exception} with the corresponding error information. You need to catch and handle the exception. \\
\hline
\end{DoxyExceptions}
\mbox{\Hypertarget{classio_1_1agora_1_1rte_1_1_player_a27fb0a75f54333ef5d2472840b739b61}\label{classio_1_1agora_1_1rte_1_1_player_a27fb0a75f54333ef5d2472840b739b61}} 
\index{io.agora.rte.Player@{io.agora.rte.Player}!getInfo@{getInfo}}
\index{getInfo@{getInfo}!io.agora.rte.Player@{io.agora.rte.Player}}
\doxysubsubsection{\texorpdfstring{getInfo()}{getInfo()}}
{\footnotesize\ttfamily void io.\+agora.\+rte.\+Player.\+get\+Info (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{classio_1_1agora_1_1rte_1_1_player_info}{Player\+Info}}}]{info }\end{DoxyParamCaption}) throws \mbox{\hyperlink{classio_1_1agora_1_1rte_1_1exception_1_1_rte_exception}{Rte\+Exception}}}



Retrieves information related to the player and media stream. 

\begin{DoxySince}{Since}
v4.\+4.\+0
\end{DoxySince}
You can use this method to obtain information about the player and the media stream, such as audio sample rate and video frame dimensions. Call timing\+: This method must be called after {\ttfamily \mbox{\hyperlink{classio_1_1agora_1_1rte_1_1_player}{Player}}}.


\begin{DoxyParams}{Parameters}
{\em info} & Information related to the player and media stream. See {\ttfamily \mbox{\hyperlink{classio_1_1agora_1_1rte_1_1_player_info}{Player\+Info}}} for details.\\
\hline
\end{DoxyParams}

\begin{DoxyExceptions}{Exceptions}
{\em Rte\+Exception} & If this method call fails, the S\+DK throws an {\ttfamily Rte\+Exception} with the corresponding error message. You need to catch and handle the exception. \\
\hline
\end{DoxyExceptions}
\mbox{\Hypertarget{classio_1_1agora_1_1rte_1_1_player_ad796a4c4ee6017443786cdb0cc6cf1ca}\label{classio_1_1agora_1_1rte_1_1_player_ad796a4c4ee6017443786cdb0cc6cf1ca}} 
\index{io.agora.rte.Player@{io.agora.rte.Player}!getConfigs@{getConfigs}}
\index{getConfigs@{getConfigs}!io.agora.rte.Player@{io.agora.rte.Player}}
\doxysubsubsection{\texorpdfstring{getConfigs()}{getConfigs()}}
{\footnotesize\ttfamily void io.\+agora.\+rte.\+Player.\+get\+Configs (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{classio_1_1agora_1_1rte_1_1_player_config}{Player\+Config}}}]{config }\end{DoxyParamCaption}) throws \mbox{\hyperlink{classio_1_1agora_1_1rte_1_1exception_1_1_rte_exception}{Rte\+Exception}}}



Gets the current media player options. 

\begin{DoxySince}{Since}
v4.\+4.\+0
\end{DoxySince}
Call timing\+: This method must be called after {\ttfamily \mbox{\hyperlink{classio_1_1agora_1_1rte_1_1_player}{Player}}}.


\begin{DoxyParams}{Parameters}
{\em config} & The media player options object. See {\ttfamily \mbox{\hyperlink{classio_1_1agora_1_1rte_1_1_player_config}{Player\+Config}}} for details.\\
\hline
\end{DoxyParams}

\begin{DoxyExceptions}{Exceptions}
{\em Rte\+Exception} & If the method call fails, the S\+DK throws an {\ttfamily Rte\+Exception} with the corresponding error information. You need to catch and handle the exception. \\
\hline
\end{DoxyExceptions}
\mbox{\Hypertarget{classio_1_1agora_1_1rte_1_1_player_af315c87bcc2ea538c098e9857f4e29b1}\label{classio_1_1agora_1_1rte_1_1_player_af315c87bcc2ea538c098e9857f4e29b1}} 
\index{io.agora.rte.Player@{io.agora.rte.Player}!setConfigs@{setConfigs}}
\index{setConfigs@{setConfigs}!io.agora.rte.Player@{io.agora.rte.Player}}
\doxysubsubsection{\texorpdfstring{setConfigs()}{setConfigs()}}
{\footnotesize\ttfamily void io.\+agora.\+rte.\+Player.\+set\+Configs (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{classio_1_1agora_1_1rte_1_1_player_config}{Player\+Config}}}]{config }\end{DoxyParamCaption}) throws \mbox{\hyperlink{classio_1_1agora_1_1rte_1_1exception_1_1_rte_exception}{Rte\+Exception}}}



Sets the player configurations. 

\begin{DoxySince}{Since}
v4.\+4.\+0
\end{DoxySince}
You can call this method to configure the player, such as enabling autoplay and subscribing to video streams of different resolutions and bitrate. Call timing\+: This method must be called after {\ttfamily \mbox{\hyperlink{classio_1_1agora_1_1rte_1_1_player}{Player}}}.


\begin{DoxyParams}{Parameters}
{\em config} & The player configuration object. See {\ttfamily \mbox{\hyperlink{classio_1_1agora_1_1rte_1_1_player_config}{Player\+Config}}} for details.\\
\hline
\end{DoxyParams}

\begin{DoxyExceptions}{Exceptions}
{\em Rte\+Exception} & If the method call fails, the S\+DK throws an {\ttfamily Rte\+Exception} with the corresponding error information. You need to catch and handle the exception. \\
\hline
\end{DoxyExceptions}
\mbox{\Hypertarget{classio_1_1agora_1_1rte_1_1_player_a472bb781b498f91da61017b7e6d471f4}\label{classio_1_1agora_1_1rte_1_1_player_a472bb781b498f91da61017b7e6d471f4}} 
\index{io.agora.rte.Player@{io.agora.rte.Player}!registerObserver@{registerObserver}}
\index{registerObserver@{registerObserver}!io.agora.rte.Player@{io.agora.rte.Player}}
\doxysubsubsection{\texorpdfstring{registerObserver()}{registerObserver()}}
{\footnotesize\ttfamily void io.\+agora.\+rte.\+Player.\+register\+Observer (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{classio_1_1agora_1_1rte_1_1_player_observer}{Player\+Observer}}}]{observer }\end{DoxyParamCaption}) throws \mbox{\hyperlink{classio_1_1agora_1_1rte_1_1exception_1_1_rte_exception}{Rte\+Exception}}}



Registers an observer object for the player. 

\begin{DoxySince}{Since}
v4.\+4.\+0
\end{DoxySince}
Before calling this method, you need to implement an interface class that inherits from {\ttfamily \mbox{\hyperlink{classio_1_1agora_1_1rte_1_1_player_observer}{Player\+Observer}}}. Call timing\+: This method must be called after {\ttfamily \mbox{\hyperlink{classio_1_1agora_1_1rte_1_1_player}{Player}}}.


\begin{DoxyParams}{Parameters}
{\em observer} & An instance of the interface object. See {\ttfamily \mbox{\hyperlink{classio_1_1agora_1_1rte_1_1_player_observer}{Player\+Observer}}} for details.\\
\hline
\end{DoxyParams}

\begin{DoxyExceptions}{Exceptions}
{\em Rte\+Exception} & If the method call fails, the S\+DK throws a {\ttfamily Rte\+Exception} with the corresponding error message. You need to catch and handle the exception. \\
\hline
\end{DoxyExceptions}
\mbox{\Hypertarget{classio_1_1agora_1_1rte_1_1_player_ac39ed6a3afda5f66188be926ee28560c}\label{classio_1_1agora_1_1rte_1_1_player_ac39ed6a3afda5f66188be926ee28560c}} 
\index{io.agora.rte.Player@{io.agora.rte.Player}!unregisterObserver@{unregisterObserver}}
\index{unregisterObserver@{unregisterObserver}!io.agora.rte.Player@{io.agora.rte.Player}}
\doxysubsubsection{\texorpdfstring{unregisterObserver()}{unregisterObserver()}}
{\footnotesize\ttfamily void io.\+agora.\+rte.\+Player.\+unregister\+Observer (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{classio_1_1agora_1_1rte_1_1_player_observer}{Player\+Observer}}}]{observer }\end{DoxyParamCaption}) throws \mbox{\hyperlink{classio_1_1agora_1_1rte_1_1exception_1_1_rte_exception}{Rte\+Exception}}}



Unregisters the media player event observer object. 

\begin{DoxySince}{Since}
v4.\+4.\+0
\end{DoxySince}
After calling {\ttfamily register\+Observer} to register a media player event observer, if you need to unregister it, call this method. Call timing\+: This method must be called after {\ttfamily register\+Observer}.


\begin{DoxyParams}{Parameters}
{\em observer} & The interface object instance. See {\ttfamily \mbox{\hyperlink{classio_1_1agora_1_1rte_1_1_player_observer}{Player\+Observer}}} for details.\\
\hline
\end{DoxyParams}

\begin{DoxyExceptions}{Exceptions}
{\em Rte\+Exception} & If the method call fails, the S\+DK throws an {\ttfamily Rte\+Exception} with the corresponding error message. You need to catch and handle the exception. \\
\hline
\end{DoxyExceptions}
