Skip to content

Commit bde03d1

Browse files
authored
Merge pull request #479 from AgoraDoc/release/rtc-ng/3.7.202-copy
Merge 37202/preview5 doc to master
2 parents b697c45 + d5208ae commit bde03d1

File tree

158 files changed

+8398
-705
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

158 files changed

+8398
-705
lines changed
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE reference PUBLIC "-//OASIS//DTD DITA Reference//EN" "reference.dtd">
3+
<reference id="api_agoravideoencoderconfiguration_initwithsize">
4+
<title><ph keyref="initWithSize"/></title>
5+
<shortdesc id="short"><ph id="shortdesc">指定视频分辨率并初始化一个 <xref keyref="VideoEncoderConfiguration"/> 对象。</ph></shortdesc>
6+
<prolog>
7+
<metadata>
8+
<keywords>
9+
<indexterm keyref="initWithSize"/>
10+
</keywords>
11+
</metadata>
12+
</prolog>
13+
<refbody>
14+
<section id="prototype">
15+
<p outputclass="codeblock" props="rtc-ng">
16+
<codeblock props="ios mac" outputclass="language-objectivec">- (instancetype _Nonnull)initWithSize:(CGSize)size
17+
frameRate:(AgoraVideoFrameRate)frameRate
18+
bitrate:(NSInteger)bitrate
19+
orientationMode:(AgoraVideoOutputOrientationMode)orientationMode
20+
mirrorMode:(AgoraVideoMirrorMode)mirrorMode;</codeblock>
21+
</p>
22+
<p outputclass="codeblock" props="rtc">
23+
<codeblock props="ios mac" outputclass="language-objectivec">- (instancetype _Nonnull)initWithSize:(CGSize)size frameRate:(AgoraVideoFrameRate)frameRate bitrate:(NSInteger)bitrate orientationMode:(AgoraVideoOutputOrientationMode)orientationMode;</codeblock>
24+
</p>
25+
</section>
26+
<section id="parameters"><title>参数</title>
27+
<parml>
28+
<plentry>
29+
<pt>size</pt>
30+
<pd>视频分辨率。</pd>
31+
</plentry>
32+
<plentry>
33+
<pt>frameRate</pt>
34+
<pd>视频帧率。详见 <xref keyref="FRAME_RATE" />。</pd>
35+
</plentry>
36+
<plentry>
37+
<pt>bitrate</pt>
38+
<pd>视频码率。</pd>
39+
</plentry>
40+
<plentry>
41+
<pt>orientationMode</pt>
42+
<pd>视频方向。详见 <xref keyref="ORIENTATION_MODE"/>。</pd>
43+
</plentry>
44+
<plentry props="rtc-ng">
45+
<pt>mirrorMode</pt>
46+
<pd>发送编码视频时是否开启镜像模式,只影响远端用户看到的视频画面。详见 <xref keyref="VIDEO_MIRROR_MODE_TYPE" />。</pd>
47+
</plentry>
48+
</parml>
49+
</section>
50+
<section id="return_values">
51+
<title>返回值</title>
52+
<p>初始化的 <apiname keyref="VideoEncoderConfiguration"/> 对象。</p>
53+
</section>
54+
</refbody>
55+
</reference>
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE reference PUBLIC "-//OASIS//DTD DITA Reference//EN" "reference.dtd">
3+
<reference id="api_agoravideoencoderconfiguration_initwithwidth">
4+
<title><ph keyref="initWithWidth"/></title>
5+
<shortdesc id="short"><ph id="shortdesc">指定视频宽和高并初始化一个 <xref keyref="VideoEncoderConfiguration"/> 对象。</ph></shortdesc>
6+
<prolog>
7+
<metadata>
8+
<keywords>
9+
<indexterm keyref="initWithWidth"/>
10+
</keywords>
11+
</metadata>
12+
</prolog>
13+
<refbody>
14+
<section id="prototype">
15+
<p outputclass="codeblock" props="rtc-ng">
16+
<codeblock props="ios mac" outputclass="language-objectivec">- (instancetype _Nonnull)initWithWidth:(NSInteger)width
17+
height:(NSInteger)height
18+
frameRate:(AgoraVideoFrameRate)frameRate
19+
bitrate:(NSInteger)bitrate
20+
orientationMode:(AgoraVideoOutputOrientationMode)orientationMode
21+
mirrorMode:(AgoraVideoMirrorMode)mirrorMode;</codeblock>
22+
</p>
23+
<p outputclass="codeblock" props="rtc">
24+
<codeblock props="ios mac" outputclass="language-objectivec">- (instancetype _Nonnull)initWithWidth:(NSInteger)width height:(NSInteger)height frameRate:(AgoraVideoFrameRate)frameRate bitrate:(NSInteger)bitrate orientationMode:(AgoraVideoOutputOrientationMode)orientationMode;</codeblock>
25+
</p>
26+
</section>
27+
<section id="parameters"><title>参数</title>
28+
<parml>
29+
<plentry>
30+
<pt>width</pt>
31+
<pd>视频宽度。</pd>
32+
</plentry>
33+
<plentry>
34+
<pt>height</pt>
35+
<pd>视频高度。</pd>
36+
</plentry>
37+
<plentry>
38+
<pt>frameRate</pt>
39+
<pd>视频帧率。详见 <xref keyref="FRAME_RATE" />。</pd>
40+
</plentry>
41+
<plentry>
42+
<pt>bitrate</pt>
43+
<pd>视频码率。</pd>
44+
</plentry>
45+
<plentry>
46+
<pt>orientationMode</pt>
47+
<pd>视频方向。详见 <xref keyref="ORIENTATION_MODE"/>。</pd>
48+
</plentry>
49+
<plentry props="rtc-ng">
50+
<pt>mirrorMode</pt>
51+
<pd>发送编码视频时是否开启镜像模式,只影响远端用户看到的视频画面。详见 <xref keyref="VIDEO_MIRROR_MODE_TYPE" />。</pd>
52+
</plentry>
53+
</parml>
54+
</section>
55+
<section id="return_values">
56+
<title>返回值</title>
57+
<p>初始化的 <apiname keyref="VideoEncoderConfiguration"/> 对象。</p>
58+
</section>
59+
</refbody>
60+
</reference>

