Skip to content

Commit

Permalink
Merge pull request #3730 from AgoraIO/hh-api-batch6
Browse files Browse the repository at this point in the history
add batch 6
  • Loading branch information
Nero-Hu authored Aug 5, 2024
2 parents 81537e5 + 9f8c396 commit 426c859
Show file tree
Hide file tree
Showing 18 changed files with 193 additions and 80 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,18 @@
{required int playerId, required RemoteVoicePositionInfo positionInfo});</codeblock>
<codeblock props="reserve" outputclass="language-cpp"></codeblock></p>
</section>
<section id="detailed_desc">
<title>详情</title>
<section id="detailed_desc" deliveryTarget="details" otherprops="no-title">
<p>成功更新后,本地用户可以听到媒体播放器空间位置的变化。</p>
</section>
<section id="parameters">
<section id="timing" deliveryTarget="details">
<title>调用时机</title>
<p>加入频道前后均可调用。</p>
</section>
<section id="restriction" deliveryTarget="details">
<title>调用限制</title>
<p>无。</p>
</section>
<section id="parameters" deliveryTarget="details">
<title>参数</title>
<parml>
<plentry id="mpkid">
Expand Down
14 changes: 10 additions & 4 deletions dita/RTC-NG/API/api_imediaplayer_getstreaminfo.dita
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,16 @@
<codeblock props="flutter" outputclass="language-dart">Future&lt;PlayerStreamInfo&gt; getStreamInfo(int index);</codeblock>
<codeblock props="reserve" outputclass="language-cpp"></codeblock></p>
</section>
<section id="detailed_desc">
<title>详情</title>
<note type="attention" id="note">你需要在 <xref keyref="getStreamCount" /> 后调用该方法。</note> </section>
<section id="parameters">
<section id="detailed_desc" deliveryTarget="details" otherprops="no-title"/>
<section id="timing" deliveryTarget="details">
<title>调用时机</title>
<p>你需要在 <xref keyref="getStreamCount" /> 后调用该方法。</p>
</section>
<section id="restriction" deliveryTarget="details">
<title>调用限制</title>
<p>无。</p>
</section>
<section id="parameters" deliveryTarget="details">
<title>参数</title>
<parml>
<plentry>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,16 @@
<codeblock props="flutter" outputclass="language-dart">void registerPlayerSourceObserver(MediaPlayerSourceObserver observer);</codeblock>
<codeblock props="reserve" outputclass="language-cpp"></codeblock></p>
</section>
<section id="parameters">
<section id="detailed_desc" deliveryTarget="details" otherprops="no-title"/>
<section id="timing" deliveryTarget="details">
<title>调用时机</title>
<p>加入频道前后均可调用。</p>
</section>
<section id="restriction" deliveryTarget="details">
<title>调用限制</title>
<p>无。</p>
</section>
<section id="parameters" deliveryTarget="details">
<title>参数</title>
<parml>
<plentry>
Expand Down
17 changes: 11 additions & 6 deletions dita/RTC-NG/API/api_irtcengine_isspeakerphoneenabled.dita
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,17 @@
<codeblock props="flutter" outputclass="language-dart">Future&lt;bool&gt; isSpeakerphoneEnabled();</codeblock>
<codeblock props="reserve" outputclass="language-cpp"></codeblock></p>
</section>
<section id="detailed_desc" props="cpp unreal bp unity flutter cs">
<note type="note">
<ul>
<li>该方法仅适用于 Android 和 iOS。</li>
<li>该方法在加入频道前后都能调用。</li>
</ul></note> </section>
<section id="detailed_desc" deliveryTarget="details" otherprops="no-title">
<note type="attention" props="cpp unreal bp unity flutter cs">该方法仅适用于 Android 和 iOS。</note>
</section>
<section id="timing" deliveryTarget="details">
<title>调用时机</title>
<p>该方法在加入频道前后都能调用。</p>
</section>
<section id="restriction" deliveryTarget="details">
<title>调用限制</title>
<p>无。</p>
</section>
<section id="return_values">
<title>返回值</title>
<ul>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,30 +30,33 @@
<codeblock props="flutter" outputclass="language-dart">Future&lt;void&gt; setDefaultAudioRouteToSpeakerphone(bool defaultToSpeaker);</codeblock>
<codeblock props="reserve" outputclass="language-cpp"></codeblock></p>
</section>
<section id="detailed_desc">
<title>详情</title>
<note props="cpp android hmos ios unreal bp unity rn flutter">
<ul>
<li props="cpp unreal bp unity flutter">该方法仅适用于 Android 和 iOS 平台。</li>
<li>该方法需要在加入频道前调用。如需在加入频道后切换音频路由,请调用 <xref keyref="setEnableSpeakerphone"/>。</li>
</ul>
</note>
<section id="detailed_desc" deliveryTarget="details" otherprops="no-title">
<note type="attention" props="cpp unreal bp unity flutter">该方法仅适用于 Android 和 iOS 平台。</note>
<p>手机设备一般有两个音频路由,一个是位于顶部的听筒,播放声音偏小;一个是位于底部的扬声器,播放声音偏大。设置默认的音频路由,就是在没有外接设备的前提下,设置系统使用听筒还是扬声器播放音频。</p>
<p>不同场景下,系统默认的音频路由也不同。具体如下:



