\hypertarget{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player}{}\doxysection{io.\+agora.\+mediaplayer.\+I\+Media\+Player Interface Reference}
\label{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player}\index{io.agora.mediaplayer.IMediaPlayer@{io.agora.mediaplayer.IMediaPlayer}}
Inheritance diagram for io.\+agora.\+mediaplayer.\+I\+Media\+Player\+:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=2.000000cm]{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player}
\end{center}
\end{figure}
\doxysubsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
int \mbox{\hyperlink{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_a0220740bfbafb43195e8536475de349f}{get\+Media\+Player\+Id}} ()
\begin{DoxyCompactList}\small\item\em Gets the ID of the media player. \end{DoxyCompactList}\item 
int \mbox{\hyperlink{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_a8d476bd955a5a25c552215066a22feb1}{open}} (Uri uri, long start\+Pos)
\begin{DoxyCompactList}\small\item\em Opens a media file through a U\+RI address. \end{DoxyCompactList}\item 
int \mbox{\hyperlink{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_a17d627406558715c2cd06ee71b587432}{open}} (String url, long start\+Pos)
\begin{DoxyCompactList}\small\item\em Opens the media resource. \end{DoxyCompactList}\item 
int \mbox{\hyperlink{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_a8feb20e7cd0f569f2451aaf2c70d2422}{open\+With\+Media\+Source}} (\mbox{\hyperlink{classio_1_1agora_1_1mediaplayer_1_1data_1_1_media_player_source}{Media\+Player\+Source}} source)
\begin{DoxyCompactList}\small\item\em Opens a media file and configures the playback scenarios. \end{DoxyCompactList}\item 
int \mbox{\hyperlink{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_a35dfcfdc6cadf741bddb4c8fd068a4be}{play}} ()
\begin{DoxyCompactList}\small\item\em Plays the media file. \end{DoxyCompactList}\item 
int \mbox{\hyperlink{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_a36ceefe13443e3a4bac9e6d4223d8fb6}{pause}} ()
\begin{DoxyCompactList}\small\item\em Pauses the playback. \end{DoxyCompactList}\item 
int \mbox{\hyperlink{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_a96cfc3d9200e98724eb03476530e6025}{stop}} ()
\begin{DoxyCompactList}\small\item\em Stops playing the media track. \end{DoxyCompactList}\item 
int \mbox{\hyperlink{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_ab13425b03bc85976ff277750485517ed}{resume}} ()
\begin{DoxyCompactList}\small\item\em Resumes playing the media file. \end{DoxyCompactList}\item 
int \mbox{\hyperlink{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_a16450aef1b0ea88abe554c35d112a6e9}{seek}} (long new\+Pos)
\begin{DoxyCompactList}\small\item\em Seeks to a new playback position. \end{DoxyCompactList}\item 
int \mbox{\hyperlink{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_ab17c9dbb96d64de084397d36ac6087e5}{set\+Audio\+Pitch}} (int pitch)
\begin{DoxyCompactList}\small\item\em Sets the pitch of the current media resource. \end{DoxyCompactList}\item 
int \mbox{\hyperlink{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_acac05945b0a5844d741c409f383d9eba}{mute}} (boolean muted)
\begin{DoxyCompactList}\small\item\em Sets whether to mute the media file. \end{DoxyCompactList}\item 
boolean \mbox{\hyperlink{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_a365a0f64d2798de72898c9df1bd43695}{get\+Mute}} ()
\begin{DoxyCompactList}\small\item\em Reports whether the media resource is muted. \end{DoxyCompactList}\item 
int \mbox{\hyperlink{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_a73edc580de06fdbc6390ff01041ccd52}{adjust\+Playout\+Volume}} (int volume)
\begin{DoxyCompactList}\small\item\em Adjusts the local playback volume. \end{DoxyCompactList}\item 
int \mbox{\hyperlink{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_a43a4a4b758bf058bc520dd9be90c2266}{get\+Playout\+Volume}} ()
\begin{DoxyCompactList}\small\item\em Gets the local playback volume. \end{DoxyCompactList}\item 
long \mbox{\hyperlink{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_a37c8a3301ed6566e90a620a35e225a7a}{get\+Play\+Position}} ()
\begin{DoxyCompactList}\small\item\em Gets current local playback progress. \end{DoxyCompactList}\item 
long \mbox{\hyperlink{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_a78be2e738d7c458ca49332ead63cfbd4}{get\+Duration}} ()
\begin{DoxyCompactList}\small\item\em Gets the duration of the media resource. \end{DoxyCompactList}\item 
int \mbox{\hyperlink{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_a6d1787a033e062ec81d5a54697f53e73}{get\+Audio\+Buffer\+Delay}} ()
\begin{DoxyCompactList}\small\item\em Gets the audio buffer delay when playing the media file. \end{DoxyCompactList}\item 
Constants.\+Media\+Player\+State \mbox{\hyperlink{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_ad056c286d21e25a2fce2c4366f89be4e}{get\+State}} ()
\begin{DoxyCompactList}\small\item\em Gets current playback state. \end{DoxyCompactList}\item 
int \mbox{\hyperlink{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_a30a1826581d0601e9412ebe550b10675}{get\+Stream\+Count}} ()
\begin{DoxyCompactList}\small\item\em Gets the number of the media streams in the media resource. \end{DoxyCompactList}\item 
int \mbox{\hyperlink{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_adaf0d07e6b9cbb137b5200e772ca2960}{set\+View}} (View video\+View)
\begin{DoxyCompactList}\small\item\em Sets the view. \end{DoxyCompactList}\item 
int \mbox{\hyperlink{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_a544f0d651cb8a527e79a6ec06d5b1faa}{set\+Render\+Mode}} (int mode)
\begin{DoxyCompactList}\small\item\em Sets the render mode of the media player. \end{DoxyCompactList}\item 
\mbox{\hyperlink{classio_1_1agora_1_1mediaplayer_1_1data_1_1_media_stream_info}{Media\+Stream\+Info}} \mbox{\hyperlink{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_a591a95e9b6809389b54431d3a6ff60af}{get\+Stream\+Info}} (int index)
\begin{DoxyCompactList}\small\item\em Gets the detailed information of the media stream. \end{DoxyCompactList}\item 
int \mbox{\hyperlink{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_aca0b9a1194cc2deced426da7d224dcbf}{set\+Loop\+Count}} (int loop\+Count)
\begin{DoxyCompactList}\small\item\em Sets the loop playback. \end{DoxyCompactList}\item 
int \mbox{\hyperlink{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_ab5db207de74fe4db97df71e106c39673}{set\+Playback\+Speed}} (int speed)
\begin{DoxyCompactList}\small\item\em Sets the channel mode of the current audio file. \end{DoxyCompactList}\item 
int \mbox{\hyperlink{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_a1970a14e6ade9dbd2d90a98ff95ec9c2}{select\+Audio\+Track}} (int index)
\begin{DoxyCompactList}\small\item\em Selects the audio track used during playback. \end{DoxyCompactList}\item 
int \mbox{\hyperlink{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_a4bfb9c48624deff2870fbac32b6a0a1f}{select\+Multi\+Audio\+Track}} (int playout\+Track\+Index, int publish\+Track\+Index)
\begin{DoxyCompactList}\small\item\em Selects the audio tracks that you want to play on your local device and publish to the channel respectively. \end{DoxyCompactList}\item 
int \mbox{\hyperlink{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_a3efe90d1d32eb32e4dc62d5d20d83839}{set\+Player\+Option}} (String key, int value)
\begin{DoxyCompactList}\small\item\em Sets media player options. \end{DoxyCompactList}\item 
int \mbox{\hyperlink{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_ab1e57491b900f849778f98d3e116cfc2}{set\+Player\+Option\+String}} (String key, String value)
\begin{DoxyCompactList}\small\item\em Sets media player options. \end{DoxyCompactList}\item 
int \mbox{\hyperlink{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_afa15aa236644ccee137da4f61509fae8}{take\+Screenshot}} (String filename)
\item 
int \mbox{\hyperlink{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_acf4fca2eb27b9d383d46360f846820cd}{select\+Internal\+Subtitle}} (int index)
\item 
int \mbox{\hyperlink{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_aafc71406711332a6d64a5ac2b38d0a31}{set\+External\+Subtitle}} (String url)
\item 
int \mbox{\hyperlink{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_a68a2bc92b2f0dbcb91ab1728a8e7e35c}{adjust\+Publish\+Signal\+Volume}} (int volume)
\begin{DoxyCompactList}\small\item\em Adjusts the volume of the media file for publishing. \end{DoxyCompactList}\item 
int \mbox{\hyperlink{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_a1a7a3d718a92ec5b7df1473e8b6fd3b5}{get\+Publish\+Signal\+Volume}} ()
\begin{DoxyCompactList}\small\item\em Gets the volume of the media file for publishing. \end{DoxyCompactList}\item 
String \mbox{\hyperlink{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_ae38ff4b5ee5a2582e9e6e04087c14433}{get\+Play\+Src}} ()
\begin{DoxyCompactList}\small\item\em Gets the path of the media resource being played. \end{DoxyCompactList}\item 
int \mbox{\hyperlink{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_aeb4637d26df2f6c8ce5c56e3ab6d5bf8}{switch\+Src}} (String src, boolean sync\+Pts)
\begin{DoxyCompactList}\small\item\em Switches the media resource being played. \end{DoxyCompactList}\item 
int \mbox{\hyperlink{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_ad4635aae425badaf12d42162dbd9732c}{preload\+Src}} (String src, long start\+Pos)
\begin{DoxyCompactList}\small\item\em Preloads a media resource. \end{DoxyCompactList}\item 
int \mbox{\hyperlink{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_a61e14cf182848ed533dd92bedfbe5604}{play\+Preloaded\+Src}} (String src)
\begin{DoxyCompactList}\small\item\em Plays preloaded media resources. \end{DoxyCompactList}\item 
int \mbox{\hyperlink{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_acebd1ca5d03dc435d1bfbab6665290b1}{unload\+Src}} (String src)
\begin{DoxyCompactList}\small\item\em Unloads media resources that are preloaded. \end{DoxyCompactList}\item 
int \mbox{\hyperlink{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_a7b0e840af73b95213d42e155c20a5e0e}{destroy}} ()
\begin{DoxyCompactList}\small\item\em Destroys the media player instance. \end{DoxyCompactList}\item 
int \mbox{\hyperlink{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_a6af7f2ea9f2776553790547f7502cfdc}{register\+Player\+Observer}} (\mbox{\hyperlink{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_observer}{I\+Media\+Player\+Observer}} player\+Observer)
\begin{DoxyCompactList}\small\item\em Registers a media player observer. \end{DoxyCompactList}\item 
int \mbox{\hyperlink{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_a5abeb9a3912f887d510d2d13ec375330}{un\+Register\+Player\+Observer}} (\mbox{\hyperlink{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_observer}{I\+Media\+Player\+Observer}} player\+Observer)
\begin{DoxyCompactList}\small\item\em Releases a media player observer. \end{DoxyCompactList}\item 
int \mbox{\hyperlink{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_acb1b52a72ca3d0c9373885ebed458b37}{register\+Audio\+Frame\+Observer}} (\mbox{\hyperlink{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_audio_frame_observer}{I\+Media\+Player\+Audio\+Frame\+Observer}} audio\+Frame\+Observer, int mode)
\begin{DoxyCompactList}\small\item\em Registers an audio frame observer object. \end{DoxyCompactList}\item 
int \mbox{\hyperlink{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_adc668e3e6df11928992bec7301d1f126}{register\+Media\+Player\+Audio\+Spectrum\+Observer}} (\mbox{\hyperlink{interfaceio_1_1agora_1_1rtc2_1_1audio_1_1_i_audio_spectrum_observer}{I\+Audio\+Spectrum\+Observer}} observer, int interval\+In\+MS)
\item 
int \mbox{\hyperlink{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_adedb23ba72e07a06c5c66d5349d39351}{unregister\+Media\+Player\+Audio\+Spectrum\+Observer}} (\mbox{\hyperlink{interfaceio_1_1agora_1_1rtc2_1_1audio_1_1_i_audio_spectrum_observer}{I\+Audio\+Spectrum\+Observer}} observer)
\item 
int \mbox{\hyperlink{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_a6c8b23525ecfcfc066ab693ba09dd44e}{set\+Audio\+Dual\+Mono\+Mode}} (int mode)
\begin{DoxyCompactList}\small\item\em Sets the channel mode of the current audio file. \end{DoxyCompactList}\item 
int \mbox{\hyperlink{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_a5d38e0457ec5bfb9a3705b664f099b82}{register\+Video\+Frame\+Observer}} (\mbox{\hyperlink{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_video_frame_observer}{I\+Media\+Player\+Video\+Frame\+Observer}} video\+Frame\+Observer)
\begin{DoxyCompactList}\small\item\em Registers a video frame observer object. \end{DoxyCompactList}\item 
int \mbox{\hyperlink{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_a9d9933dc04c28037a0e941a5ed0fa61a}{open\+With\+Agora\+C\+D\+N\+Src}} (String src, long start\+Pos)
\item 
int \mbox{\hyperlink{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_aec985d367b9aa7abcda948a3f006b60a}{get\+Agora\+C\+D\+N\+Line\+Count}} ()
\item 
int \mbox{\hyperlink{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_aa14aeb7f107b37cf69c8f4f3d09d64a1}{switch\+Agora\+C\+D\+N\+Line\+By\+Index}} (int index)
\item 
int \mbox{\hyperlink{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_a4370eec4cae4e1f3076f421cb3a33e92}{get\+Current\+Agora\+C\+D\+N\+Index}} ()
\item 
int \mbox{\hyperlink{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_aeea244765c2e03c0455e2db9bd941de7}{enable\+Auto\+Switch\+Agora\+C\+DN}} (boolean enable)
\item 
int \mbox{\hyperlink{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_a63264a09e531562f8be50dd6524bec46}{renew\+Agora\+C\+D\+N\+Src\+Token}} (String token, long ts)
\item 
int \mbox{\hyperlink{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_ad4bf2afe404d0ae0316fcfc6efe115fe}{switch\+Agora\+C\+D\+N\+Src}} (String src, boolean sync\+Pts)
\item 
int \mbox{\hyperlink{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_a9ef467b5596fb186a570bfb5bc60fbc1}{set\+Spatial\+Audio\+Params}} (\mbox{\hyperlink{classio_1_1agora_1_1rtc2_1_1_spatial_audio_params}{Spatial\+Audio\+Params}} params)
\begin{DoxyCompactList}\small\item\em Enables or disables the spatial audio effect for the media player. \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsection{Member Function Documentation}
\mbox{\Hypertarget{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_a0220740bfbafb43195e8536475de349f}\label{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_a0220740bfbafb43195e8536475de349f}} 
\index{io.agora.mediaplayer.IMediaPlayer@{io.agora.mediaplayer.IMediaPlayer}!getMediaPlayerId@{getMediaPlayerId}}
\index{getMediaPlayerId@{getMediaPlayerId}!io.agora.mediaplayer.IMediaPlayer@{io.agora.mediaplayer.IMediaPlayer}}
\doxysubsubsection{\texorpdfstring{getMediaPlayerId()}{getMediaPlayerId()}}
{\footnotesize\ttfamily int io.\+agora.\+mediaplayer.\+I\+Media\+Player.\+get\+Media\+Player\+Id (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Gets the ID of the media player. 

\begin{DoxyReturn}{Returns}

\begin{DoxyItemize}
\item Success. The ID of the media player.
\item $<$ 0\+: Failure. 
\end{DoxyItemize}
\end{DoxyReturn}
\mbox{\Hypertarget{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_a8d476bd955a5a25c552215066a22feb1}\label{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_a8d476bd955a5a25c552215066a22feb1}} 
\index{io.agora.mediaplayer.IMediaPlayer@{io.agora.mediaplayer.IMediaPlayer}!open@{open}}
\index{open@{open}!io.agora.mediaplayer.IMediaPlayer@{io.agora.mediaplayer.IMediaPlayer}}
\doxysubsubsection{\texorpdfstring{open()}{open()}\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily int io.\+agora.\+mediaplayer.\+I\+Media\+Player.\+open (\begin{DoxyParamCaption}\item[{Uri}]{uri,  }\item[{long}]{start\+Pos }\end{DoxyParamCaption})}



Opens a media file through a U\+RI address. 

\begin{DoxyNote}{Note}
This method is called asynchronously.
\end{DoxyNote}

\begin{DoxyParams}{Parameters}
{\em uri} & The U\+RI (Uniform Resource Identifier) of the media file. \\
\hline
{\em start\+Pos} & The starting position (ms) for playback. The default value is 0.\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}

\begin{DoxyItemize}
\item 0\+: Success.
\item $<$ 0\+: Failure. 
\end{DoxyItemize}
\end{DoxyReturn}
\mbox{\Hypertarget{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_a17d627406558715c2cd06ee71b587432}\label{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_a17d627406558715c2cd06ee71b587432}} 
\index{io.agora.mediaplayer.IMediaPlayer@{io.agora.mediaplayer.IMediaPlayer}!open@{open}}
\index{open@{open}!io.agora.mediaplayer.IMediaPlayer@{io.agora.mediaplayer.IMediaPlayer}}
\doxysubsubsection{\texorpdfstring{open()}{open()}\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily int io.\+agora.\+mediaplayer.\+I\+Media\+Player.\+open (\begin{DoxyParamCaption}\item[{String}]{url,  }\item[{long}]{start\+Pos }\end{DoxyParamCaption})}



Opens the media resource. 

This method supports playing U\+RI files starting with {\ttfamily content\+://}. Call timing\+: This method can be called either before or after joining the channel. Related callbacks\+: After calling this method, the S\+DK triggers the {\ttfamily on\+Player\+State\+Changed} callback. After receiving the report of the playback status as {\ttfamily P\+L\+A\+Y\+E\+R\+\_\+\+S\+T\+A\+T\+E\+\_\+\+O\+P\+E\+N\+\_\+\+C\+O\+M\+P\+L\+E\+T\+ED}, you can call the {\ttfamily play} method to play the media file.

\begin{DoxyNote}{Note}
This method is called asynchronously.
\end{DoxyNote}

\begin{DoxyParams}{Parameters}
{\em url} & The path of the media file. Both local path and online path are supported. \\
\hline
{\em start\+Pos} & The starting position (ms) for playback. Default value is 0.\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}

\begin{DoxyItemize}
\item 0\+: Success.
\item $<$ 0\+: Failure. 
\end{DoxyItemize}
\end{DoxyReturn}


Implemented in \mbox{\hyperlink{interfaceio_1_1agora_1_1musiccontentcenter_1_1_i_agora_music_player_a1343b2784c28e3376d6295892cd5ea72}{io.\+agora.\+musiccontentcenter.\+I\+Agora\+Music\+Player}}.

\mbox{\Hypertarget{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_a8feb20e7cd0f569f2451aaf2c70d2422}\label{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_a8feb20e7cd0f569f2451aaf2c70d2422}} 
\index{io.agora.mediaplayer.IMediaPlayer@{io.agora.mediaplayer.IMediaPlayer}!openWithMediaSource@{openWithMediaSource}}
\index{openWithMediaSource@{openWithMediaSource}!io.agora.mediaplayer.IMediaPlayer@{io.agora.mediaplayer.IMediaPlayer}}
\doxysubsubsection{\texorpdfstring{openWithMediaSource()}{openWithMediaSource()}}
{\footnotesize\ttfamily int io.\+agora.\+mediaplayer.\+I\+Media\+Player.\+open\+With\+Media\+Source (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{classio_1_1agora_1_1mediaplayer_1_1data_1_1_media_player_source}{Media\+Player\+Source}}}]{source }\end{DoxyParamCaption})}