dita/RTC/API/api_enablevirtualbackground.dita

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,22 @@
3535
</dl>
3636
<p>开启虚拟背景功能后,你可以使用自定义的背景图替代本地用户原来的背景图。替换后,频道内所有用户都能看到自定义的背景图。</p>
3737
<p props="rtc">你可以从 <xref keyref="onVirtualBackgroundSourceEnabled"/> 回调了解虚拟背景是否成功开启和相应的出错原因。</p>
38-
<note type="attention"><ul>
39-
<li>调用该方法前,请确保你已集成相应的动态库。<ul>
40-
<li props="android windows unity rn flutter">Android: <ph>libagora_segmentation_extension.so</ph></li>
41-
<li props="ios windows unity rn flutter">iOS: <ph>AgoraVideoSegmentationExtension.xcframework</ph></li>
42-
<li props="mac windows unity electron">macOS: <ph>AgoraVideoSegmentationExtension.framework</ph></li>
43-
<li props="windows">Windows: <ph>libagora_segmentation_extension.dll</ph></li>
44-
</ul></li>
45-
<li>该方法需要在 <xref keyref="enableVideo"/> 后调用。</li>
38+
<p props="rtc-ng">开启虚拟背景功能涉及一系列方法的调用,调用顺序如下: <ol>
39+
<li props="android">在初始化 <xref keyref="IRtcEngine"/> 时调用 <codeph><xref keyref="addExtension"/>(<q>agora_segmentation_extension</q>)</codeph>,在项目中集成虚拟背景动态库。</li>
40+
<li props="ios">在项目文件中链接动态库 <codeph>AgoraVideoSegmentationExtension.xcframework</codeph></li>
41+
<li props="mac">在项目文件中链接动态库 <codeph>AgoraVideoSegmentationExtension.framework</codeph></li>
42+
<li props="windows">在初始化 <xref keyref="IRtcEngine"/> 时调用 <codeph><xref keyref="loadExtensionProvider"/>(<q>libagora_segmentation_extension.dll</q>)</codeph>,指定动态库的路径和名称。</li>
43+
<li>调用 <codeph><xref keyref="enableExtension"/>(<q>agora_segmentation</q>, <q>PortraitSegmentation</q>, <q><ph keyref="true"/></q>)</codeph>,开启插件。</li>
44+
<li>调用 <xref keyref="enableVideo"/>,启用视频模块。</li>
45+
<li>调用该方法,开启虚拟背景功能。</li>
46+
</ol></p><note type="attention"><ul>
47+
<li props="rtc">调用该方法前,请确保你已集成相应的动态库。<ul>
48+
<li props="android windows unity rn flutter">Android: <ph>libagora_segmentation_extension.so</ph></li>
49+
<li props="ios windows unity rn flutter">iOS: <ph>AgoraVideoSegmentationExtension.xcframework</ph></li>
50+
<li props="mac windows unity electron">macOS: <ph>AgoraVideoSegmentationExtension.framework</ph></li>
51+
<li props="windows">Windows: <ph>libagora_segmentation_extension.dll</ph></li>
52+
</ul></li>
53+
<li props="rtc">该方法需要在 <xref keyref="enableVideo" /> 后调用。</li>
4654
<li>该功能对设备性能要求较高,Agora 推荐你在搭载如下芯片的设备上使用:<ul>
4755
<li props="android unity windows rn flutter">骁龙 700 系列 750G 及以上</li>
4856
<li props="android unity windows rn flutter">骁龙 800 系列 835 及以上</li>
@@ -70,8 +78,8 @@
7078
<pt props="windows android unity flutter">enabled</pt>
7179
<pt props="ios mac">enable</pt>
7280
<pd>是否开启虚拟背景:<ul>
73-
<li><ph keyref="true"/>: 开启。</li>
74-
<li><ph keyref="false"/>: 关闭。</li>
81+
<li><codeph><ph keyref="true" /></codeph>: 开启。</li>
82+
<li><codeph><ph keyref="false" /></codeph>: 关闭。</li>
7583
</ul></pd>
7684
</plentry>
7785
<plentry>

