\hypertarget{classagora_1_1rtc_1_1_i_media_recorder}{}\doxysection{agora\+::rtc\+::I\+Media\+Recorder Class Reference}
\label{classagora_1_1rtc_1_1_i_media_recorder}\index{agora::rtc::IMediaRecorder@{agora::rtc::IMediaRecorder}}
Inheritance diagram for agora\+::rtc\+::I\+Media\+Recorder\+:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=3.000000cm]{classagora_1_1rtc_1_1_i_media_recorder}
\end{center}
\end{figure}
\doxysubsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
virtual int \mbox{\hyperlink{classagora_1_1rtc_1_1_i_media_recorder_a2e5a752eb9818b5c4ac5db9155c0385e}{set\+Media\+Recorder\+Observer}} (\mbox{\hyperlink{classagora_1_1media_1_1_i_media_recorder_observer}{media\+::\+I\+Media\+Recorder\+Observer}} $\ast$callback)=0
\item 
virtual int \mbox{\hyperlink{classagora_1_1rtc_1_1_i_media_recorder_a2366c1f1cdf8874cc20f99a089b35a58}{start\+Recording}} (const \mbox{\hyperlink{structagora_1_1media_1_1_media_recorder_configuration}{media\+::\+Media\+Recorder\+Configuration}} \&config)=0
\item 
virtual int \mbox{\hyperlink{classagora_1_1rtc_1_1_i_media_recorder_a43e40d02689a01308938d5147b9648c7}{stop\+Recording}} ()=0
\end{DoxyCompactItemize}


\doxysubsection{Member Function Documentation}
\mbox{\Hypertarget{classagora_1_1rtc_1_1_i_media_recorder_a2e5a752eb9818b5c4ac5db9155c0385e}\label{classagora_1_1rtc_1_1_i_media_recorder_a2e5a752eb9818b5c4ac5db9155c0385e}} 
\index{agora::rtc::IMediaRecorder@{agora::rtc::IMediaRecorder}!setMediaRecorderObserver@{setMediaRecorderObserver}}
\index{setMediaRecorderObserver@{setMediaRecorderObserver}!agora::rtc::IMediaRecorder@{agora::rtc::IMediaRecorder}}
\doxysubsubsection{\texorpdfstring{setMediaRecorderObserver()}{setMediaRecorderObserver()}}
{\footnotesize\ttfamily virtual int agora\+::rtc\+::\+I\+Media\+Recorder\+::set\+Media\+Recorder\+Observer (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{classagora_1_1media_1_1_i_media_recorder_observer}{media\+::\+I\+Media\+Recorder\+Observer}} $\ast$}]{callback }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [pure virtual]}}

Registers the I\+Media\+Recorder\+Observer object.

\begin{DoxySince}{Since}
v4.\+0.\+0
\end{DoxySince}
\begin{DoxyNote}{Note}
Call this method before the start\+Recording method.
\end{DoxyNote}

\begin{DoxyParams}{Parameters}
{\em callback} & The callbacks for recording audio and video streams. See I\+Media\+Recorder\+Observer.\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}

\begin{DoxyItemize}
\item 0(E\+R\+R\+\_\+\+OK)\+: Success.
\item $<$ 0\+: Failure\+: 
\end{DoxyItemize}
\end{DoxyReturn}
\mbox{\Hypertarget{classagora_1_1rtc_1_1_i_media_recorder_a2366c1f1cdf8874cc20f99a089b35a58}\label{classagora_1_1rtc_1_1_i_media_recorder_a2366c1f1cdf8874cc20f99a089b35a58}} 
\index{agora::rtc::IMediaRecorder@{agora::rtc::IMediaRecorder}!startRecording@{startRecording}}
\index{startRecording@{startRecording}!agora::rtc::IMediaRecorder@{agora::rtc::IMediaRecorder}}
\doxysubsubsection{\texorpdfstring{startRecording()}{startRecording()}}
{\footnotesize\ttfamily virtual int agora\+::rtc\+::\+I\+Media\+Recorder\+::start\+Recording (\begin{DoxyParamCaption}\item[{const \mbox{\hyperlink{structagora_1_1media_1_1_media_recorder_configuration}{media\+::\+Media\+Recorder\+Configuration}} \&}]{config }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [pure virtual]}}

Starts recording the local or remote audio and video.

\begin{DoxySince}{Since}
v4.\+0.\+0
\end{DoxySince}
After successfully calling \mbox{\hyperlink{classagora_1_1rtc_1_1_i_rtc_engine_ae92091361a67f144662069758bceda5a}{create\+Media\+Recorder}} to get the media recorder object , you can call this method to enable the recording of the local audio and video.