Opens a media file and configures the playback scenarios. 

This method supports opening different types of media files, including U\+RI files starting with {\ttfamily content\+://}, media files in the {\ttfamily assets} folder, and setting the playback options. Call timing\+: You can call this method either before or after joining a channel.

\begin{DoxyNote}{Note}
This method is called asynchronously. If you need to play a media file, make sure you receive the {\ttfamily on\+Player\+State\+Changed} callback reporting {\ttfamily P\+L\+A\+Y\+E\+R\+\_\+\+S\+T\+A\+T\+E\+\_\+\+O\+P\+E\+N\+\_\+\+C\+O\+M\+P\+L\+E\+T\+ED} before calling the {\ttfamily play} method to play the file.
\end{DoxyNote}

\begin{DoxyParams}{Parameters}
{\em source} & Media resources. See {\ttfamily Media\+Player\+Source}.\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}

\begin{DoxyItemize}
\item 0\+: Success.
\item $<$ 0\+: Failure. 
\end{DoxyItemize}
\end{DoxyReturn}
\mbox{\Hypertarget{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_a35dfcfdc6cadf741bddb4c8fd068a4be}\label{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_a35dfcfdc6cadf741bddb4c8fd068a4be}} 
\index{io.agora.mediaplayer.IMediaPlayer@{io.agora.mediaplayer.IMediaPlayer}!play@{play}}
\index{play@{play}!io.agora.mediaplayer.IMediaPlayer@{io.agora.mediaplayer.IMediaPlayer}}
\doxysubsubsection{\texorpdfstring{play()}{play()}}
{\footnotesize\ttfamily int io.\+agora.\+mediaplayer.\+I\+Media\+Player.\+play (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Plays the media file. 

Call timing\+: -\/ Call this method after calling {\ttfamily \mbox{\hyperlink{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_a17d627406558715c2cd06ee71b587432}{open(\+String url, long start\+Pos)}}} or {\ttfamily open\+With\+Media\+Source} opening a media file and receiving a {\ttfamily on\+Player\+State\+Changed} callback reporting the status as P\+L\+A\+Y\+E\+R\+\_\+\+S\+T\+A\+T\+E\+\_\+\+O\+P\+E\+N\+\_\+\+C\+O\+M\+P\+L\+E\+T\+ED.
\begin{DoxyItemize}
\item Call the method after calling {\ttfamily seek}.
\end{DoxyItemize}

\begin{DoxyReturn}{Returns}

\begin{DoxyItemize}
\item 0\+: Success.
\item $<$ 0\+: Failure. 
\end{DoxyItemize}
\end{DoxyReturn}
\mbox{\Hypertarget{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_a36ceefe13443e3a4bac9e6d4223d8fb6}\label{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_a36ceefe13443e3a4bac9e6d4223d8fb6}} 
\index{io.agora.mediaplayer.IMediaPlayer@{io.agora.mediaplayer.IMediaPlayer}!pause@{pause}}
\index{pause@{pause}!io.agora.mediaplayer.IMediaPlayer@{io.agora.mediaplayer.IMediaPlayer}}
\doxysubsubsection{\texorpdfstring{pause()}{pause()}}
{\footnotesize\ttfamily int io.\+agora.\+mediaplayer.\+I\+Media\+Player.\+pause (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Pauses the playback. 

Call timing\+: You can call this method either before or after joining a channel.

\begin{DoxyReturn}{Returns}

\begin{DoxyItemize}
\item 0\+: Success.
\item $<$ 0\+: Failure. 
\end{DoxyItemize}
\end{DoxyReturn}
\mbox{\Hypertarget{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_a96cfc3d9200e98724eb03476530e6025}\label{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_a96cfc3d9200e98724eb03476530e6025}} 
\index{io.agora.mediaplayer.IMediaPlayer@{io.agora.mediaplayer.IMediaPlayer}!stop@{stop}}
\index{stop@{stop}!io.agora.mediaplayer.IMediaPlayer@{io.agora.mediaplayer.IMediaPlayer}}
\doxysubsubsection{\texorpdfstring{stop()}{stop()}}
{\footnotesize\ttfamily int io.\+agora.\+mediaplayer.\+I\+Media\+Player.\+stop (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Stops playing the media track. 

After calling this method to stop playback, if you want to play again, you need to call {\ttfamily \mbox{\hyperlink{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_a17d627406558715c2cd06ee71b587432}{open(\+String url, long start\+Pos)}}} or {\ttfamily open\+With\+Media\+Source} to open the media resource. Call timing\+: Call this method after play.

\begin{DoxyReturn}{Returns}

\begin{DoxyItemize}
\item 0\+: Success.
\item $<$ 0\+: Failure. 
\end{DoxyItemize}
\end{DoxyReturn}


Implemented in \mbox{\hyperlink{interfaceio_1_1agora_1_1musiccontentcenter_1_1_i_agora_music_player_a1908d845c34b464a3531cc02ccc85b8d}{io.\+agora.\+musiccontentcenter.\+I\+Agora\+Music\+Player}}.

\mbox{\Hypertarget{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_ab13425b03bc85976ff277750485517ed}\label{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_ab13425b03bc85976ff277750485517ed}} 
\index{io.agora.mediaplayer.IMediaPlayer@{io.agora.mediaplayer.IMediaPlayer}!resume@{resume}}
\index{resume@{resume}!io.agora.mediaplayer.IMediaPlayer@{io.agora.mediaplayer.IMediaPlayer}}
\doxysubsubsection{\texorpdfstring{resume()}{resume()}}
{\footnotesize\ttfamily int io.\+agora.\+mediaplayer.\+I\+Media\+Player.\+resume (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Resumes playing the media file. 

\begin{DoxyReturn}{Returns}

\begin{DoxyItemize}
\item 0\+: Success.
\item $<$ 0\+: Failure. 
\end{DoxyItemize}
\end{DoxyReturn}
\mbox{\Hypertarget{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_a16450aef1b0ea88abe554c35d112a6e9}\label{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_a16450aef1b0ea88abe554c35d112a6e9}} 
\index{io.agora.mediaplayer.IMediaPlayer@{io.agora.mediaplayer.IMediaPlayer}!seek@{seek}}
\index{seek@{seek}!io.agora.mediaplayer.IMediaPlayer@{io.agora.mediaplayer.IMediaPlayer}}
\doxysubsubsection{\texorpdfstring{seek()}{seek()}}
{\footnotesize\ttfamily int io.\+agora.\+mediaplayer.\+I\+Media\+Player.\+seek (\begin{DoxyParamCaption}\item[{long}]{new\+Pos }\end{DoxyParamCaption})}



Seeks to a new playback position. 


\begin{DoxyItemize}
\item If you call {\ttfamily seek} after the playback has completed (upon receiving callback {\ttfamily on\+Player\+State\+Changed} reporting playback status as P\+L\+A\+Y\+E\+R\+\_\+\+S\+T\+A\+T\+E\+\_\+\+P\+L\+A\+Y\+B\+A\+C\+K\+\_\+\+C\+O\+M\+P\+L\+E\+T\+ED or P\+L\+A\+Y\+E\+R\+\_\+\+S\+T\+A\+T\+E\+\_\+\+P\+L\+A\+Y\+B\+A\+C\+K\+\_\+\+A\+L\+L\+\_\+\+L\+O\+O\+P\+S\+\_\+\+C\+O\+M\+P\+L\+E\+T\+ED ), the S\+DK will play the media file from the specified position. At this point, you will receive callback {\ttfamily on\+Player\+State\+Changed} reporting playback status as P\+L\+A\+Y\+E\+R\+\_\+\+S\+T\+A\+T\+E\+\_\+\+P\+L\+A\+Y\+I\+NG.
\item If you call {\ttfamily seek} while the playback is paused, upon successful call of this method, the S\+DK will seek to the specified position. To resume playback, call {\ttfamily resume} or {\ttfamily play} . Call timing\+: You can call this method either before or after joining a channel. Related callbacks\+: After successfully calling this method, you will receive the {\ttfamily on\+Player\+Event} callback, reporting the result of the seek operation to the new playback position.
\end{DoxyItemize}


\begin{DoxyParams}{Parameters}
{\em new\+Pos} & The new playback position (ms).\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}

\begin{DoxyItemize}
\item 0\+: Success.
\item $<$ 0\+: Failure. 
\end{DoxyItemize}
\end{DoxyReturn}
\mbox{\Hypertarget{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_ab17c9dbb96d64de084397d36ac6087e5}\label{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_ab17c9dbb96d64de084397d36ac6087e5}} 
\index{io.agora.mediaplayer.IMediaPlayer@{io.agora.mediaplayer.IMediaPlayer}!setAudioPitch@{setAudioPitch}}
\index{setAudioPitch@{setAudioPitch}!io.agora.mediaplayer.IMediaPlayer@{io.agora.mediaplayer.IMediaPlayer}}
\doxysubsubsection{\texorpdfstring{setAudioPitch()}{setAudioPitch()}}
{\footnotesize\ttfamily int io.\+agora.\+mediaplayer.\+I\+Media\+Player.\+set\+Audio\+Pitch (\begin{DoxyParamCaption}\item[{int}]{pitch }\end{DoxyParamCaption})}



Sets the pitch of the current media resource. 

\begin{DoxyNote}{Note}
Call this method after calling {\ttfamily \mbox{\hyperlink{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_a17d627406558715c2cd06ee71b587432}{open(\+String url, long start\+Pos)}}}.
\end{DoxyNote}

\begin{DoxyParams}{Parameters}
{\em pitch} & Sets the pitch of the local music file by the chromatic scale. The default value is 0, which means keeping the original pitch. The value ranges from -\/12 to 12, and the pitch value between consecutive values is a chromatic value. The greater the absolute value of this parameter, the higher or lower the pitch of the local music file.\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}

\begin{DoxyItemize}
\item 0\+: Success.
\item $<$ 0\+: Failure. 
\end{DoxyItemize}
\end{DoxyReturn}
\mbox{\Hypertarget{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_acac05945b0a5844d741c409f383d9eba}\label{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_acac05945b0a5844d741c409f383d9eba}} 
\index{io.agora.mediaplayer.IMediaPlayer@{io.agora.mediaplayer.IMediaPlayer}!mute@{mute}}
\index{mute@{mute}!io.agora.mediaplayer.IMediaPlayer@{io.agora.mediaplayer.IMediaPlayer}}
\doxysubsubsection{\texorpdfstring{mute()}{mute()}}
{\footnotesize\ttfamily int io.\+agora.\+mediaplayer.\+I\+Media\+Player.\+mute (\begin{DoxyParamCaption}\item[{boolean}]{muted }\end{DoxyParamCaption})}



Sets whether to mute the media file. 

Call timing\+: You can call this method either before or after joining a channel.


\begin{DoxyParams}{Parameters}
{\em muted} & Whether to mute the media file\+:
\begin{DoxyItemize}
\item {\ttfamily true}\+: Mute the media file.
\item {\ttfamily false}\+: (Default) Unmute the media file.
\end{DoxyItemize}\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}

\begin{DoxyItemize}
\item 0\+: Success.
\item $<$ 0\+: Failure. 
\end{DoxyItemize}
\end{DoxyReturn}
\mbox{\Hypertarget{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_a365a0f64d2798de72898c9df1bd43695}\label{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_a365a0f64d2798de72898c9df1bd43695}} 
\index{io.agora.mediaplayer.IMediaPlayer@{io.agora.mediaplayer.IMediaPlayer}!getMute@{getMute}}
\index{getMute@{getMute}!io.agora.mediaplayer.IMediaPlayer@{io.agora.mediaplayer.IMediaPlayer}}
\doxysubsubsection{\texorpdfstring{getMute()}{getMute()}}
{\footnotesize\ttfamily boolean io.\+agora.\+mediaplayer.\+I\+Media\+Player.\+get\+Mute (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Reports whether the media resource is muted. 

\begin{DoxyReturn}{Returns}

\begin{DoxyItemize}
\item {\ttfamily true}\+: Reports whether the media resource is muted.
\item {\ttfamily false}\+: Reports whether the media resource is muted. 
\end{DoxyItemize}
\end{DoxyReturn}
\mbox{\Hypertarget{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_a73edc580de06fdbc6390ff01041ccd52}\label{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_a73edc580de06fdbc6390ff01041ccd52}} 
\index{io.agora.mediaplayer.IMediaPlayer@{io.agora.mediaplayer.IMediaPlayer}!adjustPlayoutVolume@{adjustPlayoutVolume}}
\index{adjustPlayoutVolume@{adjustPlayoutVolume}!io.agora.mediaplayer.IMediaPlayer@{io.agora.mediaplayer.IMediaPlayer}}
\doxysubsubsection{\texorpdfstring{adjustPlayoutVolume()}{adjustPlayoutVolume()}}
{\footnotesize\ttfamily int io.\+agora.\+mediaplayer.\+I\+Media\+Player.\+adjust\+Playout\+Volume (\begin{DoxyParamCaption}\item[{int}]{volume }\end{DoxyParamCaption})}



Adjusts the local playback volume. 

Call timing\+: This method can be called either before or after joining the channel.


\begin{DoxyParams}{Parameters}
{\em volume} & The local playback volume, which ranges from 0 to 100\+:
\begin{DoxyItemize}
\item 0\+: Mute.
\item 100\+: (Default) The original volume.
\end{DoxyItemize}\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}

\begin{DoxyItemize}
\item 0\+: Success.
\item $<$ 0\+: Failure. 
\end{DoxyItemize}
\end{DoxyReturn}
\mbox{\Hypertarget{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_a43a4a4b758bf058bc520dd9be90c2266}\label{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_a43a4a4b758bf058bc520dd9be90c2266}} 
\index{io.agora.mediaplayer.IMediaPlayer@{io.agora.mediaplayer.IMediaPlayer}!getPlayoutVolume@{getPlayoutVolume}}
\index{getPlayoutVolume@{getPlayoutVolume}!io.agora.mediaplayer.IMediaPlayer@{io.agora.mediaplayer.IMediaPlayer}}
\doxysubsubsection{\texorpdfstring{getPlayoutVolume()}{getPlayoutVolume()}}
{\footnotesize\ttfamily int io.\+agora.\+mediaplayer.\+I\+Media\+Player.\+get\+Playout\+Volume (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Gets the local playback volume. 

\begin{DoxyReturn}{Returns}
The local playback volume, which ranges from 0 to 100.
\begin{DoxyItemize}
\item 0\+: Mute.
\item 100\+: (Default) The original volume. 
\end{DoxyItemize}
\end{DoxyReturn}
\mbox{\Hypertarget{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_a37c8a3301ed6566e90a620a35e225a7a}\label{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_a37c8a3301ed6566e90a620a35e225a7a}} 
\index{io.agora.mediaplayer.IMediaPlayer@{io.agora.mediaplayer.IMediaPlayer}!getPlayPosition@{getPlayPosition}}
\index{getPlayPosition@{getPlayPosition}!io.agora.mediaplayer.IMediaPlayer@{io.agora.mediaplayer.IMediaPlayer}}
\doxysubsubsection{\texorpdfstring{getPlayPosition()}{getPlayPosition()}}
{\footnotesize\ttfamily long io.\+agora.\+mediaplayer.\+I\+Media\+Player.\+get\+Play\+Position (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Gets current local playback progress. 

\begin{DoxyReturn}{Returns}

\begin{DoxyItemize}
\item Returns the current playback progress (ms) if the call succeeds.
\item $<$ 0\+: Failure. See {\ttfamily Media\+Player\+Reason}. 
\end{DoxyItemize}
\end{DoxyReturn}
\mbox{\Hypertarget{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_a78be2e738d7c458ca49332ead63cfbd4}\label{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_a78be2e738d7c458ca49332ead63cfbd4}} 
\index{io.agora.mediaplayer.IMediaPlayer@{io.agora.mediaplayer.IMediaPlayer}!getDuration@{getDuration}}
\index{getDuration@{getDuration}!io.agora.mediaplayer.IMediaPlayer@{io.agora.mediaplayer.IMediaPlayer}}
\doxysubsubsection{\texorpdfstring{getDuration()}{getDuration()}}
{\footnotesize\ttfamily long io.\+agora.\+mediaplayer.\+I\+Media\+Player.\+get\+Duration (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Gets the duration of the media resource. 

\begin{DoxyReturn}{Returns}

\begin{DoxyItemize}
\item If the method call succeeds, the S\+DK returns the total duration(ms) of the media file.
\item $<$ 0\+: Failure. 
\end{DoxyItemize}
\end{DoxyReturn}
\mbox{\Hypertarget{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_a6d1787a033e062ec81d5a54697f53e73}\label{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_a6d1787a033e062ec81d5a54697f53e73}} 
\index{io.agora.mediaplayer.IMediaPlayer@{io.agora.mediaplayer.IMediaPlayer}!getAudioBufferDelay@{getAudioBufferDelay}}
\index{getAudioBufferDelay@{getAudioBufferDelay}!io.agora.mediaplayer.IMediaPlayer@{io.agora.mediaplayer.IMediaPlayer}}
\doxysubsubsection{\texorpdfstring{getAudioBufferDelay()}{getAudioBufferDelay()}}
{\footnotesize\ttfamily int io.\+agora.\+mediaplayer.\+I\+Media\+Player.\+get\+Audio\+Buffer\+Delay (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Gets the audio buffer delay when playing the media file. 

\begin{DoxyReturn}{Returns}
The audio buffer delay (ms), if the method call succeeds. $<$ 0\+: An error occurs. You can use Media\+Player\+Reason to check the reason. 
\end{DoxyReturn}
\mbox{\Hypertarget{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_ad056c286d21e25a2fce2c4366f89be4e}\label{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_ad056c286d21e25a2fce2c4366f89be4e}} 
\index{io.agora.mediaplayer.IMediaPlayer@{io.agora.mediaplayer.IMediaPlayer}!getState@{getState}}
\index{getState@{getState}!io.agora.mediaplayer.IMediaPlayer@{io.agora.mediaplayer.IMediaPlayer}}
\doxysubsubsection{\texorpdfstring{getState()}{getState()}}
{\footnotesize\ttfamily Constants.\+Media\+Player\+State io.\+agora.\+mediaplayer.\+I\+Media\+Player.\+get\+State (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Gets current playback state. 

\begin{DoxyReturn}{Returns}
The current playback state. See {\ttfamily Media\+Player\+State}. 
\end{DoxyReturn}
\mbox{\Hypertarget{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_a30a1826581d0601e9412ebe550b10675}\label{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_a30a1826581d0601e9412ebe550b10675}} 
\index{io.agora.mediaplayer.IMediaPlayer@{io.agora.mediaplayer.IMediaPlayer}!getStreamCount@{getStreamCount}}
\index{getStreamCount@{getStreamCount}!io.agora.mediaplayer.IMediaPlayer@{io.agora.mediaplayer.IMediaPlayer}}
\doxysubsubsection{\texorpdfstring{getStreamCount()}{getStreamCount()}}
{\footnotesize\ttfamily int io.\+agora.\+mediaplayer.\+I\+Media\+Player.\+get\+Stream\+Count (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Gets the number of the media streams in the media resource. 

\begin{DoxyNote}{Note}
Call this method after you call {\ttfamily \mbox{\hyperlink{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_a17d627406558715c2cd06ee71b587432}{open(\+String url, long start\+Pos)}}} and receive the {\ttfamily on\+Player\+State\+Changed} callback reporting the state {\ttfamily P\+L\+A\+Y\+E\+R\+\_\+\+S\+T\+A\+T\+E\+\_\+\+O\+P\+E\+N\+\_\+\+C\+O\+M\+P\+L\+E\+T\+ED}.
\end{DoxyNote}
\begin{DoxyReturn}{Returns}

\begin{DoxyItemize}
\item The number of the media streams in the media resource if the method call succeeds.
\item $<$ 0\+: Failure. See {\ttfamily Media\+Player\+Reason}. 
\end{DoxyItemize}
\end{DoxyReturn}
\mbox{\Hypertarget{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_adaf0d07e6b9cbb137b5200e772ca2960}\label{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_adaf0d07e6b9cbb137b5200e772ca2960}} 
\index{io.agora.mediaplayer.IMediaPlayer@{io.agora.mediaplayer.IMediaPlayer}!setView@{setView}}
\index{setView@{setView}!io.agora.mediaplayer.IMediaPlayer@{io.agora.mediaplayer.IMediaPlayer}}
\doxysubsubsection{\texorpdfstring{setView()}{setView()}}
{\footnotesize\ttfamily int io.\+agora.\+mediaplayer.\+I\+Media\+Player.\+set\+View (\begin{DoxyParamCaption}\item[{View}]{video\+View }\end{DoxyParamCaption})}



Sets the view. 

Call timing\+: You can call this method either before or after joining a channel.


\begin{DoxyParams}{Parameters}
{\em video\+View} & The render view.\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}

\begin{DoxyItemize}
\item 0\+: Success.
\item $<$ 0\+: Failure. 
\end{DoxyItemize}
\end{DoxyReturn}
\mbox{\Hypertarget{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_a544f0d651cb8a527e79a6ec06d5b1faa}\label{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_a544f0d651cb8a527e79a6ec06d5b1faa}} 
\index{io.agora.mediaplayer.IMediaPlayer@{io.agora.mediaplayer.IMediaPlayer}!setRenderMode@{setRenderMode}}
\index{setRenderMode@{setRenderMode}!io.agora.mediaplayer.IMediaPlayer@{io.agora.mediaplayer.IMediaPlayer}}
\doxysubsubsection{\texorpdfstring{setRenderMode()}{setRenderMode()}}
{\footnotesize\ttfamily int io.\+agora.\+mediaplayer.\+I\+Media\+Player.\+set\+Render\+Mode (\begin{DoxyParamCaption}\item[{int}]{mode }\end{DoxyParamCaption})}



Sets the render mode of the media player. 


\begin{DoxyParams}{Parameters}
{\em mode} & Sets the render mode of the view\+:
\begin{DoxyItemize}
\item R\+E\+N\+D\+E\+R\+\_\+\+M\+O\+D\+E\+\_\+\+H\+I\+D\+D\+EN (1)\+: Hidden mode. Uniformly scale the video until it fills the visible boundaries (cropped). One dimension of the video may have clipped contents.
\item R\+E\+N\+D\+E\+R\+\_\+\+M\+O\+D\+E\+\_\+\+F\+IT (2)\+: Fit mode. Uniformly scale the video until one of its dimension fits the boundary (zoomed to fit). Areas that are not filled due to the disparity in the aspect ratio are filled with black.
\item R\+E\+N\+D\+E\+R\+\_\+\+M\+O\+D\+E\+\_\+\+A\+D\+A\+P\+T\+I\+VE (3)\+: Adaptive mode. Deprecated\+: This enumerator is deprecated and not recommended for use.
\end{DoxyItemize}\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}

\begin{DoxyItemize}
\item 0\+: Success.
\item $<$ 0\+: Failure. 
\end{DoxyItemize}
\end{DoxyReturn}
\mbox{\Hypertarget{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_a591a95e9b6809389b54431d3a6ff60af}\label{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_a591a95e9b6809389b54431d3a6ff60af}} 
\index{io.agora.mediaplayer.IMediaPlayer@{io.agora.mediaplayer.IMediaPlayer}!getStreamInfo@{getStreamInfo}}
\index{getStreamInfo@{getStreamInfo}!io.agora.mediaplayer.IMediaPlayer@{io.agora.mediaplayer.IMediaPlayer}}
\doxysubsubsection{\texorpdfstring{getStreamInfo()}{getStreamInfo()}}
{\footnotesize\ttfamily \mbox{\hyperlink{classio_1_1agora_1_1mediaplayer_1_1data_1_1_media_stream_info}{Media\+Stream\+Info}} io.\+agora.\+mediaplayer.\+I\+Media\+Player.\+get\+Stream\+Info (\begin{DoxyParamCaption}\item[{int}]{index }\end{DoxyParamCaption})}



Gets the detailed information of the media stream. 

Call timing\+: Call this method after calling {\ttfamily get\+Stream\+Count}.


\begin{DoxyParams}{Parameters}
{\em index} & The index of the media stream. This parameter must be less than the return value of {\ttfamily get\+Stream\+Count}.\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}

\begin{DoxyItemize}
\item If the call succeeds, returns the detailed information of the media stream. See {\ttfamily Media\+Stream\+Info}.
\item {\ttfamily N\+U\+LL} is returned, if the method call fails. 
\end{DoxyItemize}
\end{DoxyReturn}
\mbox{\Hypertarget{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_aca0b9a1194cc2deced426da7d224dcbf}\label{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_aca0b9a1194cc2deced426da7d224dcbf}} 
\index{io.agora.mediaplayer.IMediaPlayer@{io.agora.mediaplayer.IMediaPlayer}!setLoopCount@{setLoopCount}}
\index{setLoopCount@{setLoopCount}!io.agora.mediaplayer.IMediaPlayer@{io.agora.mediaplayer.IMediaPlayer}}
\doxysubsubsection{\texorpdfstring{setLoopCount()}{setLoopCount()}}
{\footnotesize\ttfamily int io.\+agora.\+mediaplayer.\+I\+Media\+Player.\+set\+Loop\+Count (\begin{DoxyParamCaption}\item[{int}]{loop\+Count }\end{DoxyParamCaption})}



Sets the loop playback. 

If you want to loop, call this method and set the number of the loops. When the loop finishes, the S\+DK triggers {\ttfamily on\+Player\+State\+Changed} and reports the playback state as P\+L\+A\+Y\+E\+R\+\_\+\+S\+T\+A\+T\+E\+\_\+\+P\+L\+A\+Y\+B\+A\+C\+K\+\_\+\+A\+L\+L\+\_\+\+L\+O\+O\+P\+S\+\_\+\+C\+O\+M\+P\+L\+E\+T\+ED.


\begin{DoxyParams}{Parameters}
{\em loop\+Count} & The number of times the audio effect loops\+:
\begin{DoxyItemize}
\item ≥ 0\+: Number of times for playing. For example, setting it to 0 means no loop playback, playing only once; setting it to 1 means loop playback once, playing a total of twice.
\item -\/1\+: Play the audio file in an infinite loop.
\end{DoxyItemize}\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}

\begin{DoxyItemize}
\item 0\+: Success.
\item $<$ 0\+: Failure. 
\end{DoxyItemize}
\end{DoxyReturn}
\mbox{\Hypertarget{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_ab5db207de74fe4db97df71e106c39673}\label{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_ab5db207de74fe4db97df71e106c39673}} 
\index{io.agora.mediaplayer.IMediaPlayer@{io.agora.mediaplayer.IMediaPlayer}!setPlaybackSpeed@{setPlaybackSpeed}}
\index{setPlaybackSpeed@{setPlaybackSpeed}!io.agora.mediaplayer.IMediaPlayer@{io.agora.mediaplayer.IMediaPlayer}}
\doxysubsubsection{\texorpdfstring{setPlaybackSpeed()}{setPlaybackSpeed()}}
{\footnotesize\ttfamily int io.\+agora.\+mediaplayer.\+I\+Media\+Player.\+set\+Playback\+Speed (\begin{DoxyParamCaption}\item[{int}]{speed }\end{DoxyParamCaption})}



Sets the channel mode of the current audio file. 

Call this method after calling {\ttfamily \mbox{\hyperlink{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_a17d627406558715c2cd06ee71b587432}{open(\+String url, long start\+Pos)}}}.


\begin{DoxyParams}{Parameters}
{\em speed} & The playback speed. Agora recommends that you set this to a value between 30 and 400, defined as follows\+:
\begin{DoxyItemize}
\item 30\+: 0.\+3 times the original speed.
\item 100\+: The original speed.
\item 400\+: 4 times the original speed.
\end{DoxyItemize}\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}

\begin{DoxyItemize}
\item 0\+: Success.
\item $<$ 0\+: Failure. 
\end{DoxyItemize}
\end{DoxyReturn}
\mbox{\Hypertarget{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_a1970a14e6ade9dbd2d90a98ff95ec9c2}\label{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_a1970a14e6ade9dbd2d90a98ff95ec9c2}} 
\index{io.agora.mediaplayer.IMediaPlayer@{io.agora.mediaplayer.IMediaPlayer}!selectAudioTrack@{selectAudioTrack}}
\index{selectAudioTrack@{selectAudioTrack}!io.agora.mediaplayer.IMediaPlayer@{io.agora.mediaplayer.IMediaPlayer}}
\doxysubsubsection{\texorpdfstring{selectAudioTrack()}{selectAudioTrack()}}
{\footnotesize\ttfamily int io.\+agora.\+mediaplayer.\+I\+Media\+Player.\+select\+Audio\+Track (\begin{DoxyParamCaption}\item[{int}]{index }\end{DoxyParamCaption})}



Selects the audio track used during playback. 

After getting the track index of the audio file, you can call this method to specify any track to play. For example, if different tracks of a multi-\/track file store songs in different languages, you can call this method to set the playback language.

\begin{DoxyNote}{Note}
You need to call this method after calling {\ttfamily get\+Stream\+Info} to get the audio stream index value.
\end{DoxyNote}

\begin{DoxyParams}{Parameters}
{\em index} & The index of the audio track.\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}

\begin{DoxyItemize}
\item 0\+: Success.
\item $<$ 0\+: Failure. 
\end{DoxyItemize}
\end{DoxyReturn}
\mbox{\Hypertarget{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_a4bfb9c48624deff2870fbac32b6a0a1f}\label{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_a4bfb9c48624deff2870fbac32b6a0a1f}} 
\index{io.agora.mediaplayer.IMediaPlayer@{io.agora.mediaplayer.IMediaPlayer}!selectMultiAudioTrack@{selectMultiAudioTrack}}
\index{selectMultiAudioTrack@{selectMultiAudioTrack}!io.agora.mediaplayer.IMediaPlayer@{io.agora.mediaplayer.IMediaPlayer}}
\doxysubsubsection{\texorpdfstring{selectMultiAudioTrack()}{selectMultiAudioTrack()}}
{\footnotesize\ttfamily int io.\+agora.\+mediaplayer.\+I\+Media\+Player.\+select\+Multi\+Audio\+Track (\begin{DoxyParamCaption}\item[{int}]{playout\+Track\+Index,  }\item[{int}]{publish\+Track\+Index }\end{DoxyParamCaption})}



Selects the audio tracks that you want to play on your local device and publish to the channel respectively. 

You can call this method to determine the audio track to be played on your local device and published to the channel. Before calling this method, you need to open the media file with the {\ttfamily open\+With\+Media\+Source} method and set {\ttfamily enable\+Multi\+Audio\+Track} in {\ttfamily Media\+Player\+Source} as {\ttfamily true}. Applicable scenarios\+: For example, in K\+TV scenarios, the host can choose to play the original sound locally and publish the accompaniment track to the channel.


\begin{DoxyParams}{Parameters}
{\em playout\+Track\+Index} & The index of audio tracks for local playback. You can obtain the index through {\ttfamily get\+Stream\+Info}. \\
\hline
{\em publish\+Track\+Index} & The index of audio tracks to be published in the channel. You can obtain the index through {\ttfamily get\+Stream\+Info}.\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}

\begin{DoxyItemize}
\item 0\+: Success.
\item $<$ 0\+: Failure. 
\end{DoxyItemize}
\end{DoxyReturn}
\mbox{\Hypertarget{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_a3efe90d1d32eb32e4dc62d5d20d83839}\label{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_a3efe90d1d32eb32e4dc62d5d20d83839}} 
\index{io.agora.mediaplayer.IMediaPlayer@{io.agora.mediaplayer.IMediaPlayer}!setPlayerOption@{setPlayerOption}}
\index{setPlayerOption@{setPlayerOption}!io.agora.mediaplayer.IMediaPlayer@{io.agora.mediaplayer.IMediaPlayer}}
\doxysubsubsection{\texorpdfstring{setPlayerOption()}{setPlayerOption()}}
{\footnotesize\ttfamily int io.\+agora.\+mediaplayer.\+I\+Media\+Player.\+set\+Player\+Option (\begin{DoxyParamCaption}\item[{String}]{key,  }\item[{int}]{value }\end{DoxyParamCaption})}



Sets media player options. 

The media player supports setting options through {\ttfamily key} and {\ttfamily value}. The difference between this method and {\ttfamily set\+Player\+Option\+String} is that the {\ttfamily value} parameter of this method is of type Int, while the {\ttfamily value} of {\ttfamily set\+Player\+Option\+String} is of type String. These two methods cannot be used together. Applicable scenarios\+: Scenarios that require technical previews or special customization features. In general, you do not need to call this method; you can simply use the default options provided by the media player. Call timing\+: Call this method before the {\ttfamily \mbox{\hyperlink{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_a17d627406558715c2cd06ee71b587432}{open(\+String url, long start\+Pos)}}} or {\ttfamily open\+With\+Media\+Source} method.


\begin{DoxyParams}{Parameters}
{\em key} & The key of the option. \\
\hline
{\em value} & The value of the key.\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}

\begin{DoxyItemize}
\item 0\+: Success.
\item $<$ 0\+: Failure. 
\end{DoxyItemize}
\end{DoxyReturn}
\mbox{\Hypertarget{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_ab1e57491b900f849778f98d3e116cfc2}\label{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_ab1e57491b900f849778f98d3e116cfc2}} 
\index{io.agora.mediaplayer.IMediaPlayer@{io.agora.mediaplayer.IMediaPlayer}!setPlayerOptionString@{setPlayerOptionString}}
\index{setPlayerOptionString@{setPlayerOptionString}!io.agora.mediaplayer.IMediaPlayer@{io.agora.mediaplayer.IMediaPlayer}}
\doxysubsubsection{\texorpdfstring{setPlayerOptionString()}{setPlayerOptionString()}}
{\footnotesize\ttfamily int io.\+agora.\+mediaplayer.\+I\+Media\+Player.\+set\+Player\+Option\+String (\begin{DoxyParamCaption}\item[{String}]{key,  }\item[{String}]{value }\end{DoxyParamCaption})}



Sets media player options. 

The media player supports setting options through {\ttfamily key} and {\ttfamily value}. The difference between this method and {\ttfamily set\+Player\+Option} is that the {\ttfamily value} parameter of this method is of type String, while the {\ttfamily value} of {\ttfamily set\+Player\+Option} is of type String. These two methods cannot be used together. Applicable scenarios\+: Scenarios that require technical previews or special customization features. In general, you do not need to call this method; you can simply use the default options provided by the media player. Call timing\+: Call this method before the {\ttfamily open(String url, long start\+Pos)} or {\ttfamily open\+With\+Media\+Source} method.


\begin{DoxyParams}{Parameters}
{\em key} & The key of the option. \\
\hline
{\em value} & The value of the key.\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}

\begin{DoxyItemize}
\item 0\+: Success.
\item $<$ 0\+: Failure. 
\end{DoxyItemize}
\end{DoxyReturn}
\mbox{\Hypertarget{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_afa15aa236644ccee137da4f61509fae8}\label{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_afa15aa236644ccee137da4f61509fae8}} 
\index{io.agora.mediaplayer.IMediaPlayer@{io.agora.mediaplayer.IMediaPlayer}!takeScreenshot@{takeScreenshot}}
\index{takeScreenshot@{takeScreenshot}!io.agora.mediaplayer.IMediaPlayer@{io.agora.mediaplayer.IMediaPlayer}}
\doxysubsubsection{\texorpdfstring{takeScreenshot()}{takeScreenshot()}}
{\footnotesize\ttfamily int io.\+agora.\+mediaplayer.\+I\+Media\+Player.\+take\+Screenshot (\begin{DoxyParamCaption}\item[{String}]{filename }\end{DoxyParamCaption})}

take screenshot while playing video 
\begin{DoxyParams}{Parameters}
{\em filename} & the filename of screenshot file \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}

\begin{DoxyItemize}
\item 0\+: Success.
\item $<$ 0\+: Failure. 
\end{DoxyItemize}
\end{DoxyReturn}
\mbox{\Hypertarget{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_acf4fca2eb27b9d383d46360f846820cd}\label{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_acf4fca2eb27b9d383d46360f846820cd}} 
\index{io.agora.mediaplayer.IMediaPlayer@{io.agora.mediaplayer.IMediaPlayer}!selectInternalSubtitle@{selectInternalSubtitle}}
\index{selectInternalSubtitle@{selectInternalSubtitle}!io.agora.mediaplayer.IMediaPlayer@{io.agora.mediaplayer.IMediaPlayer}}
\doxysubsubsection{\texorpdfstring{selectInternalSubtitle()}{selectInternalSubtitle()}}
{\footnotesize\ttfamily int io.\+agora.\+mediaplayer.\+I\+Media\+Player.\+select\+Internal\+Subtitle (\begin{DoxyParamCaption}\item[{int}]{index }\end{DoxyParamCaption})}

select internal subtitles in video 
\begin{DoxyParams}{Parameters}
{\em index} & the index of the internal subtitles \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}

\begin{DoxyItemize}
\item 0\+: Success.
\item $<$ 0\+: Failure. 
\end{DoxyItemize}
\end{DoxyReturn}
\mbox{\Hypertarget{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_aafc71406711332a6d64a5ac2b38d0a31}\label{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_aafc71406711332a6d64a5ac2b38d0a31}} 
\index{io.agora.mediaplayer.IMediaPlayer@{io.agora.mediaplayer.IMediaPlayer}!setExternalSubtitle@{setExternalSubtitle}}
\index{setExternalSubtitle@{setExternalSubtitle}!io.agora.mediaplayer.IMediaPlayer@{io.agora.mediaplayer.IMediaPlayer}}
\doxysubsubsection{\texorpdfstring{setExternalSubtitle()}{setExternalSubtitle()}}
{\footnotesize\ttfamily int io.\+agora.\+mediaplayer.\+I\+Media\+Player.\+set\+External\+Subtitle (\begin{DoxyParamCaption}\item[{String}]{url }\end{DoxyParamCaption})}

set an external subtitle for video 
\begin{DoxyParams}{Parameters}
{\em url} & The U\+RL of the subtitle file that you want to load. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}

\begin{DoxyItemize}
\item 0\+: Success.
\item $<$ 0\+: Failure. 
\end{DoxyItemize}
\end{DoxyReturn}
\mbox{\Hypertarget{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_a68a2bc92b2f0dbcb91ab1728a8e7e35c}\label{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_a68a2bc92b2f0dbcb91ab1728a8e7e35c}} 
\index{io.agora.mediaplayer.IMediaPlayer@{io.agora.mediaplayer.IMediaPlayer}!adjustPublishSignalVolume@{adjustPublishSignalVolume}}
\index{adjustPublishSignalVolume@{adjustPublishSignalVolume}!io.agora.mediaplayer.IMediaPlayer@{io.agora.mediaplayer.IMediaPlayer}}
\doxysubsubsection{\texorpdfstring{adjustPublishSignalVolume()}{adjustPublishSignalVolume()}}
{\footnotesize\ttfamily int io.\+agora.\+mediaplayer.\+I\+Media\+Player.\+adjust\+Publish\+Signal\+Volume (\begin{DoxyParamCaption}\item[{int}]{volume }\end{DoxyParamCaption})}



Adjusts the volume of the media file for publishing. 

After connected to the Agora server, you can call this method to adjust the volume of the media file heard by the remote user. Call timing\+: This method can be called either before or after joining the channel.


\begin{DoxyParams}{Parameters}
{\em volume} & The volume, which ranges from 0 to 400\+:
\begin{DoxyItemize}
\item 0\+: Mute.
\item 100\+: (Default) The original volume.
\item 400\+: Four times the original volume (amplifying the audio signals by four times).
\end{DoxyItemize}\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}

\begin{DoxyItemize}
\item 0\+: Success.
\item $<$ 0\+: Failure. 
\end{DoxyItemize}
\end{DoxyReturn}
\mbox{\Hypertarget{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_a1a7a3d718a92ec5b7df1473e8b6fd3b5}\label{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_a1a7a3d718a92ec5b7df1473e8b6fd3b5}} 
\index{io.agora.mediaplayer.IMediaPlayer@{io.agora.mediaplayer.IMediaPlayer}!getPublishSignalVolume@{getPublishSignalVolume}}
\index{getPublishSignalVolume@{getPublishSignalVolume}!io.agora.mediaplayer.IMediaPlayer@{io.agora.mediaplayer.IMediaPlayer}}
\doxysubsubsection{\texorpdfstring{getPublishSignalVolume()}{getPublishSignalVolume()}}
{\footnotesize\ttfamily int io.\+agora.\+mediaplayer.\+I\+Media\+Player.\+get\+Publish\+Signal\+Volume (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Gets the volume of the media file for publishing. 

\begin{DoxyReturn}{Returns}

\begin{DoxyItemize}
\item ≥ 0\+: The remote playback volume.
\item $<$ 0\+: Failure. 
\end{DoxyItemize}
\end{DoxyReturn}
\mbox{\Hypertarget{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_ae38ff4b5ee5a2582e9e6e04087c14433}\label{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_ae38ff4b5ee5a2582e9e6e04087c14433}} 
\index{io.agora.mediaplayer.IMediaPlayer@{io.agora.mediaplayer.IMediaPlayer}!getPlaySrc@{getPlaySrc}}
\index{getPlaySrc@{getPlaySrc}!io.agora.mediaplayer.IMediaPlayer@{io.agora.mediaplayer.IMediaPlayer}}
\doxysubsubsection{\texorpdfstring{getPlaySrc()}{getPlaySrc()}}
{\footnotesize\ttfamily String io.\+agora.\+mediaplayer.\+I\+Media\+Player.\+get\+Play\+Src (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Gets the path of the media resource being played. 

\begin{DoxyReturn}{Returns}
The path of the media resource being played. 
\end{DoxyReturn}


Implemented in \mbox{\hyperlink{interfaceio_1_1agora_1_1musiccontentcenter_1_1_i_agora_music_player_af3e3f9bec20134445a680dd2e91fa241}{io.\+agora.\+musiccontentcenter.\+I\+Agora\+Music\+Player}}.

\mbox{\Hypertarget{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_aeb4637d26df2f6c8ce5c56e3ab6d5bf8}\label{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_aeb4637d26df2f6c8ce5c56e3ab6d5bf8}} 
\index{io.agora.mediaplayer.IMediaPlayer@{io.agora.mediaplayer.IMediaPlayer}!switchSrc@{switchSrc}}
\index{switchSrc@{switchSrc}!io.agora.mediaplayer.IMediaPlayer@{io.agora.mediaplayer.IMediaPlayer}}
\doxysubsubsection{\texorpdfstring{switchSrc()}{switchSrc()}}
{\footnotesize\ttfamily int io.\+agora.\+mediaplayer.\+I\+Media\+Player.\+switch\+Src (\begin{DoxyParamCaption}\item[{String}]{src,  }\item[{boolean}]{sync\+Pts }\end{DoxyParamCaption})}



Switches the media resource being played. 

You can call this method to switch the media resource to be played according to the current network status. For example\+:
\begin{DoxyItemize}
\item When the network is poor, the media resource to be played is switched to a media resource address with a lower bitrate.
\item When the network is good, the media resource to be played is switched to a media resource address with a higher bitrate. After calling this method, if you receive the {\ttfamily on\+Player\+Event} callback report the {\ttfamily P\+L\+A\+Y\+E\+R\+\_\+\+E\+V\+E\+N\+T\+\_\+\+S\+W\+I\+T\+C\+H\+\_\+\+C\+O\+M\+P\+L\+E\+TE} event, the switching is successful. If the switching fails, the S\+DK will automatically retry 3 times. If it still fails, you will receive the {\ttfamily on\+Player\+Event} callback reporting the {\ttfamily P\+L\+A\+Y\+E\+R\+\_\+\+E\+V\+E\+N\+T\+\_\+\+S\+W\+I\+T\+C\+H\+\_\+\+E\+R\+R\+OR} event indicating an error occurred during media resource switching.
\end{DoxyItemize}

\begin{DoxyNote}{Note}

\begin{DoxyItemize}
\item Ensure that you call this method after {\ttfamily \mbox{\hyperlink{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_a17d627406558715c2cd06ee71b587432}{open(\+String url, long start\+Pos)}}}.
\item To ensure normal playback, pay attention to the following when calling this method\+:
\begin{DoxyItemize}
\item Do not call this method when playback is paused.
\item Do not call the {\ttfamily seek} method during switching.
\item Before switching the media resource, make sure that the playback position does not exceed the total duration of the media resource to be switched.
\end{DoxyItemize}
\end{DoxyItemize}
\end{DoxyNote}

\begin{DoxyParams}{Parameters}
{\em src} & The U\+RL of the media resource. \\
\hline
{\em sync\+Pts} & Whether to synchronize the playback position (ms) before and after the switch\+:
\begin{DoxyItemize}
\item {\ttfamily true}\+: Synchronize the playback position before and after the switch.
\item {\ttfamily false}\+: (Default) Do not synchronize the playback position before and after the switch.
\end{DoxyItemize}\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}

\begin{DoxyItemize}
\item 0\+: Success.
\item $<$ 0\+: Failure. 
\end{DoxyItemize}
\end{DoxyReturn}
\mbox{\Hypertarget{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_ad4635aae425badaf12d42162dbd9732c}\label{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_ad4635aae425badaf12d42162dbd9732c}} 
\index{io.agora.mediaplayer.IMediaPlayer@{io.agora.mediaplayer.IMediaPlayer}!preloadSrc@{preloadSrc}}
\index{preloadSrc@{preloadSrc}!io.agora.mediaplayer.IMediaPlayer@{io.agora.mediaplayer.IMediaPlayer}}
\doxysubsubsection{\texorpdfstring{preloadSrc()}{preloadSrc()}}
{\footnotesize\ttfamily int io.\+agora.\+mediaplayer.\+I\+Media\+Player.\+preload\+Src (\begin{DoxyParamCaption}\item[{String}]{src,  }\item[{long}]{start\+Pos }\end{DoxyParamCaption})}



Preloads a media resource. 

You can call this method to preload a media resource into the playlist. If you need to preload multiple media resources, you can call this method multiple times. After calling this method, if you receive the {\ttfamily P\+L\+A\+Y\+E\+R\+\_\+\+P\+R\+E\+L\+O\+A\+D\+\_\+\+E\+V\+E\+N\+T\+\_\+\+C\+O\+M\+P\+L\+E\+TE} event in the {\ttfamily on\+Preload\+Event} callback, the preload is successful; If you receive the {\ttfamily P\+L\+A\+Y\+E\+R\+\_\+\+P\+R\+E\+L\+O\+A\+D\+\_\+\+E\+V\+E\+N\+T\+\_\+\+E\+R\+R\+OR} event in the {\ttfamily on\+Preload\+Event} callback, the preload fails. If the preload is successful and you want to play the media resource, call {\ttfamily play\+Preloaded\+Src}; if you want to clear the playlist, call {\ttfamily \mbox{\hyperlink{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_a96cfc3d9200e98724eb03476530e6025}{stop()}}}.

\begin{DoxyNote}{Note}

\begin{DoxyItemize}
\item Before calling this method, ensure that you have called {\ttfamily \mbox{\hyperlink{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_a17d627406558715c2cd06ee71b587432}{open(\+String url, long start\+Pos)}}} or {\ttfamily open\+With\+Media\+Source} to open the media resource successfully.
\item Agora does not support preloading duplicate media resources to the playlist. However, you can preload the media resources that are being played to the playlist again.
\end{DoxyItemize}
\end{DoxyNote}

\begin{DoxyParams}{Parameters}
{\em src} & The U\+RL of the media resource. \\
\hline
{\em start\+Pos} & The starting position (ms) for playing after the media resource is preloaded to the playlist. When preloading a live stream, set this parameter to 0.\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}

\begin{DoxyItemize}
\item 0\+: Success.
\item $<$ 0\+: Failure. 
\end{DoxyItemize}
\end{DoxyReturn}
\mbox{\Hypertarget{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_a61e14cf182848ed533dd92bedfbe5604}\label{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_a61e14cf182848ed533dd92bedfbe5604}} 
\index{io.agora.mediaplayer.IMediaPlayer@{io.agora.mediaplayer.IMediaPlayer}!playPreloadedSrc@{playPreloadedSrc}}
\index{playPreloadedSrc@{playPreloadedSrc}!io.agora.mediaplayer.IMediaPlayer@{io.agora.mediaplayer.IMediaPlayer}}
\doxysubsubsection{\texorpdfstring{playPreloadedSrc()}{playPreloadedSrc()}}
{\footnotesize\ttfamily int io.\+agora.\+mediaplayer.\+I\+Media\+Player.\+play\+Preloaded\+Src (\begin{DoxyParamCaption}\item[{String}]{src }\end{DoxyParamCaption})}



Plays preloaded media resources. 

After calling the {\ttfamily preload\+Src} method to preload the media resource into the playlist, you can call this method to play the preloaded media resource. After calling this method, if you receive the {\ttfamily on\+Player\+State\+Changed} callback which reports the {\ttfamily P\+L\+A\+Y\+E\+R\+\_\+\+S\+T\+A\+T\+E\+\_\+\+P\+L\+A\+Y\+I\+NG} state, the playback is successful. If you want to change the preloaded media resource to be played, you can call this method again and specify the U\+RL of the new media resource that you want to preload. If you want to replay the media resource, you need to call {\ttfamily preload\+Src} to preload the media resource to the playlist again before playing. If you want to clear the playlist, call the {\ttfamily \mbox{\hyperlink{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_a96cfc3d9200e98724eb03476530e6025}{stop()}}} method.

\begin{DoxyNote}{Note}
If you call this method when playback is paused, this method does not take effect until playback is resumed.
\end{DoxyNote}

\begin{DoxyParams}{Parameters}
{\em src} & The U\+RL of the media resource in the playlist must be consistent with the {\ttfamily src} set by the {\ttfamily preload\+Src} method; otherwise, the media resource cannot be played.\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}

\begin{DoxyItemize}
\item 0\+: Success.
\item $<$ 0\+: Failure. 
\end{DoxyItemize}
\end{DoxyReturn}
\mbox{\Hypertarget{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_acebd1ca5d03dc435d1bfbab6665290b1}\label{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_acebd1ca5d03dc435d1bfbab6665290b1}} 
\index{io.agora.mediaplayer.IMediaPlayer@{io.agora.mediaplayer.IMediaPlayer}!unloadSrc@{unloadSrc}}
\index{unloadSrc@{unloadSrc}!io.agora.mediaplayer.IMediaPlayer@{io.agora.mediaplayer.IMediaPlayer}}
\doxysubsubsection{\texorpdfstring{unloadSrc()}{unloadSrc()}}
{\footnotesize\ttfamily int io.\+agora.\+mediaplayer.\+I\+Media\+Player.\+unload\+Src (\begin{DoxyParamCaption}\item[{String}]{src }\end{DoxyParamCaption})}



Unloads media resources that are preloaded. 

\begin{DoxyNote}{Note}
This method cannot release the media resource being played.
\end{DoxyNote}

\begin{DoxyParams}{Parameters}
{\em src} & The U\+RL of the media resource.\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}

\begin{DoxyItemize}
\item 0\+: Success.
\item $<$ 0\+: Failure. 
\end{DoxyItemize}
\end{DoxyReturn}
\mbox{\Hypertarget{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_a7b0e840af73b95213d42e155c20a5e0e}\label{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_a7b0e840af73b95213d42e155c20a5e0e}} 
\index{io.agora.mediaplayer.IMediaPlayer@{io.agora.mediaplayer.IMediaPlayer}!destroy@{destroy}}
\index{destroy@{destroy}!io.agora.mediaplayer.IMediaPlayer@{io.agora.mediaplayer.IMediaPlayer}}
\doxysubsubsection{\texorpdfstring{destroy()}{destroy()}}
{\footnotesize\ttfamily int io.\+agora.\+mediaplayer.\+I\+Media\+Player.\+destroy (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Destroys the media player instance. 

\begin{DoxyReturn}{Returns}

\begin{DoxyItemize}
\item ≥ 0\+: Success. Returns the ID of media player instance.
\item $<$ 0\+: Failure. 
\end{DoxyItemize}
\end{DoxyReturn}


Implemented in \mbox{\hyperlink{interfaceio_1_1agora_1_1musiccontentcenter_1_1_i_agora_music_player_a517b16cb2a82ba4029f83a65bbbb33d0}{io.\+agora.\+musiccontentcenter.\+I\+Agora\+Music\+Player}}.

\mbox{\Hypertarget{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_a6af7f2ea9f2776553790547f7502cfdc}\label{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_a6af7f2ea9f2776553790547f7502cfdc}} 
\index{io.agora.mediaplayer.IMediaPlayer@{io.agora.mediaplayer.IMediaPlayer}!registerPlayerObserver@{registerPlayerObserver}}
\index{registerPlayerObserver@{registerPlayerObserver}!io.agora.mediaplayer.IMediaPlayer@{io.agora.mediaplayer.IMediaPlayer}}
\doxysubsubsection{\texorpdfstring{registerPlayerObserver()}{registerPlayerObserver()}}
{\footnotesize\ttfamily int io.\+agora.\+mediaplayer.\+I\+Media\+Player.\+register\+Player\+Observer (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_observer}{I\+Media\+Player\+Observer}}}]{player\+Observer }\end{DoxyParamCaption})}



Registers a media player observer. 

Call timing\+: This method can be called either before or after joining the channel.


\begin{DoxyParams}{Parameters}
{\em player\+Observer} & The player observer, listening for events during the playback. See {\ttfamily \mbox{\hyperlink{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_observer}{I\+Media\+Player\+Observer}}}.\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}

\begin{DoxyItemize}
\item 0\+: Success.
\item $<$ 0\+: Failure. 
\end{DoxyItemize}
\end{DoxyReturn}
\mbox{\Hypertarget{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_a5abeb9a3912f887d510d2d13ec375330}\label{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_a5abeb9a3912f887d510d2d13ec375330}} 
\index{io.agora.mediaplayer.IMediaPlayer@{io.agora.mediaplayer.IMediaPlayer}!unRegisterPlayerObserver@{unRegisterPlayerObserver}}
\index{unRegisterPlayerObserver@{unRegisterPlayerObserver}!io.agora.mediaplayer.IMediaPlayer@{io.agora.mediaplayer.IMediaPlayer}}
\doxysubsubsection{\texorpdfstring{unRegisterPlayerObserver()}{unRegisterPlayerObserver()}}
{\footnotesize\ttfamily int io.\+agora.\+mediaplayer.\+I\+Media\+Player.\+un\+Register\+Player\+Observer (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_observer}{I\+Media\+Player\+Observer}}}]{player\+Observer }\end{DoxyParamCaption})}