dita/RTC/API/api_imediaengine_pullaudioframe.dita

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,12 @@
2323
</p>
2424
</section>
2525
<section id="detailed_desc">
26-
<p props="rtc">使用该方法前,你需要调用 <xref keyref="setExternalAudioSink"/> 通知 app 开启并设置外部渲染。</p>
27-
<p props="rtc-ng">
28-
<ph props="android windows">使用该方法前,你需要在 <xref keyref="RtcEngineConfig"/> 中设置 <parmname props="android">mEnableAudioDevice</parmname><parmname props="windows">enableAudioDevice</parmname> 为 <codeph><ph keyref="false"/></codeph>, 并调用 <xref keyref="setExternalAudioSink"/> 通知 app 开启并设置外部渲染。</ph>
29-
<ph props="ios mac">使用该方法前,你需要调用 <xref keyref="setExternalAudioSink"/> 通知 app 开启并设置外部渲染。</ph>
30-
</p>
26+
<p props="rtc">使用该方法前,你需要调用 <xref keyref="setExternalAudioSink" /> 通知 app 开启并设置外部渲染。</p>
27+
<p props="rtc-ng">使用该方法前,你需要在 <xref keyref="RtcEngineConfig"/> 中设置 <parmname props="android">mEnableAudioDevice</parmname><parmname props="ios mac windows">enableAudioDevice</parmname> 为 <codeph><ph keyref="false"/></codeph>, 并调用 <xref keyref="setExternalAudioSink"/> 通知 app 开启并设置外部渲染。</p>
3128
<p>调用该方法后,app 会采取主动拉取的方式获取远端已解码和混音后的音频数据,用于音频播放。</p>
3229
<note type="attention">
3330
<ul>
31+
<li>该方法需要在加入频道后调用。</li>
3432
<li>开启外部音频渲染后,app 将无法从 <xref keyref="onPlaybackAudioFrame"/> 回调中获得数据。</li>
3533
<li>该方法和 <apiname keyref="onPlaybackAudioFrame"/> 回调相比,区别在于:
3634
<ul><li>SDK 通过 <apiname keyref="onPlaybackAudioFrame"/> 回调将音频数据传输给 app。如果 app 处理延时,可能会导致音频播放抖动。</li>

