\hypertarget{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_cache_manager}{}\doxysection{io.\+agora.\+mediaplayer.\+I\+Media\+Player\+Cache\+Manager Interface Reference}
\label{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_cache_manager}\index{io.agora.mediaplayer.IMediaPlayerCacheManager@{io.agora.mediaplayer.IMediaPlayerCacheManager}}
\doxysubsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
int \mbox{\hyperlink{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_cache_manager_a97bc0b38b189e4e9fb6e3926b3b039a1}{remove\+All\+Caches}} ()
\begin{DoxyCompactList}\small\item\em Deletes all cached media files in the media player. \end{DoxyCompactList}\item 
int \mbox{\hyperlink{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_cache_manager_a525593b18311e04e2b8520f5403b5d59}{remove\+Old\+Cache}} ()
\begin{DoxyCompactList}\small\item\em Deletes a cached media file that is the least recently used. \end{DoxyCompactList}\item 
int \mbox{\hyperlink{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_cache_manager_a122155ac37d8912fa8f96926f2808189}{remove\+Cache\+By\+Uri}} (String uri)
\begin{DoxyCompactList}\small\item\em Deletes a cached media file. \end{DoxyCompactList}\item 
int \mbox{\hyperlink{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_cache_manager_a9ad82ea01e916a8e9a7b1195f43585f3}{set\+Cache\+Dir}} (String path)
\begin{DoxyCompactList}\small\item\em Sets the storage path for the media files that you want to cache. \end{DoxyCompactList}\item 
int \mbox{\hyperlink{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_cache_manager_adc9637cd85285dcc6c4cbfcde8d64db6}{set\+Max\+Cache\+File\+Count}} (int count)
\begin{DoxyCompactList}\small\item\em Sets the maximum number of media files that can be cached. \end{DoxyCompactList}\item 
int \mbox{\hyperlink{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_cache_manager_ae0e09e72be9c7773dd35deb852c6cbb9}{set\+Max\+Cache\+File\+Size}} (long cache\+Size)
\begin{DoxyCompactList}\small\item\em Sets the maximum size of the aggregate storage space for cached media files. \end{DoxyCompactList}\item 
int \mbox{\hyperlink{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_cache_manager_ac532eaf4dbe0e5699ab26fd771cc22bc}{enable\+Auto\+Remove\+Cache}} (boolean enable)
\begin{DoxyCompactList}\small\item\em Sets whether to delete cached media files automatically. \end{DoxyCompactList}\item 
String \mbox{\hyperlink{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_cache_manager_ab13ced9d92d7b5716828495da2179401}{get\+Cache\+Dir}} ()
\begin{DoxyCompactList}\small\item\em Gets the storage path of the cached media files. \end{DoxyCompactList}\item 
int \mbox{\hyperlink{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_cache_manager_afd0f9434e2012180058ba4f87207a239}{get\+Max\+Cache\+File\+Count}} ()
\begin{DoxyCompactList}\small\item\em Gets the maximum number of media files that can be cached. \end{DoxyCompactList}\item 
long \mbox{\hyperlink{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_cache_manager_a87d31b8f369a482cffe425d457702ee1}{get\+Max\+Cache\+File\+Size}} ()
\begin{DoxyCompactList}\small\item\em Gets the maximum size of the aggregate storage space for cached media files. \end{DoxyCompactList}\item 
int \mbox{\hyperlink{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_cache_manager_a451e42202def7cb341ea16a8e2cb087f}{get\+Cache\+File\+Count}} ()
\begin{DoxyCompactList}\small\item\em Gets the number of media files that are cached. \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsection{Member Function Documentation}
\mbox{\Hypertarget{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_cache_manager_a97bc0b38b189e4e9fb6e3926b3b039a1}\label{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_cache_manager_a97bc0b38b189e4e9fb6e3926b3b039a1}} 
\index{io.agora.mediaplayer.IMediaPlayerCacheManager@{io.agora.mediaplayer.IMediaPlayerCacheManager}!removeAllCaches@{removeAllCaches}}
\index{removeAllCaches@{removeAllCaches}!io.agora.mediaplayer.IMediaPlayerCacheManager@{io.agora.mediaplayer.IMediaPlayerCacheManager}}
\doxysubsubsection{\texorpdfstring{removeAllCaches()}{removeAllCaches()}}
{\footnotesize\ttfamily int io.\+agora.\+mediaplayer.\+I\+Media\+Player\+Cache\+Manager.\+remove\+All\+Caches (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Deletes all cached media files in the media player. 

\begin{DoxyNote}{Note}
The cached media file currently being played will not be deleted.
\end{DoxyNote}
\begin{DoxyReturn}{Returns}

\begin{DoxyItemize}
\item 0\+: Success.
\item $<$ 0\+: Failure. See {\ttfamily Media\+Player\+Reason}. 
\end{DoxyItemize}
\end{DoxyReturn}
\mbox{\Hypertarget{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_cache_manager_a525593b18311e04e2b8520f5403b5d59}\label{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_cache_manager_a525593b18311e04e2b8520f5403b5d59}} 
\index{io.agora.mediaplayer.IMediaPlayerCacheManager@{io.agora.mediaplayer.IMediaPlayerCacheManager}!removeOldCache@{removeOldCache}}
\index{removeOldCache@{removeOldCache}!io.agora.mediaplayer.IMediaPlayerCacheManager@{io.agora.mediaplayer.IMediaPlayerCacheManager}}
\doxysubsubsection{\texorpdfstring{removeOldCache()}{removeOldCache()}}
{\footnotesize\ttfamily int io.\+agora.\+mediaplayer.\+I\+Media\+Player\+Cache\+Manager.\+remove\+Old\+Cache (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Deletes a cached media file that is the least recently used. 

You can call this method to delete a cached media file when the storage space for the cached files is about to reach its limit. After you call this method, the S\+DK deletes the cached media file that is least used.

\begin{DoxyNote}{Note}
The cached media file currently being played will not be deleted.
\end{DoxyNote}
\begin{DoxyReturn}{Returns}

\begin{DoxyItemize}
\item 0\+: Success.
\item $<$ 0\+: Failure. See {\ttfamily Media\+Player\+Reason}. 
\end{DoxyItemize}
\end{DoxyReturn}
\mbox{\Hypertarget{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_cache_manager_a122155ac37d8912fa8f96926f2808189}\label{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_cache_manager_a122155ac37d8912fa8f96926f2808189}} 
\index{io.agora.mediaplayer.IMediaPlayerCacheManager@{io.agora.mediaplayer.IMediaPlayerCacheManager}!removeCacheByUri@{removeCacheByUri}}
\index{removeCacheByUri@{removeCacheByUri}!io.agora.mediaplayer.IMediaPlayerCacheManager@{io.agora.mediaplayer.IMediaPlayerCacheManager}}
\doxysubsubsection{\texorpdfstring{removeCacheByUri()}{removeCacheByUri()}}
{\footnotesize\ttfamily int io.\+agora.\+mediaplayer.\+I\+Media\+Player\+Cache\+Manager.\+remove\+Cache\+By\+Uri (\begin{DoxyParamCaption}\item[{String}]{uri }\end{DoxyParamCaption})}



Deletes a cached media file. 

\begin{DoxyNote}{Note}
The cached media file currently being played will not be deleted.
\end{DoxyNote}

\begin{DoxyParams}{Parameters}
{\em uri} & The U\+RI (Uniform Resource Identifier) of the media file to be deleted.\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}

\begin{DoxyItemize}
\item 0\+: Success.
\item $<$ 0\+: Failure. See {\ttfamily Media\+Player\+Reason}. 
\end{DoxyItemize}
\end{DoxyReturn}
\mbox{\Hypertarget{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_cache_manager_a9ad82ea01e916a8e9a7b1195f43585f3}\label{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_cache_manager_a9ad82ea01e916a8e9a7b1195f43585f3}} 
\index{io.agora.mediaplayer.IMediaPlayerCacheManager@{io.agora.mediaplayer.IMediaPlayerCacheManager}!setCacheDir@{setCacheDir}}
\index{setCacheDir@{setCacheDir}!io.agora.mediaplayer.IMediaPlayerCacheManager@{io.agora.mediaplayer.IMediaPlayerCacheManager}}
\doxysubsubsection{\texorpdfstring{setCacheDir()}{setCacheDir()}}
{\footnotesize\ttfamily int io.\+agora.\+mediaplayer.\+I\+Media\+Player\+Cache\+Manager.\+set\+Cache\+Dir (\begin{DoxyParamCaption}\item[{String}]{path }\end{DoxyParamCaption})}



Sets the storage path for the media files that you want to cache. 

\begin{DoxyNote}{Note}
Make sure {\ttfamily Rtc\+Engine} is initialized before you call this method.
\end{DoxyNote}

\begin{DoxyParams}{Parameters}
{\em path} & The absolute path of the media files to be cached. Ensure that the directory for the media files exists and is writable.\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}

\begin{DoxyItemize}
\item 0\+: Success.
\item $<$ 0\+: Failure. See {\ttfamily Media\+Player\+Reason}. 
\end{DoxyItemize}
\end{DoxyReturn}
\mbox{\Hypertarget{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_cache_manager_adc9637cd85285dcc6c4cbfcde8d64db6}\label{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_cache_manager_adc9637cd85285dcc6c4cbfcde8d64db6}} 
\index{io.agora.mediaplayer.IMediaPlayerCacheManager@{io.agora.mediaplayer.IMediaPlayerCacheManager}!setMaxCacheFileCount@{setMaxCacheFileCount}}
\index{setMaxCacheFileCount@{setMaxCacheFileCount}!io.agora.mediaplayer.IMediaPlayerCacheManager@{io.agora.mediaplayer.IMediaPlayerCacheManager}}
\doxysubsubsection{\texorpdfstring{setMaxCacheFileCount()}{setMaxCacheFileCount()}}
{\footnotesize\ttfamily int io.\+agora.\+mediaplayer.\+I\+Media\+Player\+Cache\+Manager.\+set\+Max\+Cache\+File\+Count (\begin{DoxyParamCaption}\item[{int}]{count }\end{DoxyParamCaption})}



Sets the maximum number of media files that can be cached. 


\begin{DoxyParams}{Parameters}
{\em count} & The maximum number of media files that can be cached. The default value is 1,000.\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}

\begin{DoxyItemize}
\item 0\+: Success.
\item $<$ 0\+: Failure. See {\ttfamily Media\+Player\+Reason}. 
\end{DoxyItemize}
\end{DoxyReturn}
\mbox{\Hypertarget{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_cache_manager_ae0e09e72be9c7773dd35deb852c6cbb9}\label{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_cache_manager_ae0e09e72be9c7773dd35deb852c6cbb9}} 
\index{io.agora.mediaplayer.IMediaPlayerCacheManager@{io.agora.mediaplayer.IMediaPlayerCacheManager}!setMaxCacheFileSize@{setMaxCacheFileSize}}
\index{setMaxCacheFileSize@{setMaxCacheFileSize}!io.agora.mediaplayer.IMediaPlayerCacheManager@{io.agora.mediaplayer.IMediaPlayerCacheManager}}
\doxysubsubsection{\texorpdfstring{setMaxCacheFileSize()}{setMaxCacheFileSize()}}
{\footnotesize\ttfamily int io.\+agora.\+mediaplayer.\+I\+Media\+Player\+Cache\+Manager.\+set\+Max\+Cache\+File\+Size (\begin{DoxyParamCaption}\item[{long}]{cache\+Size }\end{DoxyParamCaption})}



Sets the maximum size of the aggregate storage space for cached media files. 


\begin{DoxyParams}{Parameters}
{\em cache\+Size} & The maximum size (bytes) of the aggregate storage space for cached media files. The default value is 1 GB.\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}