Releases a media player observer. 


\begin{DoxyParams}{Parameters}
{\em player\+Observer} & The player observer, listening for events during the playback. See {\ttfamily \mbox{\hyperlink{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_observer}{I\+Media\+Player\+Observer}}}.\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}

\begin{DoxyItemize}
\item 0\+: Success.
\item $<$ 0\+: Failure. 
\end{DoxyItemize}
\end{DoxyReturn}
\mbox{\Hypertarget{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_acb1b52a72ca3d0c9373885ebed458b37}\label{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_acb1b52a72ca3d0c9373885ebed458b37}} 
\index{io.agora.mediaplayer.IMediaPlayer@{io.agora.mediaplayer.IMediaPlayer}!registerAudioFrameObserver@{registerAudioFrameObserver}}
\index{registerAudioFrameObserver@{registerAudioFrameObserver}!io.agora.mediaplayer.IMediaPlayer@{io.agora.mediaplayer.IMediaPlayer}}
\doxysubsubsection{\texorpdfstring{registerAudioFrameObserver()}{registerAudioFrameObserver()}}
{\footnotesize\ttfamily int io.\+agora.\+mediaplayer.\+I\+Media\+Player.\+register\+Audio\+Frame\+Observer (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_audio_frame_observer}{I\+Media\+Player\+Audio\+Frame\+Observer}}}]{audio\+Frame\+Observer,  }\item[{int}]{mode }\end{DoxyParamCaption})}