<ul id="ul_kq3_tpf_3qb">
<li>语音通话:听筒</li>
<li>语音直播:扬声器</li>
<li>视频通话:扬声器</li>
<li>视频直播:扬声器</li>
</ul></p>
<p>调用该 API 可以改变上述默认音频路由。成功改变音频路由后,SDK 会触发 <xref keyref="onAudioRoutingChanged"/> 回调。</p>
<p>调用该 API 可以改变上述默认音频路由。</p>
<note props="android hmos ios unity rn flutter">
<p>当手机插入外接设备,如蓝牙设备或耳机时,系统的音频路由会发生改变。详细的路由变化规律请参考 <xref keyref="guide-audio-route">音频路由</xref>。</p>
<p>在调用该方法设置默认音频路由后,系统实际音频路由会随着外接音频设备(有线耳机或蓝牙耳机)的连接发生改变。详见<xref keyref="guide-audio-route"/>。</p>
</note> </section>
<section id="parameters">
<section id="timing" deliveryTarget="details">
<title>调用时机</title>
<p>该方法需要在加入频道前调用。如需在加入频道后切换音频路由,请调用 <xref keyref="setEnableSpeakerphone"/>。</p>
</section>
<section id="restriction" deliveryTarget="details">
<title>调用限制</title>
<p>无。</p>
</section>
<section id="related" deliveryTarget="details">
<title>相关回调</title>
<p>成功改变音频路由后,SDK 会触发 <xref keyref="onAudioRoutingChanged"/> 回调,报告当前的音频路由。</p>
</section>
<section id="parameters" deliveryTarget="details">
<title>参数</title>
<parml>
<plentry>
Expand Down
34 changes: 23 additions & 11 deletions dita/RTC-NG/API/api_irtcengine_setenablespeakerphone.dita
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,30 @@
<codeblock props="unity cs" outputclass="language-csharp">public abstract int SetEnableSpeakerphone(bool speakerOn);</codeblock>
<codeblock props="rn" outputclass="language-typescript">abstract setEnableSpeakerphone(speakerOn: boolean): number;</codeblock>
<codeblock props="flutter" outputclass="language-dart">Future&lt;void&gt; setEnableSpeakerphone(bool speakerOn);</codeblock></p> </section>
<section id="detailed_desc">
<title>详情</title>
<p>如果 SDK 默认的音频路由或 <xref keyref="setDefaultAudioRouteToSpeakerphone" /> 的设置无法满足你的需求,你可以调用 <xref keyref="setEnableSpeakerphone" /> 切换当前的音频路由。成功改变音频路由后,SDK 会触发 <xref keyref="onAudioRoutingChanged" /> 回调。</p>
<p props="android ios unity rn flutter">不同场景下 SDK 默认的音频路由见<xref keyref="guide-audio-route">音频路由</xref>。</p>
<p>该方法只设置用户在当前频道内使用的音频路由,不会影响 SDK 默认的音频路由。如果用户离开当前频道并加入新的频道,则用户还是会使用 SDK 默认的音频路由。</p>
<note type="attention">
<section id="detailed_desc" deliveryTarget="details" otherprops="no-title">
<p props="android ios unity rn flutter">不同场景下 SDK 默认的音频路由见<xref keyref="guide-audio-route"/>。</p>
<note type="attention" props="cpp unreal bp unity flutter cs">该方法仅适用于 Android 和 iOS 平台。</note>
</section>
<section id="scenario" deliveryTarget="details">
<title>适用场景</title>
<p>如果 SDK 默认的音频路由或 <xref keyref="setDefaultAudioRouteToSpeakerphone" /> 的设置无法满足你的需求,你可以调用该方法切换当前的音频路由。</p>
</section>
<section id="timing" deliveryTarget="details">
<title>调用时机</title>
<p>该方法需要在加入频道后调用。</p>
</section>
<section id="restriction" deliveryTarget="details">
<title>调用限制</title>
<ul>
<li props="cpp unreal bp unity flutter cs">该方法仅适用于 Android 和 iOS 平台。</li>
<li>该方法需要在加入频道后调用。</li>
<li>如果用户使用了蓝牙耳机、有线耳机等外接音频播放设备,则该方法的设置无效,音频只会通过外接设备播放。当有多个外接设备时,音频会通过最后一个接入的设备播放。</li>
</ul></note> </section>
<section id="parameters">
<li>该方法只设置用户在当前频道内使用的音频路由,不会影响 SDK 默认的音频路由。如果用户离开当前频道并加入新的频道,则用户还是会使用 SDK 默认的音频路由。</li>
<li>如果用户使用了蓝牙耳机、有线耳机等外接音频播放设备,则该方法的设置无效,音频只会通过外接设备播放。当有多个外接设备时,音频会通过最后一个接入的设备播放。</li>
</ul>
</section>
<section id="related" deliveryTarget="details">
<title>相关回调</title>
<p>成功改变音频路由后,SDK 会触发 <xref keyref="onAudioRoutingChanged" /> 回调,报告当前的音频路由。</p>
</section>
<section id="parameters" deliveryTarget="details">
<title>参数</title>
<parml>
<plentry>
Expand Down
22 changes: 16 additions & 6 deletions dita/RTC-NG/API/api_irtcengine_setrouteincommunicationmode.dita
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,29 @@
<codeblock props="rn" outputclass="language-typescript">abstract setRouteInCommunicationMode(route: number): number;</codeblock>
<codeblock props="flutter" outputclass="language-dart">Future&lt;void> setRouteInCommunicationMode(int route);</codeblock> </p>
</section>
<section id="detailed_desc">
<title>详情</title>
<section id="detailed_desc" deliveryTarget="details" otherprops="no-title">
<dl outputclass="since">
<dlentry props="native">
<dt>自从</dt>
<dd>v4.2.2</dd>
</dlentry>
</dl>
<p>该方法用于在通话音量模式(<xref keyref="communication-audio-mode"/>)下,将音频路由从蓝牙耳机切换为听筒、有线耳机或扬声器。该方法调用成功后,SDK 会触发 <xref keyref="onAudioRoutingChanged"/> 回调,报告修改后的路由。</p>
<note type="attention" props="android hmos">该方法与 <xref keyref="setEnableSpeakerphone"/> 同时使用时可能引起冲突。声网建议你单独使用 <xref keyref="setRouteInCommunicationMode"/>。</note>
<note type="attention" props="cpp unity rn flutter unreal bp"><ul><li>该方法仅适用于 Android。</li><li>该方法与 <xref keyref="setEnableSpeakerphone"/> 同时使用时可能引起冲突。声网建议你单独使用 <xref keyref="setRouteInCommunicationMode"/>。</li></ul></note>
<p>该方法用于在通话音量模式(<xref keyref="communication-audio-mode"/>)下,将音频路由从蓝牙耳机切换为听筒、有线耳机或扬声器。</p>
<note type="attention" props="cpp unity rn flutter unreal bp">该方法仅适用于 Android。</note>
</section>
<section id="parameters">
<section id="timing" deliveryTarget="details">
<title>调用时机</title>
<p>加入频道前后均可调用。</p>
</section>
<section id="restriction" deliveryTarget="details">
<title>调用限制</title>
<p props="cpp android hmos unity rn flutter unreal bp">该方法与 <xref keyref="setEnableSpeakerphone"/> 同时使用时可能引起冲突。声网建议你单独使用 <xref keyref="setRouteInCommunicationMode"/>。</p>
</section>
<section id="related" deliveryTarget="details">
<title>相关回调</title>
<p>成功调用该方法后,SDK 会触发 <xref keyref="onAudioRoutingChanged"/> 回调,报告当前的音频路由。</p>
</section>
<section id="parameters" deliveryTarget="details">
<title>参数</title>
<parml>
<plentry>
Expand Down
39 changes: 25 additions & 14 deletions dita/RTC-NG/API/api_irtcengine_takesnapshot.dita
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,27 @@
<codeblock props="flutter" outputclass="language-dart">Future&lt;void> takeSnapshot({required int uid, required String filePath});</codeblock>
<codeblock props="reserve" outputclass="language-cpp"></codeblock></p>
</section>
<section id="detailed_desc">
<title>详情</title>
<p id="desc1">该方法用于对指定用户的视频流进行截图,生成一张 JPG 格式的图片,并保存至指定的路径。</p>
<p id="desc2" props="native unreal bp unity electron flutter cs">该方法是异步操作,调用返回时 SDK 并没有真正获取截图。成功调用该方法后,SDK 会触发 <xref keyref="onSnapshotTaken" /> 回调报告截图是否成功和获取截图的详情。</p>
<p props="rn">调用该方法返回时 SDK 并没有真正获取截图。成功调用该方法后,SDK 会触发 <xref keyref="onSnapshotTaken" /> 回调报告截图是否成功和获取截图的详情。</p>
<note type="attention">
<ul>
<li>该方法需要在加入频道后调用。</li>
<li>该方法用于本地视频截图时,是对 <xref keyref="ChannelMediaOptions"/> 中指定发布的视频流进行截图。</li>
<li>如果用户的视频经过前处理,例如,添加了水印或美颜,生成的截图会包含前处理效果。</li>
</ul></note> </section>
<section id="parameters">
<section id="detailed_desc" deliveryTarget="details" otherprops="no-title">
<p>该方法用于对指定用户的视频流进行截图,生成一张 JPG 格式的图片,并保存至指定的路径。</p>
</section>
<section id="timing" deliveryTarget="details">
<title>调用时机</title>
<p>该方法需要在加入频道后调用。</p>
</section>
<section id="restriction" deliveryTarget="details">
<title>调用限制</title>
<ul>
<li id="desc2" props="native unreal bp unity electron flutter cs">该方法是异步操作,调用返回时 SDK 并没有真正获取截图。</li>
<li props="rn">调用该方法返回时 SDK 并没有真正获取截图。</li>
<li>该方法用于本地视频截图时,是对 <xref keyref="ChannelMediaOptions"/> 中指定发布的视频流进行截图。</li>
<li>如果用户的视频经过前处理,例如,添加了水印或美颜,生成的截图会包含前处理效果。</li>
</ul>
</section>
<section id="related" deliveryTarget="details">
<title>相关回调</title>
<p>成功调用该方法后,SDK 会触发 <xref keyref="onSnapshotTaken" /> 回调,报告截图是否成功和获取截图的详情。</p>
</section>
<section id="parameters" deliveryTarget="details">
<title>参数</title>
<parml>
<plentry id="uid">
Expand All @@ -46,13 +55,15 @@
<plentry id="filepath">
<pt>filePath</pt>
<pd>
<p>截图的本地保存路径,需精确到文件名及格式, 例如:
<p>截图的本地保存路径,需精确到文件名及格式,例如:
<ul>
<li props="cpp unreal bp unity flutter electron cs">Windows: <codeph>C:\Users\&lt;user_name&gt;\AppData\Local\Agora\&lt;process_name&gt;\example.jpg</codeph></li>
<li props="cpp unreal bp ios unity flutter rn">iOS: <codeph>/App Sandbox/Library/Caches/example.jpg</codeph></li>
<li props="cpp unreal bp mac unity flutter electron">macOS: <codeph>~/Library/Logs/example.jpg</codeph></li>
<li props="cpp unreal bp android unity flutter rn">Android: <codeph>/storage/emulated/0/Android/data/&lt;package name&gt;/files/example.jpg</codeph></li>
</ul>请确保目录存在且可写。</p>
</ul>
</p>
<note type="attention">请确保目录存在且可写。</note>
</pd>
</plentry>
</parml> </section>
Expand Down
Loading

0 comments on commit 426c859

Please sign in to comment.