dita/RTC/API/api_imediaengine_pushaudioframe2_ng.dita

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@
2424
<codeblock props="flutter" outputclass="language-dart"/>
2525
</p>
2626
</section>
27+
<section id="detailed_desc">
28+
<note type="attention" props="android ios">
29+
<p>调用该方法前,请将 <xref keyref="DirectCdnStreamingMediaOptions"></xref> 中的 <parmname>publishCustomAudioTrack</parmname> 设为 <codeph><xref keyref="true"/></codeph>。</p>
30+
</note>
31+
</section>
2732
<section id="parameters"><title>参数</title>
2833
<parml>
2934
<plentry conkeyref="pushAudioFrame1/data">
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE reference PUBLIC "-//OASIS//DTD DITA Reference//EN" "reference.dtd">
3+
<reference id="api_imediaplayer_enableautoswitchagoracdn">
4+
<title><ph keyref="enableAutoSwitchAgoraCDN"/></title>
5+
<shortdesc id="short"><ph id="shortdesc">开启/关闭自动切换媒体资源的 CDN 线路。</ph></shortdesc>
6+
<prolog>
7+
<metadata>
8+
<keywords>
9+
<indexterm keyref="enableAutoSwitchAgoraCDN"/>
10+
</keywords>
11+
</metadata>
12+
</prolog>
13+
<refbody>
14+
<section id="prototype">
15+
<p outputclass="codeblock">
16+
<codeblock props="android" outputclass="language-java">int enableAutoSwitchAgoraCDN(boolean enable);
17+
</codeblock>
18+
<codeblock props="ios mac" outputclass="language-objectivec">- (int)enableAutoSwitchAgoraCDN:(BOOL)enable;
19+
</codeblock>
20+
<codeblock props="windows" outputclass="language-cpp">virtual int enableAutoSwitchAgoraCDN(bool enable) = 0;
21+
</codeblock>
22+
<codeblock props="electron" outputclass="language-typescript"/>
23+
<codeblock props="unity" outputclass="language-csharp"/>
24+
<codeblock props="rn" outputclass="language-typescript"/>
25+
<codeblock props="flutter" outputclass="language-dart"/>
26+
</p>
27+
</section>
28+
<section id="detailed_desc">
29+
<p>如果你想设置 SDK 根据网络情况自动切换媒体资源 CDN 线路,你可以调用该方法。</p><note type="note">
30+
<p>请在 <xref keyref="openWithAgoraCDNSrc"/> 前调用该方法。</p>
31+
</note>
32+
</section>
33+
<section id="parameters"><title>参数</title>
34+
<parml>
35+
<plentry>
36+
<pt>enable</pt>
37+
<pd>设置是否开启自动切换媒体资源的 CDN 线路:<ul>
38+
<li><codeph><ph keyref="true"/></codeph>:开启自动切换媒体资源的 CDN 线路。</li>
39+
<li><codeph><ph keyref="false"/></codeph>:(默认) 关闭自动切换媒体资源的 CDN 线路。</li>
40+
</ul></pd>
41+
</plentry>
42+
</parml>
43+
</section>
44+
<section id="return_values">
45+
<title>返回值</title>
46+
<ul>
47+
<li>0: 方法调用成功。</li>
48+
<li>&lt; 0: 方法调用失败。</li>
49+
</ul>
50+
</section>
51+
</refbody>
52+
</reference>
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE reference PUBLIC "-//OASIS//DTD DITA Reference//EN" "reference.dtd">
3+
<reference id="api_imediaplayer_getagoracdnlinecount">
4+
<title><ph keyref="getAgoraCDNLineCount"/></title>
5+
<shortdesc id="short"><ph id="shortdesc">获取媒体资源的 CDN 线路数量。</ph></shortdesc>
6+
<prolog>
7+
<metadata>
8+
<keywords>
9+
<indexterm keyref="getAgoraCDNLineCount"/>
10+
</keywords>
11+
</metadata>
12+
</prolog>
13+
<refbody>
14+
<section id="prototype">
15+
<p outputclass="codeblock">
16+
<codeblock props="android" outputclass="language-java">int getAgoraCDNLineCount();
17+
</codeblock>
18+
<codeblock props="ios mac" outputclass="language-objectivec">- (int)getAgoraCDNLineCount;
19+
</codeblock>
20+
<codeblock props="windows" outputclass="language-cpp">virtual int getAgoraCDNLineCount() = 0;
21+
</codeblock>
22+
<codeblock props="electron" outputclass="language-typescript"/>
23+
<codeblock props="unity" outputclass="language-csharp"/>
24+
<codeblock props="rn" outputclass="language-typescript"/>
25+
<codeblock props="flutter" outputclass="language-dart"/>
26+
</p>
27+
</section>
28+
<section id="return_values">
29+
<title>返回值</title>
30+
<ul>
31+
<li>&gt; 0:方法调用成功,返回媒体资源的 CDN 线路数量。</li>
32+
<li>≤ 0:方法调用失败。</li>
33+
</ul>
34+
</section>
35+
</refbody>
36+
</reference>
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE reference PUBLIC "-//OASIS//DTD DITA Reference//EN" "reference.dtd">
3+
<reference id="api_imediaplayer_getcurrentagoracdnindex">
4+
<title><ph keyref="getCurrentAgoraCDNIndex"/></title>
5+
<shortdesc id="short"><ph id="shortdesc">获取当前使用的媒体资源的 CDN 线路索引。</ph></shortdesc>
6+
<prolog>
7+
<metadata>
8+
<keywords>
9+
<indexterm keyref="getCurrentAgoraCDNIndex"/>
10+
</keywords>
11+
</metadata>
12+
</prolog>
13+
<refbody>
14+
<section id="prototype">
15+
<p outputclass="codeblock">
16+
<codeblock props="android" outputclass="language-java">int getCurrentAgoraCDNIndex();
17+
</codeblock>
18+
<codeblock props="ios mac" outputclass="language-objectivec">- (int)getCurrentAgoraCDNIndex;
19+
</codeblock>
20+
<codeblock props="windows" outputclass="language-cpp">virtual int getCurrentAgoraCDNIndex() = 0;
21+
</codeblock>
22+
<codeblock props="electron" outputclass="language-typescript"/>
23+
<codeblock props="unity" outputclass="language-csharp"/>
24+
<codeblock props="rn" outputclass="language-typescript"/>
25+
<codeblock props="flutter" outputclass="language-dart"/>
26+
</p>
27+
</section>
28+
<section id="return_values">
29+
<title>返回值</title>
30+
<ul>
31+
<li>≥ 0: 方法调用成功,返回媒体资源的 CDN 线路索引。数值范围为 [0, <apiname keyref="getAgoraCDNLineCount"/><codeph>()</codeph>)。</li>
32+
<li>&lt; 0: 方法调用失败。</li>
33+
</ul>
34+
35+
</section>
36+
</refbody>
37+
</reference>