Registers an audio frame observer object. 


\begin{DoxyParams}{Parameters}
{\em audio\+Frame\+Observer} & The audio frame observer, reporting the reception of each audio frame. See {\ttfamily \mbox{\hyperlink{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_audio_frame_observer}{I\+Media\+Player\+Audio\+Frame\+Observer}}}. \\
\hline
{\em mode} & The use mode of the audio frame\+:
\begin{DoxyItemize}
\item R\+A\+W\+\_\+\+A\+U\+D\+I\+O\+\_\+\+F\+R\+A\+M\+E\+\_\+\+O\+P\+\_\+\+M\+O\+D\+E\+\_\+\+R\+E\+A\+D\+\_\+\+O\+N\+LY (0)\+: (Default) Read only mode. For example, when users acquire the data with the Agora S\+DK, then push the R\+T\+MP or R\+T\+M\+PS streams.
\item R\+A\+W\+\_\+\+A\+U\+D\+I\+O\+\_\+\+F\+R\+A\+M\+E\+\_\+\+O\+P\+\_\+\+M\+O\+D\+E\+\_\+\+R\+E\+A\+D\+\_\+\+W\+R\+I\+TE (2)\+: Read and write mode\+: Users read the data from Audio\+Frame, modify it, and then play it. For example, when users have their own audio-\/effect processing module and perform some voice pre-\/processing, such as a voice change.
\end{DoxyItemize}\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}