\begin{DoxyItemize}
\item 0\+: Success.
\item $<$ 0\+: Failure. See {\ttfamily Media\+Player\+Reason}. 
\end{DoxyItemize}
\end{DoxyReturn}
\mbox{\Hypertarget{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_cache_manager_ac532eaf4dbe0e5699ab26fd771cc22bc}\label{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_cache_manager_ac532eaf4dbe0e5699ab26fd771cc22bc}} 
\index{io.agora.mediaplayer.IMediaPlayerCacheManager@{io.agora.mediaplayer.IMediaPlayerCacheManager}!enableAutoRemoveCache@{enableAutoRemoveCache}}
\index{enableAutoRemoveCache@{enableAutoRemoveCache}!io.agora.mediaplayer.IMediaPlayerCacheManager@{io.agora.mediaplayer.IMediaPlayerCacheManager}}
\doxysubsubsection{\texorpdfstring{enableAutoRemoveCache()}{enableAutoRemoveCache()}}
{\footnotesize\ttfamily int io.\+agora.\+mediaplayer.\+I\+Media\+Player\+Cache\+Manager.\+enable\+Auto\+Remove\+Cache (\begin{DoxyParamCaption}\item[{boolean}]{enable }\end{DoxyParamCaption})}



Sets whether to delete cached media files automatically. 

