Skip to content

Commit

Permalink
add methods
Browse files Browse the repository at this point in the history
  • Loading branch information
Suri539 committed Oct 12, 2024
1 parent 58f055b commit 3fd3a27
Show file tree
Hide file tree
Showing 11 changed files with 391 additions and 25 deletions.
67 changes: 67 additions & 0 deletions dita/RTC-NG/API/api_canvas_addview.dita
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE reference PUBLIC "-//OASIS//DTD DITA Reference//EN" "reference.dtd">
<reference id="api_canvas_addview">
<title><ph keyref="AddView"/></title>
<shortdesc id="short"><ph id="shortdesc"><?oxy-placeholder content="Provide a short description for this API."?></ph></shortdesc>
<prolog>
<metadata>
<keywords>
<indexterm keyref="AddView"/>
</keywords>
</metadata>
</prolog>
<refbody>
<section id="prototype">
<p outputclass="codeblock">
<codeblock props="android" outputclass="language-java"/>
<codeblock props="hmos" outputclass="language-arkts"/>
<codeblock props="ios mac" outputclass="language-objectivec"/>
<codeblock props="cpp unreal" outputclass="language-cpp"/>
<codeblock props="bp" outputclass="language-cpp"/>
<codeblock props="electron" outputclass="language-typescript"/>
<codeblock props="unity cs" outputclass="language-csharp"/>
<codeblock props="rn" outputclass="language-typescript"/>
<codeblock props="flutter" outputclass="language-dart"/> </p>
</section>
<section id="detailed_desc" deliveryTarget="details" otherprops="no-title">
<dl outputclass="since">
<dlentry props="native">
<dt>自从</dt>
<dd>v</dd>
</dlentry>
</dl>
<p/>
</section>
<section id="scenario" deliveryTarget="details">
<title>适用场景</title>
<p/>
</section>
<section id="timing" deliveryTarget="details">
<title>调用时机</title>
<p/>
</section>
<section id="restriction" deliveryTarget="details">
<title>调用限制</title>
<p/>
</section>
<section id="related" deliveryTarget="details">
<title>相关回调</title>
<p/>
</section>
<section id="parameters" deliveryTarget="details">
<title>参数</title>
<parml>
<plentry>
<pt/>
<pd/>
</plentry>
</parml> </section>
<section id="return_values">
<title><ph keyref="return-section-title"/></title>
<p props="flutter">方法成功调用时,无返回值;方法调用失败时,会抛出 <xref keyref="AgoraRtcException"/> 异常,你需要捕获异常并进行处理。<ph props="cn">详见<xref keyref="error-code-link"/>了解详情和解决建议。</ph></p>
<ul props="native unreal bp electron unity rn cs">
<li>0: 方法调用成功。</li>
<li>&lt; 0: 方法调用失败。<ph props="cn">详见<xref keyref="error-code-link"/>了解详情和解决建议。</ph></li>
</ul> </section>
</refbody>
</reference>
57 changes: 57 additions & 0 deletions dita/RTC-NG/API/api_canvas_getconfigs.dita
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE reference PUBLIC "-//OASIS//DTD DITA Reference//EN" "reference.dtd">
<reference id="api_canvas_getconfigs">
<title><ph keyref="GetConfigs_Canvas"/></title>
<shortdesc id="short"><ph id="shortdesc">获取当前的播放器视频渲染配置。</ph></shortdesc>
<prolog>
<metadata>
<keywords>
<indexterm keyref="GetConfigs_Canvas"/>
</keywords>
</metadata>
</prolog>
<refbody>
<section id="prototype">
<p outputclass="codeblock">
<codeblock props="android" outputclass="language-java">public void getConfigs(CanvasConfig config) throws RteException;</codeblock>
<codeblock props="hmos" outputclass="language-arkts"/>
<codeblock props="ios mac" outputclass="language-objectivec">- (BOOL)getConfigs:(AgoraRteCanvasConfig* _Nonnull)config error:(AgoraRteError* _Nullable)error;</codeblock>
<codeblock props="cpp unreal" outputclass="language-cpp">bool GetConfigs(CanvasConfig *config, Error *err);</codeblock>
<codeblock props="bp" outputclass="language-cpp"/>
<codeblock props="electron" outputclass="language-typescript"/>
<codeblock props="unity cs" outputclass="language-csharp"/>
<codeblock props="rn" outputclass="language-typescript"/>
<codeblock props="flutter" outputclass="language-dart"/> </p>
</section>
<section id="detailed_desc" deliveryTarget="details" otherprops="no-title">
<dl outputclass="since">
<dlentry props="native">
<dt>自从</dt>
<dd>v4.5.0</dd>
</dlentry>
</dl>
<p props="android" conkeyref="SetConfigs_Rte/exception"></p>
</section>
<section id="timing" deliveryTarget="details">
<title>调用时机</title>
<p>//TODO 如果没有设置,调用这个方法会返回什么?默认设置?</p>
</section>
<section id="restriction" deliveryTarget="details">
<title>调用限制</title>
<p>无。</p>
</section>
<section id="parameters" deliveryTarget="details">
<title>参数</title>
<parml>
<plentry conkeyref="SetConfigs_Canvas/config">
<pt/>
<pd/>
</plentry>
<plentry props="cpp apple" conkeyref="SetConfigs_Rte/err">
<pt></pt>
<pd></pd>
</plentry>
</parml> </section>
<section id="return_values" props="cpp apple framework" conkeyref="GetConfigs_Rte/return_values"/>
</refbody>
</reference>
57 changes: 57 additions & 0 deletions dita/RTC-NG/API/api_canvas_setconfigs.dita
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE reference PUBLIC "-//OASIS//DTD DITA Reference//EN" "reference.dtd">
<reference id="api_canvas_setconfigs">
<title><ph keyref="SetConfigs_Canvas"/></title>
<shortdesc id="short"><ph id="shortdesc">设置播放器视频渲染配置。</ph></shortdesc>
<prolog>
<metadata>
<keywords>
<indexterm keyref="SetConfigs_Canvas"/>
</keywords>
</metadata>
</prolog>
<refbody>
<section id="prototype">
<p outputclass="codeblock">
<codeblock props="android" outputclass="language-java">public void setConfigs(CanvasConfig config) throws RteException;</codeblock>
<codeblock props="hmos" outputclass="language-arkts"/>
<codeblock props="ios mac" outputclass="language-objectivec">- (BOOL)setConfigs:(AgoraRteCanvasConfig* _Nonnull)config error:(AgoraRteError* _Nullable)error;</codeblock>
<codeblock props="cpp unreal" outputclass="language-cpp">bool SetConfigs(CanvasConfig *config, Error *err);</codeblock>
<codeblock props="bp" outputclass="language-cpp"/>
<codeblock props="electron" outputclass="language-typescript"/>
<codeblock props="unity cs" outputclass="language-csharp"/>
<codeblock props="rn" outputclass="language-typescript"/>
<codeblock props="flutter" outputclass="language-dart"/> </p>
</section>
<section id="detailed_desc" deliveryTarget="details" otherprops="no-title">
<dl outputclass="since">
<dlentry props="native">
<dt>自从</dt>
<dd>v4.5.0</dd>
</dlentry>
</dl>
<p props="android" conkeyref="SetConfigs_Rte/exception"/>
</section>
<section id="timing" deliveryTarget="details">
<title>调用时机</title>
<p>当你调用 <xref keyref="SetCanvas"/> 指定一个 Canvas 对象来显示视频后,你可以调用该方法来设置渲染配置。//TODO</p>
</section>
<section id="restriction" deliveryTarget="details">
<title>调用限制</title>
<p>无。</p>
</section>
<section id="parameters" deliveryTarget="details">
<title>参数</title>
<parml>
<plentry id="config">
<pt>config</pt>
<pd>Canvas 对象的设置,详见 <xref keyref="CanvasConfig"/>。</pd>
</plentry>
<plentry props="apple cpp" conkeyref="SetConfigs_Rte/err">
<pt></pt>
<pd></pd>
</plentry>
</parml> </section>
<section id="return_values" conkeyref="SetConfigs_Rte/return_values" props="apple cpp framework"/>
</refbody>
</reference>
35 changes: 12 additions & 23 deletions dita/RTC-NG/API/api_player_getstats.dita
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<!DOCTYPE reference PUBLIC "-//OASIS//DTD DITA Reference//EN" "reference.dtd">
<reference id="api_player_getstats">
<title><ph keyref="GetStats"/></title>
<shortdesc id="short"><ph id="shortdesc"><?oxy-placeholder content="Provide a short description for this API."?></ph></shortdesc>
<shortdesc id="short"><ph id="shortdesc">获取播放器所播放的媒体资源的统计信息。</ph></shortdesc>
<prolog>
<metadata>
<keywords>
Expand All @@ -27,41 +27,30 @@
<dl outputclass="since">
<dlentry props="native">
<dt>自从</dt>
<dd>v</dd>
<dd>v4.5.0</dd>
</dlentry>
</dl>
<p/>
</section>
<section id="scenario" deliveryTarget="details">
<title>适用场景</title>
<p/>
<p>该方法用于获取播放器的统计信息,包括解码、渲染帧率、音视频码率等,并通过回调函数异步返回结果。</p>
</section>
<section id="timing" deliveryTarget="details">
<title>调用时机</title>
<p/>
<p>//TODO</p>
</section>
<section id="restriction" deliveryTarget="details">
<title>调用限制</title>
<p/>
</section>
<section id="related" deliveryTarget="details">
<title>相关回调</title>
<p/>
<p>//TODO</p>
</section>
<section id="parameters" deliveryTarget="details">
<title>参数</title>
<parml>
<plentry>
<pt/>
<pd/>
<plentry props="cpp apple">
<pt>cb</pt>
<pd>一个异步回调函数,用于通知获取播放器媒体资源统计信息的结果和错误信息。你可以通过该回调的 <parmname>stats</parmname> 参数得知统计数据,详见 <xref keyref="RtePlayerStats"/>。如果获取信息失败,你可以通过该回调的 <parmname>err</parmname> 参数获取错误信息,详见 <xref keyref="Error"/>。</pd>
</plentry>
<plentry props="android">
<pt>callback</pt>
<pd>回调接口,用于异步接收统计信息和可能的错误信息,详见 <xref keyref="PlayerGetStatsCallback"/>。//TODO 这个是否要写文档?</pd>
</plentry>
</parml> </section>
<section id="return_values">
<title><ph keyref="return-section-title"/></title>
<p props="flutter">方法成功调用时,无返回值;方法调用失败时,会抛出 <xref keyref="AgoraRtcException"/> 异常,你需要捕获异常并进行处理。<ph props="cn">详见<xref keyref="error-code-link"/>了解详情和解决建议。</ph></p>
<ul props="native unreal bp electron unity rn cs">
<li>0: 方法调用成功。</li>
<li>&lt; 0: 方法调用失败。<ph props="cn">详见<xref keyref="error-code-link"/>了解详情和解决建议。</ph></li>
</ul> </section>
</refbody>
</reference>
69 changes: 69 additions & 0 deletions dita/RTC-NG/API/api_player_setcanvas.dita
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE reference PUBLIC "-//OASIS//DTD DITA Reference//EN" "reference.dtd">
<reference id="api_player_setcanvas">
<title><ph keyref="SetCanvas"/></title>
<shortdesc id="short"><ph id="shortdesc">设置 Canvas 以显示视频。</ph></shortdesc>
<prolog>
<metadata>
<keywords>
<indexterm keyref="SetCanvas"/>
</keywords>
</metadata>
</prolog>
<refbody>
<section id="prototype">
<p outputclass="codeblock">
<codeblock props="android" outputclass="language-java">public void setCanvas(Canvas canvas) throws RteException;</codeblock>
<codeblock props="hmos" outputclass="language-arkts"/>
<codeblock props="ios mac" outputclass="language-objectivec">- (BOOL)setCanvas:(AgoraRteCanvas *_Nonnull)canvas error:(AgoraRteError * _Nullable)error;</codeblock>
<codeblock props="cpp unreal" outputclass="language-cpp">bool SetCanvas(Canvas *canvas, Error *err);</codeblock>
<codeblock props="bp" outputclass="language-cpp"/>
<codeblock props="electron" outputclass="language-typescript"/>
<codeblock props="unity cs" outputclass="language-csharp"/>
<codeblock props="rn" outputclass="language-typescript"/>
<codeblock props="flutter" outputclass="language-dart"/> </p>
</section>
<section id="detailed_desc" deliveryTarget="details" otherprops="no-title">
<dl outputclass="since">
<dlentry props="native">
<dt>自从</dt>
<dd>v4.5.0</dd>
</dlentry>
</dl>
<p>该方法用于指定一个 Canvas 对象来显示视频。当视频流成功加载后,视频画面会显示在这个指定的 Canvas 上。</p>
<p props="android" conkeyref="SetConfigs_Rte/exception"/>
</section>
<section id="timing" deliveryTarget="details">
<title>调用时机</title>
<p>//TODO</p>
</section>
<section id="restriction" deliveryTarget="details">
<title>调用限制</title>
<p>无。</p>
</section>
<section id="related" deliveryTarget="details">
<title>相关回调</title>
<p/>
</section>
<section id="parameters" deliveryTarget="details">
<title>参数</title>
<parml>
<plentry>
<pt>canvas</pt>
<pd>用于渲染视频帧的 Canvas 对象,详见 <xref keyref="Canvas"/>。</pd>
</plentry>
<plentry props="cpp apple" conkeyref="SetConfigs_Rte/err">
<pt></pt>
<pd></pd>
</plentry>
</parml> </section>
<section id="return_values" props="cpp apple framework">
<title><ph keyref="return-section-title"/></title>
<p props="flutter">方法成功调用时,无返回值;方法调用失败时,会抛出 <xref keyref="AgoraRtcException"/> 异常,你需要捕获异常并进行处理。<ph props="cn">详见<xref keyref="error-code-link"/>了解详情和解决建议。</ph></p>
<p props="cpp apple unreal bp electron unity rn cs">设置是否成功:<ul>
<li><codeph><ph keyref="true"/></codeph>:设置成功。</li>
<li><codeph><ph keyref="false"/></codeph>:设置失败,可通过 <parmname props="cpp">err</parmname><parmname props="apple">error</parmname> 参数返回的错误码了解详细信息。</li>
</ul></p>
</section>
</refbody>
</reference>
6 changes: 6 additions & 0 deletions dita/RTC-NG/API/class_canvas.dita
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE reference PUBLIC "-//OASIS//DTD DITA Reference//EN" "reference.dtd">
<reference id="class_canvas">
<title><ph keyref="Canvas"/></title>
<shortdesc id="short"><ph id="shortdesc">该类提供设置播放器视频渲染的方法。</ph></shortdesc>
</reference>
Loading

0 comments on commit 3fd3a27

Please sign in to comment.