\begin{DoxyItemize}
\item 0\+: Success.
\item $<$ 0\+: Failure. 
\end{DoxyItemize}
\end{DoxyReturn}
\mbox{\Hypertarget{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_adc668e3e6df11928992bec7301d1f126}\label{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_adc668e3e6df11928992bec7301d1f126}} 
\index{io.agora.mediaplayer.IMediaPlayer@{io.agora.mediaplayer.IMediaPlayer}!registerMediaPlayerAudioSpectrumObserver@{registerMediaPlayerAudioSpectrumObserver}}
\index{registerMediaPlayerAudioSpectrumObserver@{registerMediaPlayerAudioSpectrumObserver}!io.agora.mediaplayer.IMediaPlayer@{io.agora.mediaplayer.IMediaPlayer}}
\doxysubsubsection{\texorpdfstring{registerMediaPlayerAudioSpectrumObserver()}{registerMediaPlayerAudioSpectrumObserver()}}
{\footnotesize\ttfamily int io.\+agora.\+mediaplayer.\+I\+Media\+Player.\+register\+Media\+Player\+Audio\+Spectrum\+Observer (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{interfaceio_1_1agora_1_1rtc2_1_1audio_1_1_i_audio_spectrum_observer}{I\+Audio\+Spectrum\+Observer}}}]{observer,  }\item[{int}]{interval\+In\+MS }\end{DoxyParamCaption})}

