\hypertarget{structagora_1_1media_1_1base_1_1_media_source}{}\doxysection{agora\+::media\+::base\+::Media\+Source Struct Reference}
\label{structagora_1_1media_1_1base_1_1_media_source}\index{agora::media::base::MediaSource@{agora::media::base::MediaSource}}


Information related to the media file to be played and the playback scenario configurations.  




{\ttfamily \#include $<$Agora\+Media\+Player\+Types.\+h$>$}

\doxysubsection*{Public Attributes}
\begin{DoxyCompactItemize}
\item 
const char $\ast$ \mbox{\hyperlink{structagora_1_1media_1_1base_1_1_media_source_aaf0dd90ad1462a04105e9f2348041e32}{url}}
\item 
const char $\ast$ \mbox{\hyperlink{structagora_1_1media_1_1base_1_1_media_source_a5648db076a4cf4c7583a08b0b95c106f}{uri}}
\item 
int64\+\_\+t \mbox{\hyperlink{structagora_1_1media_1_1base_1_1_media_source_ab52e7f5c9a483c634dadfee3dcce2ba5}{start\+Pos}}
\item 
bool \mbox{\hyperlink{structagora_1_1media_1_1base_1_1_media_source_a6c4e98fa55b3609cb93d95b671695748}{auto\+Play}}
\item 
bool \mbox{\hyperlink{structagora_1_1media_1_1base_1_1_media_source_a28a14228b70e606561cca5053eb3e65b}{enable\+Cache}}
\item 
bool \mbox{\hyperlink{structagora_1_1media_1_1base_1_1_media_source_ab167899013e14b1ad1d56ab175547e74}{enable\+Multi\+Audio\+Track}}
\item 
\mbox{\hyperlink{classagora_1_1_optional}{Optional}}$<$ bool $>$ \mbox{\hyperlink{structagora_1_1media_1_1base_1_1_media_source_afc76bb1f8a153d8ca78030d99afd6ded}{is\+Agora\+Source}}
\item 
\mbox{\hyperlink{classagora_1_1_optional}{Optional}}$<$ bool $>$ \mbox{\hyperlink{structagora_1_1media_1_1base_1_1_media_source_abccce79be714d5c6e1584390406f2189}{is\+Live\+Source}}
\item 
\mbox{\hyperlink{classagora_1_1media_1_1base_1_1_i_media_player_custom_data_provider}{I\+Media\+Player\+Custom\+Data\+Provider}} $\ast$ \mbox{\hyperlink{structagora_1_1media_1_1base_1_1_media_source_ad4a79f71c88c47b395f835b69ec9764f}{provider}}
\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
Information related to the media file to be played and the playback scenario configurations. 

\doxysubsection{Member Data Documentation}
\mbox{\Hypertarget{structagora_1_1media_1_1base_1_1_media_source_aaf0dd90ad1462a04105e9f2348041e32}\label{structagora_1_1media_1_1base_1_1_media_source_aaf0dd90ad1462a04105e9f2348041e32}} 
\index{agora::media::base::MediaSource@{agora::media::base::MediaSource}!url@{url}}
\index{url@{url}!agora::media::base::MediaSource@{agora::media::base::MediaSource}}
\doxysubsubsection{\texorpdfstring{url}{url}}
{\footnotesize\ttfamily const char$\ast$ agora\+::media\+::base\+::\+Media\+Source\+::url}

The U\+RL of the media file to be played. \begin{DoxyNote}{Note}
If you open a common media resource, pass in the value to {\ttfamily url}. If you open a custom media resource, pass in the value to {\ttfamily provider}. Agora recommends that you do not pass in values to both parameters in one call; otherwise, this call may fail. 
\end{DoxyNote}
\mbox{\Hypertarget{structagora_1_1media_1_1base_1_1_media_source_a5648db076a4cf4c7583a08b0b95c106f}\label{structagora_1_1media_1_1base_1_1_media_source_a5648db076a4cf4c7583a08b0b95c106f}} 
\index{agora::media::base::MediaSource@{agora::media::base::MediaSource}!uri@{uri}}
\index{uri@{uri}!agora::media::base::MediaSource@{agora::media::base::MediaSource}}
\doxysubsubsection{\texorpdfstring{uri}{uri}}
{\footnotesize\ttfamily const char$\ast$ agora\+::media\+::base\+::\+Media\+Source\+::uri}

The U\+RI (Uniform Resource Identifier) of the media file. \mbox{\Hypertarget{structagora_1_1media_1_1base_1_1_media_source_ab52e7f5c9a483c634dadfee3dcce2ba5}\label{structagora_1_1media_1_1base_1_1_media_source_ab52e7f5c9a483c634dadfee3dcce2ba5}} 
\index{agora::media::base::MediaSource@{agora::media::base::MediaSource}!startPos@{startPos}}
\index{startPos@{startPos}!agora::media::base::MediaSource@{agora::media::base::MediaSource}}
\doxysubsubsection{\texorpdfstring{startPos}{startPos}}
{\footnotesize\ttfamily int64\+\_\+t agora\+::media\+::base\+::\+Media\+Source\+::start\+Pos}

The starting position (ms) for playback. The default value is 0. \mbox{\Hypertarget{structagora_1_1media_1_1base_1_1_media_source_a6c4e98fa55b3609cb93d95b671695748}\label{structagora_1_1media_1_1base_1_1_media_source_a6c4e98fa55b3609cb93d95b671695748}} 
\index{agora::media::base::MediaSource@{agora::media::base::MediaSource}!autoPlay@{autoPlay}}
\index{autoPlay@{autoPlay}!agora::media::base::MediaSource@{agora::media::base::MediaSource}}
\doxysubsubsection{\texorpdfstring{autoPlay}{autoPlay}}
{\footnotesize\ttfamily bool agora\+::media\+::base\+::\+Media\+Source\+::auto\+Play}

Whether to enable autoplay once the media file is opened\+:
\begin{DoxyItemize}
\item {\ttfamily true}\+: (Default) Yes.
\item {\ttfamily false}\+: No. \begin{DoxyNote}{Note}
If autoplay is disabled, you need to call the {\ttfamily play} method to play a media file after it is opened. 
\end{DoxyNote}

\end{DoxyItemize}\mbox{\Hypertarget{structagora_1_1media_1_1base_1_1_media_source_a28a14228b70e606561cca5053eb3e65b}\label{structagora_1_1media_1_1base_1_1_media_source_a28a14228b70e606561cca5053eb3e65b}} 
\index{agora::media::base::MediaSource@{agora::media::base::MediaSource}!enableCache@{enableCache}}
\index{enableCache@{enableCache}!agora::media::base::MediaSource@{agora::media::base::MediaSource}}
\doxysubsubsection{\texorpdfstring{enableCache}{enableCache}}
{\footnotesize\ttfamily bool agora\+::media\+::base\+::\+Media\+Source\+::enable\+Cache}

Whether to cache the media file when it is being played\+:
\begin{DoxyItemize}
\item {\ttfamily true}\+:Enables caching.
\item {\ttfamily false}\+: (Default) Disables caching. \begin{DoxyNote}{Note}

\end{DoxyNote}

\item Agora only supports caching on-\/demand audio and video streams that are not transmitted in H\+LS protocol.
\item If you need to enable caching, pass in a value to {\ttfamily uri}; otherwise, caching is based on the {\ttfamily url} of the media file.
\item If you enable this function, the Media Player caches part of the media file being played on your local device, and you can play the cached media file without internet connection. The statistics about the media file being cached are updated every second after the media file is played. See {\ttfamily \mbox{\hyperlink{structagora_1_1media_1_1base_1_1_cache_statistics}{Cache\+Statistics}}}. 
\end{DoxyItemize}\mbox{\Hypertarget{structagora_1_1media_1_1base_1_1_media_source_ab167899013e14b1ad1d56ab175547e74}\label{structagora_1_1media_1_1base_1_1_media_source_ab167899013e14b1ad1d56ab175547e74}} 
\index{agora::media::base::MediaSource@{agora::media::base::MediaSource}!enableMultiAudioTrack@{enableMultiAudioTrack}}
\index{enableMultiAudioTrack@{enableMultiAudioTrack}!agora::media::base::MediaSource@{agora::media::base::MediaSource}}
\doxysubsubsection{\texorpdfstring{enableMultiAudioTrack}{enableMultiAudioTrack}}
{\footnotesize\ttfamily bool agora\+::media\+::base\+::\+Media\+Source\+::enable\+Multi\+Audio\+Track}

Whether to allow the selection of different audio tracks when playing this media file\+:
\begin{DoxyItemize}
\item {\ttfamily true}\+: Allow to select different audio tracks.
\item {\ttfamily false}\+: (Default) Do not allow to select different audio tracks. If you need to set different audio tracks for local playback and publishing to the channel, you need to set this parameter to {\ttfamily true}, and then call the {\ttfamily select\+Multi\+Audio\+Track} method to select the audio track. 
\end{DoxyItemize}\mbox{\Hypertarget{structagora_1_1media_1_1base_1_1_media_source_afc76bb1f8a153d8ca78030d99afd6ded}\label{structagora_1_1media_1_1base_1_1_media_source_afc76bb1f8a153d8ca78030d99afd6ded}} 
\index{agora::media::base::MediaSource@{agora::media::base::MediaSource}!isAgoraSource@{isAgoraSource}}
\index{isAgoraSource@{isAgoraSource}!agora::media::base::MediaSource@{agora::media::base::MediaSource}}
\doxysubsubsection{\texorpdfstring{isAgoraSource}{isAgoraSource}}
{\footnotesize\ttfamily \mbox{\hyperlink{classagora_1_1_optional}{Optional}}$<$bool$>$ agora\+::media\+::base\+::\+Media\+Source\+::is\+Agora\+Source}

Whether the media resource to be opened is a live stream or on-\/demand video distributed through Media Broadcast service\+:
\begin{DoxyItemize}
\item {\ttfamily true}\+: The media resource to be played is a live or on-\/demand video distributed through Media Broadcast service.
\item {\ttfamily false}\+: (Default) The media resource is not a live stream or on-\/demand video distributed through Media Broadcast service. \begin{DoxyNote}{Note}
If you need to open a live stream or on-\/demand video distributed through Broadcast Streaming service, pass in the U\+RL of the media resource to {\ttfamily url}, and set {\ttfamily is\+Agora\+Source} as {\ttfamily true}; otherwise, you don\textquotesingle{}t need to set the {\ttfamily is\+Agora\+Source} parameter. 
\end{DoxyNote}

\end{DoxyItemize}\mbox{\Hypertarget{structagora_1_1media_1_1base_1_1_media_source_abccce79be714d5c6e1584390406f2189}\label{structagora_1_1media_1_1base_1_1_media_source_abccce79be714d5c6e1584390406f2189}} 
\index{agora::media::base::MediaSource@{agora::media::base::MediaSource}!isLiveSource@{isLiveSource}}
\index{isLiveSource@{isLiveSource}!agora::media::base::MediaSource@{agora::media::base::MediaSource}}
\doxysubsubsection{\texorpdfstring{isLiveSource}{isLiveSource}}
{\footnotesize\ttfamily \mbox{\hyperlink{classagora_1_1_optional}{Optional}}$<$bool$>$ agora\+::media\+::base\+::\+Media\+Source\+::is\+Live\+Source}

Whether the media resource to be opened is a live stream\+:
\begin{DoxyItemize}
\item {\ttfamily true}\+: The media resource is a live stream.
\item {\ttfamily false}\+: (Default) The media resource is not a live stream. If the media resource you want to open is a live stream, Agora recommends that you set this parameter as {\ttfamily true} so that the live stream can be loaded more quickly. \begin{DoxyNote}{Note}
If the media resource you open is not a live stream, but you set {\ttfamily is\+Live\+Source} as {\ttfamily true}, the media resource is not to be loaded more quickly. 
\end{DoxyNote}

\end{DoxyItemize}\mbox{\Hypertarget{structagora_1_1media_1_1base_1_1_media_source_ad4a79f71c88c47b395f835b69ec9764f}\label{structagora_1_1media_1_1base_1_1_media_source_ad4a79f71c88c47b395f835b69ec9764f}} 
\index{agora::media::base::MediaSource@{agora::media::base::MediaSource}!provider@{provider}}
\index{provider@{provider}!agora::media::base::MediaSource@{agora::media::base::MediaSource}}
\doxysubsubsection{\texorpdfstring{provider}{provider}}
{\footnotesize\ttfamily \mbox{\hyperlink{classagora_1_1media_1_1base_1_1_i_media_player_custom_data_provider}{I\+Media\+Player\+Custom\+Data\+Provider}}$\ast$ agora\+::media\+::base\+::\+Media\+Source\+::provider}

The callback for custom media resource files. See {\ttfamily \mbox{\hyperlink{classagora_1_1media_1_1base_1_1_i_media_player_custom_data_provider}{I\+Media\+Player\+Custom\+Data\+Provider}}}. \begin{DoxyNote}{Note}
If you open a custom media resource, pass in the value to {\ttfamily provider}. If you open a common media resource, pass in the value to {\ttfamily url}. Agora recommends that you do not pass in values to both {\ttfamily url} and {\ttfamily provider} in one call; otherwise, this call may fail. 
\end{DoxyNote}