If you enable this function to remove cached media files automatically, when the cached media files exceed either the number or size limit you set, the S\+DK automatically deletes the least recently used cache file.


\begin{DoxyParams}{Parameters}
{\em enable} & Whether to enable the S\+DK to delete cached media files automatically\+:
\begin{DoxyItemize}
\item {\ttfamily true}\+: Delete cached media files automatically.
\item {\ttfamily false}\+: (Default) Do not delete cached media files automatically.
\end{DoxyItemize}\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}

\begin{DoxyItemize}
\item 0\+: Success.
\item $<$ 0\+: Failure. See {\ttfamily Media\+Player\+Reason}. 
\end{DoxyItemize}
\end{DoxyReturn}
\mbox{\Hypertarget{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_cache_manager_ab13ced9d92d7b5716828495da2179401}\label{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_cache_manager_ab13ced9d92d7b5716828495da2179401}} 
\index{io.agora.mediaplayer.IMediaPlayerCacheManager@{io.agora.mediaplayer.IMediaPlayerCacheManager}!getCacheDir@{getCacheDir}}
\index{getCacheDir@{getCacheDir}!io.agora.mediaplayer.IMediaPlayerCacheManager@{io.agora.mediaplayer.IMediaPlayerCacheManager}}
\doxysubsubsection{\texorpdfstring{getCacheDir()}{getCacheDir()}}
{\footnotesize\ttfamily String io.\+agora.\+mediaplayer.\+I\+Media\+Player\+Cache\+Manager.\+get\+Cache\+Dir (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Gets the storage path of the cached media files. 

If you have not called the {\ttfamily set\+Cache\+Dir} method to set the storage path for the media files to be cached before calling this method, you get the default storage path used by the S\+DK.

\begin{DoxyReturn}{Returns}

\begin{DoxyItemize}
\item The call succeeds, and the S\+DK returns the storage path of the cached media files.
\item $<$ 0\+: Failure. See {\ttfamily Media\+Player\+Reason}. 
\end{DoxyItemize}
\end{DoxyReturn}
\mbox{\Hypertarget{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_cache_manager_afd0f9434e2012180058ba4f87207a239}\label{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_cache_manager_afd0f9434e2012180058ba4f87207a239}} 
\index{io.agora.mediaplayer.IMediaPlayerCacheManager@{io.agora.mediaplayer.IMediaPlayerCacheManager}!getMaxCacheFileCount@{getMaxCacheFileCount}}
\index{getMaxCacheFileCount@{getMaxCacheFileCount}!io.agora.mediaplayer.IMediaPlayerCacheManager@{io.agora.mediaplayer.IMediaPlayerCacheManager}}
\doxysubsubsection{\texorpdfstring{getMaxCacheFileCount()}{getMaxCacheFileCount()}}
{\footnotesize\ttfamily int io.\+agora.\+mediaplayer.\+I\+Media\+Player\+Cache\+Manager.\+get\+Max\+Cache\+File\+Count (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Gets the maximum number of media files that can be cached. 

By default, the maximum number of media files that can be cached is 1,000.

\begin{DoxyReturn}{Returns}

\begin{DoxyItemize}
\item $>$ 0\+: The call succeeds and returns the maximum number of media files that can be cached.
\item $<$ 0\+: Failure. See {\ttfamily Media\+Player\+Reason}. 
\end{DoxyItemize}
\end{DoxyReturn}
\mbox{\Hypertarget{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_cache_manager_a87d31b8f369a482cffe425d457702ee1}\label{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_cache_manager_a87d31b8f369a482cffe425d457702ee1}} 
\index{io.agora.mediaplayer.IMediaPlayerCacheManager@{io.agora.mediaplayer.IMediaPlayerCacheManager}!getMaxCacheFileSize@{getMaxCacheFileSize}}
\index{getMaxCacheFileSize@{getMaxCacheFileSize}!io.agora.mediaplayer.IMediaPlayerCacheManager@{io.agora.mediaplayer.IMediaPlayerCacheManager}}
\doxysubsubsection{\texorpdfstring{getMaxCacheFileSize()}{getMaxCacheFileSize()}}
{\footnotesize\ttfamily long io.\+agora.\+mediaplayer.\+I\+Media\+Player\+Cache\+Manager.\+get\+Max\+Cache\+File\+Size (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Gets the maximum size of the aggregate storage space for cached media files. 

By default, the maximum size of the aggregate storage space for cached media files is 1 GB. You can call the {\ttfamily set\+Max\+Cache\+File\+Size} method to set the limit according to your scenarios.

\begin{DoxyReturn}{Returns}

\begin{DoxyItemize}
\item $>$ 0\+: The call succeeds and returns the maximum size (in bytes) of the aggregate storage space for cached media files.
\item $<$ 0\+: Failure. See {\ttfamily Media\+Player\+Reason}. 
\end{DoxyItemize}
\end{DoxyReturn}
\mbox{\Hypertarget{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_cache_manager_a451e42202def7cb341ea16a8e2cb087f}\label{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_cache_manager_a451e42202def7cb341ea16a8e2cb087f}} 
\index{io.agora.mediaplayer.IMediaPlayerCacheManager@{io.agora.mediaplayer.IMediaPlayerCacheManager}!getCacheFileCount@{getCacheFileCount}}
\index{getCacheFileCount@{getCacheFileCount}!io.agora.mediaplayer.IMediaPlayerCacheManager@{io.agora.mediaplayer.IMediaPlayerCacheManager}}
\doxysubsubsection{\texorpdfstring{getCacheFileCount()}{getCacheFileCount()}}
{\footnotesize\ttfamily int io.\+agora.\+mediaplayer.\+I\+Media\+Player\+Cache\+Manager.\+get\+Cache\+File\+Count (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Gets the number of media files that are cached. 

\begin{DoxyReturn}{Returns}

\begin{DoxyItemize}
\item ≥ 0\+: The call succeeds and returns the number of media files that are cached.
\item $<$ 0\+: Failure. See {\ttfamily Media\+Player\+Reason}. 
\end{DoxyItemize}
\end{DoxyReturn}