Registers the audio frame spectrum observer.


\begin{DoxyParams}{Parameters}
{\em observer} & The pointer to the \mbox{\hyperlink{}{I\+Audio\+Spectrum\+Observer}} object. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}

\begin{DoxyItemize}
\item 0\+: Success.
\item $<$ 0\+: Failure. 
\end{DoxyItemize}
\end{DoxyReturn}
\mbox{\Hypertarget{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_adedb23ba72e07a06c5c66d5349d39351}\label{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_adedb23ba72e07a06c5c66d5349d39351}} 
\index{io.agora.mediaplayer.IMediaPlayer@{io.agora.mediaplayer.IMediaPlayer}!unregisterMediaPlayerAudioSpectrumObserver@{unregisterMediaPlayerAudioSpectrumObserver}}
\index{unregisterMediaPlayerAudioSpectrumObserver@{unregisterMediaPlayerAudioSpectrumObserver}!io.agora.mediaplayer.IMediaPlayer@{io.agora.mediaplayer.IMediaPlayer}}
\doxysubsubsection{\texorpdfstring{unregisterMediaPlayerAudioSpectrumObserver()}{unregisterMediaPlayerAudioSpectrumObserver()}}
{\footnotesize\ttfamily int io.\+agora.\+mediaplayer.\+I\+Media\+Player.\+unregister\+Media\+Player\+Audio\+Spectrum\+Observer (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{interfaceio_1_1agora_1_1rtc2_1_1audio_1_1_i_audio_spectrum_observer}{I\+Audio\+Spectrum\+Observer}}}]{observer }\end{DoxyParamCaption})}

