Skip to content

Commit

Permalink
onevent tbd
Browse files Browse the repository at this point in the history
  • Loading branch information
Suri539 committed Oct 15, 2024
1 parent 40bb6c3 commit d4fc1b5
Show file tree
Hide file tree
Showing 7 changed files with 181 additions and 23 deletions.
35 changes: 14 additions & 21 deletions dita/RTC-NG/API/callback_playerobserver_onresolutionchanged.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="callback_onresolutionchanged">
<title><ph keyref="onResolutionChanged"/></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 @@ -13,10 +13,10 @@
<refbody>
<section id="prototype">
<p outputclass="codeblock">
<codeblock props="android" outputclass="language-java"/>
<codeblock props="android" outputclass="language-java">public void onResolutionChanged(int width, int height){}</codeblock>
<codeblock props="hmos" outputclass="language-arkts"/>
<codeblock props="ios mac" outputclass="language-objectivec"/>
<codeblock props="cpp unreal" outputclass="language-cpp"/>
<codeblock props="ios mac" outputclass="language-objectivec">- (void)onResolutionChanged:(int)width height:(int)height;</codeblock>
<codeblock props="cpp unreal" outputclass="language-cpp">virtual void onResolutionChanged(int width, int height) = 0;</codeblock>
<codeblock props="bp" outputclass="language-cpp"/>
<codeblock props="cs" outputclass="language-csharp"/>
<codeblock props="electron" outputclass="language-typescript"/>
Expand All @@ -28,37 +28,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>如果你需要监控播放器所播放视频流分辨率的变化,需要在调用 <xref keyref="RegisterObserver_Player"/> 方法时注册该回调。</p>
</section>
<section id="timing" deliveryTarget="details">
<title>触发时机</title>
<p/>
<p>当视频流的分辨率发生变化时,SDK 会触发该回调报告当前视频的宽高。</p>
</section>
<section id="restriction" deliveryTarget="details">
<title>使用限制</title>
<p/>
<p>无。</p>
</section>
<section id="parameters" deliveryTarget="details">
<title>参数</title>
<parml>
<plentry>
<pt><?oxy-placeholder content="The name of the parameter."?></pt>
<pd><?oxy-placeholder content="The description of the parameter. Please specify if the parameter is optional, output, and has a default value or value range."?></pd>
<pt>width</pt>
<pd>视频帧的宽度(px)。</pd>
</plentry>
<plentry>
<pt>height</pt>
<pd>视频帧的高度(px)。</pd>
</plentry>
</parml> </section>
<section id="return_values">
<title><ph keyref="return-section-title"/></title>
<p props="flutter">方法成功调用时,无返回值;方法调用失败时,会抛出 <xref keyref="AgoraRtcException"/> 异常,你需要捕获异常并进行处理。</p>
<ul props="native electron unity rn unreal bp">
<li>0: 方法调用成功。</li>
<li>&lt; 0: 方法调用失败。<ph props="cn">详见<xref keyref="error-code-link"/>了解详情和解决建议。</ph></li>
</ul> </section>
</refbody>
</reference>
32 changes: 30 additions & 2 deletions dita/RTC-NG/API/enum_rteplayerstate.dita
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,36 @@
<title>枚举值</title>
<parml>
<plentry>
<pt><?oxy-placeholder content="The name of the enumerator."?></pt>
<pd><?oxy-placeholder content="The description of the enumerator."?></pd>
<pt><ph keyref="kRtePlayerStateIdle"/></pt>
<pd>0:空闲状态。//TODO 播放器会在你打开 URL 之前和结束播放之后会报告该状态码。</pd>
</plentry>
<plentry>
<pt><ph keyref="kRtePlayerStateOpening"/></pt>
<pd>1:正在打开 URL 资源。当调用 <xref keyref="OpenWithUrl"/> 后会报告该状态码。</pd>
</plentry>
<plentry>
<pt><ph keyref="kRtePlayerStateOpenCompleted"/></pt>
<pd>2:成功打开 URL 资源。当调用 <xref keyref="OpenWithUrl"/> 成功打开 URL 资源后会报告该状态码。</pd>
</plentry>
<plentry>
<pt><ph keyref="kRtePlayerStatePlaying"/></pt>
<pd>3:播放中。//TODO 当打开 rte url 时,订阅主播成功回调此状态。观众端调用 open 打开 url 并播放后会回调这个状态吗?</pd>
</plentry>
<plentry>
<pt><ph keyref="kRtePlayerStatePaused"/></pt>
<pd>4:暂停播放。当成功调用 <xref keyref="Pause_Player"/> 后会报告该状态码。</pd>
</plentry>
<plentry>
<pt><ph keyref="kRtePlayerStatePlaybackCompleted"/></pt>
<pd>5:播放完成。//TODO 当主播结束推流退出房间后,会报告该状态码。这个状态码是观众端和主播端都会报告吗?</pd>
</plentry>
<plentry>
<pt><ph keyref="kRtePlayerStateStopped"/></pt>
<pd>6:停止播放。当成功调用 <xref keyref="Stop_Player"/> 后会报告该状态码。</pd>
</plentry>
<plentry>
<pt><ph keyref="kRtePlayerStateFailed"/></pt>
<pd>7:失败状态。当内部发生错误时会报告该状态码。</pd>
</plentry>
</parml>
</section></refbody>
Expand Down
1 change: 1 addition & 0 deletions dita/RTC-NG/API/rtc_api_data_type.dita
Original file line number Diff line number Diff line change
Expand Up @@ -1245,6 +1245,7 @@
<li><xref keyref="RENDER_MODE_TYPE"/></li>
<li><xref keyref="RHYTHM_PLAYER_REASON"/></li>
<li><xref keyref="RHYTHM_PLAYER_STATE_TYPE"/></li>
<li><xref keyref="RtePlayerState"/></li>
<li><xref keyref="RteVideoMirrorMode"/></li>
<li><xref keyref="RteVideoRenderMode"/></li>
<li><xref keyref="RTMP_STREAM_LIFE_CYCLE_TYPE"/></li>
Expand Down
1 change: 1 addition & 0 deletions dita/RTC-NG/RTC_NG_API_CPP.ditamap
Original file line number Diff line number Diff line change
Expand Up @@ -485,6 +485,7 @@
<topicref keyref="UnregisterObserver_Player" toc="no"/>
<topicref keyref="RegisterObserver_Rte" toc="no" props="hide"/>
<topicref keyref="UnregisterObserver_Rte" toc="no" props="hide"/>
<topicref keyref="onResolutionChanged" toc="no"/>
<topicref keyref="onStateChanged" toc="no"/>
</topicref>
<topicref href="API/toc_rhythmplayer.dita" chunk="to-content">
Expand Down
64 changes: 64 additions & 0 deletions dita/RTC-NG/config/callback_playerobserver_onevent.dita
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE reference PUBLIC "-//OASIS//DTD DITA Reference//EN" "reference.dtd">
<reference id="callback_playerobserver_onevent">
<title><ph keyref="onEvent"/></title>
<shortdesc id="short"><ph id="shortdesc"></ph></shortdesc>
<prolog>
<metadata>
<keywords>
<indexterm keyref="onEvent"/>
</keywords>
</metadata>
</prolog>
<refbody>
<section id="prototype">
<p outputclass="codeblock">
<codeblock props="android" outputclass="language-java">public void onEvent(int event){}</codeblock>
<codeblock props="hmos" outputclass="language-arkts"/>
<codeblock props="ios mac" outputclass="language-objectivec">- (void)onEvent:(AgoraRtePlayerEvent)event;</codeblock>
<codeblock props="cpp unreal" outputclass="language-cpp">virtual void onEvent(PlayerEvent event) = 0;</codeblock>
<codeblock props="bp" outputclass="language-cpp"/>
<codeblock props="cs" outputclass="language-csharp"/>
<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="parameters" deliveryTarget="details">
<title>参数</title>
<parml>
<plentry>
<pt><?oxy-placeholder content="The name of the parameter."?></pt>
<pd><?oxy-placeholder content="The description of the parameter. Please specify if the parameter is optional, output, and has a default value or value range."?></pd>
</plentry>
</parml> </section>
<section id="return_values">
<title><ph keyref="return-section-title"/></title>
<p props="flutter">方法成功调用时,无返回值;方法调用失败时,会抛出 <xref keyref="AgoraRtcException"/> 异常,你需要捕获异常并进行处理。</p>
<ul props="native electron unity rn unreal bp">
<li>0: 方法调用成功。</li>
<li>&lt; 0: 方法调用失败。<ph props="cn">详见<xref keyref="error-code-link"/>了解详情和解决建议。</ph></li>
</ul> </section>
</refbody>
</reference>
70 changes: 70 additions & 0 deletions dita/RTC-NG/config/keys-rtc-ng-api-cpp.ditamap
Original file line number Diff line number Diff line change
Expand Up @@ -1199,6 +1199,13 @@
</keydef>
</topichead>
<topichead navtitle="rte 播放器事件">
<keydef keys="onResolutionChanged" href="../API/callback_playerobserver_onresolutionchanged.dita">
<topicmeta>
<keywords>
<keyword>onResolutionChanged</keyword>
</keywords>
</topicmeta>
</keydef>
<keydef keys="onStateChanged" href="../API/callback_playerobserver_onstatechanged.dita">
<topicmeta>
<keywords>
Expand Down Expand Up @@ -11600,6 +11607,69 @@
<keyword>RTMP_STREAM_PUBLISH_STATE_DISCONNECTING</keyword>
</keywords>
</topicmeta>
</keydef>
<keydef keys="RtePlayerState" href="../API/enum_rteplayerstate.dita">
<topicmeta>
<keywords>
<keyword>RtePlayerState</keyword>
</keywords>
</topicmeta>
</keydef>
<keydef keys="kRtePlayerStateIdle">
<topicmeta>
<keywords>
<keyword>kRtePlayerStateIdle</keyword>
</keywords>
</topicmeta>
</keydef>
<keydef keys="kRtePlayerStateOpening">
<topicmeta>
<keywords>
<keyword>kRtePlayerStateOpening</keyword>
</keywords>
</topicmeta>
</keydef>
<keydef keys="kRtePlayerStateOpenCompleted">
<topicmeta>
<keywords>
<keyword>kRtePlayerStateOpenCompleted</keyword>
</keywords>
</topicmeta>
</keydef>
<keydef keys="kRtePlayerStatePlaying">
<topicmeta>
<keywords>
<keyword>kRtePlayerStatePlaying</keyword>
</keywords>
</topicmeta>
</keydef>
<keydef keys="kRtePlayerStatePaused">
<topicmeta>
<keywords>
<keyword>kRtePlayerStatePaused</keyword>
</keywords>
</topicmeta>
</keydef>
<keydef keys="kRtePlayerStatePlaybackCompleted">
<topicmeta>
<keywords>
<keyword>kRtePlayerStatePlaybackCompleted</keyword>
</keywords>
</topicmeta>
</keydef>
<keydef keys="kRtePlayerStateStopped">
<topicmeta>
<keywords>
<keyword>kRtePlayerStateStopped</keyword>
</keywords>
</topicmeta>
</keydef>
<keydef keys="kRtePlayerStateFailed">
<topicmeta>
<keywords>
<keyword>kRtePlayerStateFailed</keyword>
</keywords>
</topicmeta>
</keydef>
<keydef keys="RTMP_STREAMING_EVENT" href="../API/enum_rtmpstreamingevent.dita">
<topicmeta>
Expand Down
1 change: 1 addition & 0 deletions dita/RTC-NG/config/relations-rtc-ng-api.ditamap
Original file line number Diff line number Diff line change
Expand Up @@ -3350,6 +3350,7 @@
</relrow>
<relrow>
<relcell>
<topicref keyref="onResolutionChanged"/>
<topicref keyref="onStateChanged"/>
</relcell>
<relcell>
Expand Down

0 comments on commit d4fc1b5

Please sign in to comment.