This method can record the following content\+:
\begin{DoxyItemize}
\item The audio captured by the local microphone and encoded in A\+AC format.
\item The video captured by the local camera and encoded by the S\+DK.
\item The audio received from remote users and encoded in A\+AC format.
\item The video received from remote users.
\end{DoxyItemize}

The S\+DK can generate a recording file only when it detects the recordable audio and video streams; when there are no audio and video streams to be recorded or the audio and video streams are interrupted for more than five seconds, the S\+DK stops recording and triggers the on\+Recorder\+State\+Changed (R\+E\+C\+O\+R\+D\+E\+R\+\_\+\+S\+T\+A\+T\+E\+\_\+\+E\+R\+R\+OR, R\+E\+C\+O\+R\+D\+E\+R\+\_\+\+E\+R\+R\+O\+R\+\_\+\+N\+O\+\_\+\+S\+T\+R\+E\+AM) callback.

\begin{DoxyNote}{Note}
Call this method after joining the channel.
\end{DoxyNote}

\begin{DoxyParams}{Parameters}
{\em config} & The recording configurations. See Media\+Recorder\+Configuration.\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}

\begin{DoxyItemize}
\item 0(E\+R\+R\+\_\+\+OK)\+: Success.
\item $<$ 0\+: Failure\+:
\begin{DoxyItemize}
\item {\ttfamily -\/1(E\+R\+R\+\_\+\+F\+A\+I\+L\+ED)}\+: \mbox{\hyperlink{classagora_1_1rtc_1_1_i_rtc_engine}{I\+Rtc\+Engine}} does not support the request because the remote user did not subscribe to the target channel or the media streams published by the local user during remote recording.
\item {\ttfamily -\/2(E\+R\+R\+\_\+\+I\+N\+V\+A\+L\+I\+D\+\_\+\+A\+R\+G\+U\+M\+E\+NT)}\+: The parameter is invalid. Ensure the following\+:
\begin{DoxyItemize}
\item The specified path of the recording file exists and is writable.
\item The specified format of the recording file is supported.
\item The maximum recording duration is correctly set.
\item During remote recording, ensure the user whose media streams you want record did join the channel.
\end{DoxyItemize}
\item {\ttfamily -\/4(E\+R\+R\+\_\+\+N\+O\+T\+\_\+\+S\+U\+P\+P\+O\+R\+T\+ED)}\+: \mbox{\hyperlink{classagora_1_1rtc_1_1_i_rtc_engine}{I\+Rtc\+Engine}} does not support the request due to one of the following reasons\+:
\begin{DoxyItemize}
\item The recording is ongoing.
\item The recording stops because an error occurs.
\item No I\+Media\+Recorder\+Observer object is registered. 
\end{DoxyItemize}
\end{DoxyItemize}
\end{DoxyItemize}
\end{DoxyReturn}
\mbox{\Hypertarget{classagora_1_1rtc_1_1_i_media_recorder_a43e40d02689a01308938d5147b9648c7}\label{classagora_1_1rtc_1_1_i_media_recorder_a43e40d02689a01308938d5147b9648c7}} 
\index{agora::rtc::IMediaRecorder@{agora::rtc::IMediaRecorder}!stopRecording@{stopRecording}}
\index{stopRecording@{stopRecording}!agora::rtc::IMediaRecorder@{agora::rtc::IMediaRecorder}}
\doxysubsubsection{\texorpdfstring{stopRecording()}{stopRecording()}}
{\footnotesize\ttfamily virtual int agora\+::rtc\+::\+I\+Media\+Recorder\+::stop\+Recording (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [pure virtual]}}

Stops recording the audio and video.

\begin{DoxySince}{Since}
v4.\+0.\+0
\end{DoxySince}
\begin{DoxyNote}{Note}
After calling \mbox{\hyperlink{classagora_1_1rtc_1_1_i_media_recorder_a2366c1f1cdf8874cc20f99a089b35a58}{start\+Recording}}, if you want to stop the recording, you must call {\ttfamily stop\+Recording}; otherwise, the generated recording files might not be playable.
\end{DoxyNote}
\begin{DoxyReturn}{Returns}

\begin{DoxyItemize}
\item 0(E\+R\+R\+\_\+\+OK)\+: Success.
\item $<$ 0\+: Failure\+: 
\end{DoxyItemize}
\end{DoxyReturn}