Releases the audio frame spectrum observer. 
\begin{DoxyParams}{Parameters}
{\em observer} & The pointer to the \mbox{\hyperlink{}{I\+Audio\+Spectrum\+Observer}} object. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}

\begin{DoxyItemize}
\item 0\+: Success.
\item $<$ 0\+: Failure. 
\end{DoxyItemize}
\end{DoxyReturn}
\mbox{\Hypertarget{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_a6c8b23525ecfcfc066ab693ba09dd44e}\label{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_a6c8b23525ecfcfc066ab693ba09dd44e}} 
\index{io.agora.mediaplayer.IMediaPlayer@{io.agora.mediaplayer.IMediaPlayer}!setAudioDualMonoMode@{setAudioDualMonoMode}}
\index{setAudioDualMonoMode@{setAudioDualMonoMode}!io.agora.mediaplayer.IMediaPlayer@{io.agora.mediaplayer.IMediaPlayer}}
\doxysubsubsection{\texorpdfstring{setAudioDualMonoMode()}{setAudioDualMonoMode()}}
{\footnotesize\ttfamily int io.\+agora.\+mediaplayer.\+I\+Media\+Player.\+set\+Audio\+Dual\+Mono\+Mode (\begin{DoxyParamCaption}\item[{int}]{mode }\end{DoxyParamCaption})}



Sets the channel mode of the current audio file. 

In a stereo music file, the left and right channels can store different audio data. According to your needs, you can set the channel mode to original mode, left channel mode, right channel mode, or mixed channel mode. For example, in the K\+TV scenario, the left channel of the music file stores the musical accompaniment, and the right channel stores the singing voice. If you only need to listen to the accompaniment, call this method to set the channel mode of the music file to left channel mode; if you need to listen to the accompaniment and the singing voice at the same time, call this method to set the channel mode to mixed channel mode.

\begin{DoxyNote}{Note}

\begin{DoxyItemize}
\item Call this method after calling {\ttfamily \mbox{\hyperlink{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_a17d627406558715c2cd06ee71b587432}{open(\+String url, long start\+Pos)}}}.
\item This method only applies to stereo audio files.
\end{DoxyItemize}
\end{DoxyNote}

\begin{DoxyParams}{Parameters}
{\em mode} & The channel mode.
\begin{DoxyItemize}
\item A\+U\+D\+I\+O\+\_\+\+D\+U\+A\+L\+\_\+\+M\+O\+N\+O\+\_\+\+S\+T\+E\+R\+EO (0)\+: Original mode.
\item A\+U\+D\+I\+O\+\_\+\+D\+U\+A\+L\+\_\+\+M\+O\+N\+O\+\_\+L (1)\+: Left channel mode. This mode replaces the audio of the right channel with the audio of the left channel, which means the user can only hear the audio of the left channel.
\item A\+U\+D\+I\+O\+\_\+\+D\+U\+A\+L\+\_\+\+M\+O\+N\+O\+\_\+R (2)\+: Right channel mode. This mode replaces the audio of the left channel with the audio of the right channel, which means the user can only hear the audio of the right channel.
\item A\+U\+D\+I\+O\+\_\+\+D\+U\+A\+L\+\_\+\+M\+O\+N\+O\+\_\+\+M\+IX (3)\+: Mixed channel mode. This mode mixes the audio of the left channel and the right channel, which means the user can hear the audio of the left channel and the right channel at the same time.
\end{DoxyItemize}\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}

\begin{DoxyItemize}
\item 0\+: Success.
\item $<$ 0\+: Failure. 
\end{DoxyItemize}
\end{DoxyReturn}
\mbox{\Hypertarget{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_a5d38e0457ec5bfb9a3705b664f099b82}\label{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_a5d38e0457ec5bfb9a3705b664f099b82}} 
\index{io.agora.mediaplayer.IMediaPlayer@{io.agora.mediaplayer.IMediaPlayer}!registerVideoFrameObserver@{registerVideoFrameObserver}}
\index{registerVideoFrameObserver@{registerVideoFrameObserver}!io.agora.mediaplayer.IMediaPlayer@{io.agora.mediaplayer.IMediaPlayer}}
\doxysubsubsection{\texorpdfstring{registerVideoFrameObserver()}{registerVideoFrameObserver()}}
{\footnotesize\ttfamily int io.\+agora.\+mediaplayer.\+I\+Media\+Player.\+register\+Video\+Frame\+Observer (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_video_frame_observer}{I\+Media\+Player\+Video\+Frame\+Observer}}}]{video\+Frame\+Observer }\end{DoxyParamCaption})}



Registers a video frame observer object. 

You need to implement the {\ttfamily \mbox{\hyperlink{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_video_frame_observer}{I\+Media\+Player\+Video\+Frame\+Observer}}} class in this method and register callbacks according to your scenarios. After you successfully register the video frame observer, the S\+DK triggers the registered callbacks each time a video frame is received.