dita/RTC/API/api_imediaplayer_open.dita

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!DOCTYPE reference PUBLIC "-//OASIS//DTD DITA Reference//EN" "reference.dtd">
33
<reference id="api_imediaplayer_open">
4-
<title><ph keyref="open"/></title>
5-
<shortdesc id="short"><ph id="shortdesc">打开媒体文件。</ph></shortdesc>
4+
<title><ph keyref="open" /></title>
5+
<shortdesc id="short"><ph id="shortdesc">打开媒体资源。</ph></shortdesc>
66
<prolog>
77
<metadata>
88
<keywords>
@@ -15,7 +15,7 @@
1515
<p outputclass="codeblock">
1616
<codeblock props="android" outputclass="language-java">int open(String url, long startPos);
1717
</codeblock>
18-
<codeblock props="ios mac" outputclass="language-objectivec">- (void)open:(NSString *)url startPos:(NSInteger)startPos;
18+
<codeblock props="ios mac" outputclass="language-objectivec">- (int)open:(NSString *)url startPos:(NSInteger)startPos;
1919
</codeblock>
2020
<codeblock props="windows" outputclass="language-cpp">virtual int open(const char* url, int64_t startPos) = 0;</codeblock>
2121
<codeblock props="electron" outputclass="language-typescript"/>
@@ -24,6 +24,9 @@
2424
<codeblock props="flutter" outputclass="language-dart"/>
2525
</p>
2626
</section>
27+
<section id="detailed_desc" props="android ios">
28+
<p>如果用户需要自定义播放线路,你可以调用 <xref keyref="openWithAgoraCDNSrc"/>。Agora 会通过自研调度中心支持调度线路,提升观看用户体验。如果用户不需要自定义播放线路,你可以调用 <apiname>open</apiname>。</p>
29+
</section>
2730
<section id="parameters"><title>参数</title>
2831
<parml>
2932
<plentry>

0 commit comments

Comments
 (0)