\begin{DoxyParams}{Parameters}
{\em video\+Frame\+Observer} & The video observer, reporting the reception of each video frame. See {\ttfamily \mbox{\hyperlink{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_video_frame_observer}{I\+Media\+Player\+Video\+Frame\+Observer}}}.\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}

\begin{DoxyItemize}
\item 0\+: Success.
\item $<$ 0\+: Failure. 
\end{DoxyItemize}
\end{DoxyReturn}
\mbox{\Hypertarget{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_a9d9933dc04c28037a0e941a5ed0fa61a}\label{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_a9d9933dc04c28037a0e941a5ed0fa61a}} 
\index{io.agora.mediaplayer.IMediaPlayer@{io.agora.mediaplayer.IMediaPlayer}!openWithAgoraCDNSrc@{openWithAgoraCDNSrc}}
\index{openWithAgoraCDNSrc@{openWithAgoraCDNSrc}!io.agora.mediaplayer.IMediaPlayer@{io.agora.mediaplayer.IMediaPlayer}}
\doxysubsubsection{\texorpdfstring{openWithAgoraCDNSrc()}{openWithAgoraCDNSrc()}}
{\footnotesize\ttfamily int io.\+agora.\+mediaplayer.\+I\+Media\+Player.\+open\+With\+Agora\+C\+D\+N\+Src (\begin{DoxyParamCaption}\item[{String}]{src,  }\item[{long}]{start\+Pos }\end{DoxyParamCaption})}

Open the Agora C\+DN media source.

\begin{DoxyRefDesc}{Deprecated}
\item[\mbox{\hyperlink{deprecated__deprecated000001}{Deprecated}}]4.\+6.\+0\end{DoxyRefDesc}



\begin{DoxyParams}{Parameters}
{\em src} & The src of the media file that you want to play. \\
\hline
{\em start\+Pos} & The playback position (ms). \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}

\begin{DoxyItemize}
\item 0\+: Success.
\item $<$ 0\+: Failure. 
\end{DoxyItemize}
\end{DoxyReturn}
\mbox{\Hypertarget{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_aec985d367b9aa7abcda948a3f006b60a}\label{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_aec985d367b9aa7abcda948a3f006b60a}} 
\index{io.agora.mediaplayer.IMediaPlayer@{io.agora.mediaplayer.IMediaPlayer}!getAgoraCDNLineCount@{getAgoraCDNLineCount}}
\index{getAgoraCDNLineCount@{getAgoraCDNLineCount}!io.agora.mediaplayer.IMediaPlayer@{io.agora.mediaplayer.IMediaPlayer}}
\doxysubsubsection{\texorpdfstring{getAgoraCDNLineCount()}{getAgoraCDNLineCount()}}
{\footnotesize\ttfamily int io.\+agora.\+mediaplayer.\+I\+Media\+Player.\+get\+Agora\+C\+D\+N\+Line\+Count (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}

Gets the number of Agora C\+DN lines.

\begin{DoxyRefDesc}{Deprecated}
\item[\mbox{\hyperlink{deprecated__deprecated000002}{Deprecated}}]4.\+6.\+0\end{DoxyRefDesc}


\begin{DoxyReturn}{Returns}

\begin{DoxyItemize}
\item $>$ 0\+: number of C\+DN.
\item $<$= 0\+: Failure. 
\end{DoxyItemize}
\end{DoxyReturn}
\mbox{\Hypertarget{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_aa14aeb7f107b37cf69c8f4f3d09d64a1}\label{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_aa14aeb7f107b37cf69c8f4f3d09d64a1}} 
\index{io.agora.mediaplayer.IMediaPlayer@{io.agora.mediaplayer.IMediaPlayer}!switchAgoraCDNLineByIndex@{switchAgoraCDNLineByIndex}}
\index{switchAgoraCDNLineByIndex@{switchAgoraCDNLineByIndex}!io.agora.mediaplayer.IMediaPlayer@{io.agora.mediaplayer.IMediaPlayer}}
\doxysubsubsection{\texorpdfstring{switchAgoraCDNLineByIndex()}{switchAgoraCDNLineByIndex()}}
{\footnotesize\ttfamily int io.\+agora.\+mediaplayer.\+I\+Media\+Player.\+switch\+Agora\+C\+D\+N\+Line\+By\+Index (\begin{DoxyParamCaption}\item[{int}]{index }\end{DoxyParamCaption})}

Switch Agora C\+DN lines.

\begin{DoxyRefDesc}{Deprecated}
\item[\mbox{\hyperlink{deprecated__deprecated000003}{Deprecated}}]4.\+6.\+0\end{DoxyRefDesc}



\begin{DoxyParams}{Parameters}
{\em index} & Specific C\+DN line index. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}

\begin{DoxyItemize}
\item 0\+: Success.
\item $<$ 0\+: Failure. 
\end{DoxyItemize}
\end{DoxyReturn}
\mbox{\Hypertarget{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_a4370eec4cae4e1f3076f421cb3a33e92}\label{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_a4370eec4cae4e1f3076f421cb3a33e92}} 
\index{io.agora.mediaplayer.IMediaPlayer@{io.agora.mediaplayer.IMediaPlayer}!getCurrentAgoraCDNIndex@{getCurrentAgoraCDNIndex}}
\index{getCurrentAgoraCDNIndex@{getCurrentAgoraCDNIndex}!io.agora.mediaplayer.IMediaPlayer@{io.agora.mediaplayer.IMediaPlayer}}
\doxysubsubsection{\texorpdfstring{getCurrentAgoraCDNIndex()}{getCurrentAgoraCDNIndex()}}
{\footnotesize\ttfamily int io.\+agora.\+mediaplayer.\+I\+Media\+Player.\+get\+Current\+Agora\+C\+D\+N\+Index (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}

Gets the line of the current C\+DN.

\begin{DoxyRefDesc}{Deprecated}
\item[\mbox{\hyperlink{deprecated__deprecated000004}{Deprecated}}]4.\+6.\+0\end{DoxyRefDesc}


\begin{DoxyReturn}{Returns}

\begin{DoxyItemize}
\item $>$= 0\+: Specific line.
\item $<$ 0\+: Failure. 
\end{DoxyItemize}
\end{DoxyReturn}
\mbox{\Hypertarget{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_aeea244765c2e03c0455e2db9bd941de7}\label{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_aeea244765c2e03c0455e2db9bd941de7}} 
\index{io.agora.mediaplayer.IMediaPlayer@{io.agora.mediaplayer.IMediaPlayer}!enableAutoSwitchAgoraCDN@{enableAutoSwitchAgoraCDN}}
\index{enableAutoSwitchAgoraCDN@{enableAutoSwitchAgoraCDN}!io.agora.mediaplayer.IMediaPlayer@{io.agora.mediaplayer.IMediaPlayer}}
\doxysubsubsection{\texorpdfstring{enableAutoSwitchAgoraCDN()}{enableAutoSwitchAgoraCDN()}}
{\footnotesize\ttfamily int io.\+agora.\+mediaplayer.\+I\+Media\+Player.\+enable\+Auto\+Switch\+Agora\+C\+DN (\begin{DoxyParamCaption}\item[{boolean}]{enable }\end{DoxyParamCaption})}

Enable automatic C\+DN line switching.

\begin{DoxyRefDesc}{Deprecated}
\item[\mbox{\hyperlink{deprecated__deprecated000005}{Deprecated}}]4.\+6.\+0\end{DoxyRefDesc}



\begin{DoxyParams}{Parameters}
{\em enable} & Whether enable. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}

\begin{DoxyItemize}
\item 0\+: Success.
\item $<$ 0\+: Failure. 
\end{DoxyItemize}
\end{DoxyReturn}
\mbox{\Hypertarget{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_a63264a09e531562f8be50dd6524bec46}\label{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_a63264a09e531562f8be50dd6524bec46}} 
\index{io.agora.mediaplayer.IMediaPlayer@{io.agora.mediaplayer.IMediaPlayer}!renewAgoraCDNSrcToken@{renewAgoraCDNSrcToken}}
\index{renewAgoraCDNSrcToken@{renewAgoraCDNSrcToken}!io.agora.mediaplayer.IMediaPlayer@{io.agora.mediaplayer.IMediaPlayer}}
\doxysubsubsection{\texorpdfstring{renewAgoraCDNSrcToken()}{renewAgoraCDNSrcToken()}}
{\footnotesize\ttfamily int io.\+agora.\+mediaplayer.\+I\+Media\+Player.\+renew\+Agora\+C\+D\+N\+Src\+Token (\begin{DoxyParamCaption}\item[{String}]{token,  }\item[{long}]{ts }\end{DoxyParamCaption})}

Update the C\+DN source token and timestamp.

\begin{DoxyRefDesc}{Deprecated}
\item[\mbox{\hyperlink{deprecated__deprecated000006}{Deprecated}}]4.\+6.\+0\end{DoxyRefDesc}



\begin{DoxyParams}{Parameters}
{\em token} & token. \\
\hline
{\em ts} & ts. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}

\begin{DoxyItemize}
\item 0\+: Success.
\item $<$ 0\+: Failure. 
\end{DoxyItemize}
\end{DoxyReturn}
\mbox{\Hypertarget{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_ad4bf2afe404d0ae0316fcfc6efe115fe}\label{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_ad4bf2afe404d0ae0316fcfc6efe115fe}} 
\index{io.agora.mediaplayer.IMediaPlayer@{io.agora.mediaplayer.IMediaPlayer}!switchAgoraCDNSrc@{switchAgoraCDNSrc}}
\index{switchAgoraCDNSrc@{switchAgoraCDNSrc}!io.agora.mediaplayer.IMediaPlayer@{io.agora.mediaplayer.IMediaPlayer}}
\doxysubsubsection{\texorpdfstring{switchAgoraCDNSrc()}{switchAgoraCDNSrc()}}
{\footnotesize\ttfamily int io.\+agora.\+mediaplayer.\+I\+Media\+Player.\+switch\+Agora\+C\+D\+N\+Src (\begin{DoxyParamCaption}\item[{String}]{src,  }\item[{boolean}]{sync\+Pts }\end{DoxyParamCaption})}

Switch the C\+DN source.

\begin{DoxyRefDesc}{Deprecated}
\item[\mbox{\hyperlink{deprecated__deprecated000007}{Deprecated}}]4.\+6.\+0\end{DoxyRefDesc}



\begin{DoxyParams}{Parameters}
{\em src} & Specific src. \\
\hline
{\em sync\+Pts} & Live streaming must be set to false. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}

\begin{DoxyItemize}
\item 0\+: Success.
\item $<$ 0\+: Failure. 
\end{DoxyItemize}
\end{DoxyReturn}
\mbox{\Hypertarget{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_a9ef467b5596fb186a570bfb5bc60fbc1}\label{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_a9ef467b5596fb186a570bfb5bc60fbc1}} 
\index{io.agora.mediaplayer.IMediaPlayer@{io.agora.mediaplayer.IMediaPlayer}!setSpatialAudioParams@{setSpatialAudioParams}}
\index{setSpatialAudioParams@{setSpatialAudioParams}!io.agora.mediaplayer.IMediaPlayer@{io.agora.mediaplayer.IMediaPlayer}}
\doxysubsubsection{\texorpdfstring{setSpatialAudioParams()}{setSpatialAudioParams()}}
{\footnotesize\ttfamily int io.\+agora.\+mediaplayer.\+I\+Media\+Player.\+set\+Spatial\+Audio\+Params (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{classio_1_1agora_1_1rtc2_1_1_spatial_audio_params}{Spatial\+Audio\+Params}}}]{params }\end{DoxyParamCaption})}



Enables or disables the spatial audio effect for the media player. 

After successfully setting the spatial audio effect parameters of the media player, the S\+DK enables the spatial audio effect for the media player, and the local user can hear the media resources with a sense of space. If you need to disable the spatial audio effect for the media player, set the {\ttfamily params} parameter to null.


\begin{DoxyParams}{Parameters}
{\em params} & The spatial audio effect parameters of the media player. See {\ttfamily Spatial\+Audio\+Params}.\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}

\begin{DoxyItemize}
\item 0\+: Success.
\item $<$ 0\+: Failure. 
\end{DoxyItemize}
\end{DoxyReturn}
