Browse Source

更新版本到 2.0.0-alpha.5

ChangeLog
1. 新增 player-status-change 类型的 RtcPlayerEvent
2. 新增 first-key-frame 类型的 RtcStreamEvent
3. 新增 getSupportedCodec 方法
4. RoomType 使用 conference 代替 rtc
5. 文档修正
kevin.song 4 years ago
parent
commit
34fc6ff30f

+ 5 - 1
README.md

@@ -32,6 +32,7 @@
 * RtcEvent - URTC 事件,主要有以下几类
   *  [RtcUserEvent](https://ucloud.github.io/urtc-sdk-web/index.html#rtcuserevent)
   *  [RtcStreamEvent](https://ucloud.github.io/urtc-sdk-web/index.html#rtcstreamevent)
+  *  [RtcPlayerEvent](https://ucloud.github.io/urtc-sdk-web/index.html#rtcplayerevent)
   *  [RtcConnectionEvent](https://ucloud.github.io/urtc-sdk-web/index.html#rtcconnectionevent)
 
 ### URTC 全局属性或方法
@@ -46,6 +47,7 @@
 * [getMicrophones](https://ucloud.github.io/urtc-sdk-web/index.html#getmicrophones) - 获取麦克风设备列表
 * [isSupportScreenShare](https://ucloud.github.io/urtc-sdk-web/index.html#issupportscreenshare) - 检测浏览器是否支持屏幕共享
 * [isSupportWebRTC](https://ucloud.github.io/urtc-sdk-web/index.html#issupportwebrtc) - 检测浏览器是否完全(可访问本地音视频设备)支持 WebRTC
+* [getSupportedCodec](https://ucloud.github.io/urtc-sdk-web/index.html#getsupportedcodec) - 检测浏览器支持的WebRTC的音视频编解码格式
 * [reportLog](https://ucloud.github.io/urtc-sdk-web/index.html#reportlog) - 开启/关闭操作/错误/状态日志的上报
 * [setLogLevel](https://ucloud.github.io/urtc-sdk-web/index.html#setloglevel) - 设置日志打印级别,用于打印出更多日志来调试或定位问题
 * [setServers](https://ucloud.github.io/urtc-sdk-web/index.html#setservers) - 用于私有化部署时,指定部署的服务器地址
@@ -99,7 +101,7 @@ LocalStream 对象包含以下方法:
 * [muteAudio](https://ucloud.github.io/urtc-sdk-web/classes/localstream.html#muteaudio) - mute 当前流的音频
 * [muteVideo](https://ucloud.github.io/urtc-sdk-web/classes/localstream.html#mutevideo) - mute 当前流的视频
 * [off](https://ucloud.github.io/urtc-sdk-web/classes/localstream.html#off) - 取消监听流对象事件
-* [on](https://ucloud.github.io/urtc-sdk-web/classes/localstream.html#on) - 监听流对象事件
+* [on](https://ucloud.github.io/urtc-sdk-web/classes/localstream.html#on) - 监听流对象事件,可监听的事件类型有 [RtcStreamEventType](https://ucloud.github.io/urtc-sdk-web/index.html#rtcstreameventtype)、[RtcPlayerEventType](https://ucloud.github.io/urtc-sdk-web/index.html#rtcplayereventtype)
 * [play](https://ucloud.github.io/urtc-sdk-web/classes/localstream.html#play) - 播放当前流
 * [removeTrack](https://ucloud.github.io/urtc-sdk-web/classes/localstream.html#removetrack) - 从当前流中删除一条媒体轨道(音轨或视轨)
 * [replaceTrack](https://ucloud.github.io/urtc-sdk-web/classes/localstream.html#replacetrack) - 替换当前流中的媒体轨道
@@ -135,6 +137,8 @@ RemoteStream 对象包含以下方法:
 * [hasVideo](https://ucloud.github.io/urtc-sdk-web/classes/remotestream.html#hasvideo) - 判断当前流是否有视频
 * [muteAudio](https://ucloud.github.io/urtc-sdk-web/classes/remotestream.html#muteaudio) - mute 当前流的音频
 * [muteVideo](https://ucloud.github.io/urtc-sdk-web/classes/remotestream.html#mutevideo) - mute 当前流的视频
+* [off](https://ucloud.github.io/urtc-sdk-web/classes/localstream.html#off) - 取消监听流对象事件
+* [on](https://ucloud.github.io/urtc-sdk-web/classes/localstream.html#on) - 监听流对象事件,可监听的事件类型有 [RtcStreamEventType](https://ucloud.github.io/urtc-sdk-web/index.html#rtcstreameventtype)、[RtcPlayerEventType](https://ucloud.github.io/urtc-sdk-web/index.html#rtcplayereventtype)
 * [play](https://ucloud.github.io/urtc-sdk-web/classes/remotestream.html#play) - 播放当前流
 * [resume](https://ucloud.github.io/urtc-sdk-web/classes/remotestream.html#resume) - 恢复播放流,一般由于浏览器限制无法自动播放时,可提示用户手动触发该方法进行恢复播放
 * [setAudioVolume](https://ucloud.github.io/urtc-sdk-web/classes/remotestream.html#setaudiovolume) - 设置输出音量,默认为 100

File diff suppressed because it is too large
+ 31 - 23
docs/classes/localstream.html


+ 2 - 4
docs/classes/remotestream.html

@@ -231,10 +231,8 @@
 							</aside>
 							<div class="tsd-comment tsd-typography">
 								<div class="lead">
-									<p>销毁当前流,一般在本地流不再被使用时,可调用此方法销毁,解除摄像头或麦克风设备的占用。</p>
-									<blockquote>
-										<p>注:远端流,不需要手动调用此方法</p>
-									</blockquote>
+									<p>销毁当前流,一般在本地流不再被使用时,可调用此方法销毁,解除摄像头或麦克风设备的占用。
+									注:远端流,不需要手动调用此方法</p>
 								</div>
 								<dl class="tsd-comment-tags">
 									<dt>example</dt>

+ 2 - 4
docs/classes/stream.html

@@ -193,10 +193,8 @@
 							</aside>
 							<div class="tsd-comment tsd-typography">
 								<div class="lead">
-									<p>销毁当前流,一般在本地流不再被使用时,可调用此方法销毁,解除摄像头或麦克风设备的占用。</p>
-									<blockquote>
-										<p>注:远端流,不需要手动调用此方法</p>
-									</blockquote>
+									<p>销毁当前流,一般在本地流不再被使用时,可调用此方法销毁,解除摄像头或麦克风设备的占用。
+									注:远端流,不需要手动调用此方法</p>
 								</div>
 								<dl class="tsd-comment-tags">
 									<dt>example</dt>

File diff suppressed because it is too large
+ 123 - 174
docs/index.html


+ 167 - 0
docs/interfaces/codecs.html

@@ -0,0 +1,167 @@
+<!doctype html>
+<html class="default no-js">
+<head>
+	<meta charset="utf-8">
+	<meta http-equiv="X-UA-Compatible" content="IE=edge">
+	<title>Codecs | @urtc/sdk-web</title>
+	<meta name="description" content="Documentation for @urtc/sdk-web">
+	<meta name="viewport" content="width=device-width, initial-scale=1">
+	<link rel="stylesheet" href="../assets/css/main.css">
+</head>
+<body>
+<header>
+	<div class="tsd-page-toolbar">
+		<div class="container">
+			<div class="table-wrap">
+				<div class="table-cell" id="tsd-search" data-index="../assets/js/search.json" data-base="..">
+					<div class="field">
+						<label for="tsd-search-field" class="tsd-widget search no-caption">Search</label>
+						<input id="tsd-search-field" type="text" />
+					</div>
+					<ul class="results">
+						<li class="state loading">Preparing search index...</li>
+						<li class="state failure">The search index is not available</li>
+					</ul>
+					<a href="../index.html" class="title">@urtc/sdk-web</a>
+				</div>
+				<div class="table-cell" id="tsd-widgets">
+					<div id="tsd-filter">
+						<a href="#" class="tsd-widget options no-caption" data-toggle="options">Options</a>
+						<div class="tsd-filter-group">
+							<div class="tsd-select" id="tsd-filter-visibility">
+								<span class="tsd-select-label">All</span>
+								<ul class="tsd-select-list">
+									<li data-value="public">Public</li>
+									<li data-value="protected">Public/Protected</li>
+									<li data-value="private" class="selected">All</li>
+								</ul>
+							</div>
+							<input type="checkbox" id="tsd-filter-inherited" checked />
+							<label class="tsd-widget" for="tsd-filter-inherited">Inherited</label>
+							<input type="checkbox" id="tsd-filter-externals" checked />
+							<label class="tsd-widget" for="tsd-filter-externals">Externals</label>
+						</div>
+					</div>
+					<a href="#" class="tsd-widget menu no-caption" data-toggle="menu">Menu</a>
+				</div>
+			</div>
+		</div>
+	</div>
+	<div class="tsd-page-title">
+		<div class="container">
+			<ul class="tsd-breadcrumb">
+				<li>
+					<a href="../index.html">Globals</a>
+				</li>
+				<li>
+					<a href="codecs.html">Codecs</a>
+				</li>
+			</ul>
+			<h1>Interface Codecs</h1>
+		</div>
+	</div>
+</header>
+<div class="container container-main">
+	<div class="row">
+		<div class="col-8 col-content">
+			<section class="tsd-panel tsd-comment">
+				<div class="tsd-comment tsd-typography">
+					<div class="lead">
+						<p>支持的音频、视频编解码格式</p>
+					</div>
+				</div>
+			</section>
+			<section class="tsd-panel tsd-hierarchy">
+				<h3>Hierarchy</h3>
+				<ul class="tsd-hierarchy">
+					<li>
+						<span class="target">Codecs</span>
+					</li>
+				</ul>
+			</section>
+			<section class="tsd-panel-group tsd-index-group">
+				<h2>Index</h2>
+				<section class="tsd-panel tsd-index-panel">
+					<div class="tsd-index-content">
+						<section class="tsd-index-section tsd-is-external">
+							<h3>Properties</h3>
+							<ul class="tsd-index-list">
+								<li class="tsd-kind-property tsd-parent-kind-interface tsd-is-external"><a href="codecs.html#audio" class="tsd-kind-icon">audio</a></li>
+								<li class="tsd-kind-property tsd-parent-kind-interface tsd-is-external"><a href="codecs.html#video" class="tsd-kind-icon">video</a></li>
+							</ul>
+						</section>
+					</div>
+				</section>
+			</section>
+			<section class="tsd-panel-group tsd-member-group tsd-is-external">
+				<h2>Properties</h2>
+				<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-external">
+					<a name="audio" class="tsd-anchor"></a>
+					<h3>audio</h3>
+					<div class="tsd-signature tsd-kind-icon">audio<span class="tsd-signature-symbol">:</span> <a href="../index.html#audiocodec" class="tsd-signature-type">AudioCodec</a><span class="tsd-signature-symbol">[]</span></div>
+					<aside class="tsd-sources">
+					</aside>
+					<div class="tsd-comment tsd-typography">
+						<div class="lead">
+							<p>音频编解码格式</p>
+						</div>
+					</div>
+				</section>
+				<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-external">
+					<a name="video" class="tsd-anchor"></a>
+					<h3>video</h3>
+					<div class="tsd-signature tsd-kind-icon">video<span class="tsd-signature-symbol">:</span> <a href="../index.html#videocodec" class="tsd-signature-type">VideoCodec</a><span class="tsd-signature-symbol">[]</span></div>
+					<aside class="tsd-sources">
+					</aside>
+					<div class="tsd-comment tsd-typography">
+						<div class="lead">
+							<p>视频编解码格式</p>
+						</div>
+					</div>
+				</section>
+			</section>
+		</div>
+		<div class="col-4 col-menu menu-sticky-wrap menu-highlight">
+			<nav class="tsd-navigation primary">
+				<ul>
+					<li class="globals  ">
+						<a href="../index.html"><em>Globals</em></a>
+					</li>
+				</ul>
+			</nav>
+			<nav class="tsd-navigation secondary menu-sticky">
+				<ul class="before-current">
+				</ul>
+				<ul class="current">
+					<li class="current tsd-kind-interface tsd-is-external">
+						<a href="codecs.html" class="tsd-kind-icon">Codecs</a>
+						<ul>
+							<li class=" tsd-kind-property tsd-parent-kind-interface tsd-is-external">
+								<a href="codecs.html#audio" class="tsd-kind-icon">audio</a>
+							</li>
+							<li class=" tsd-kind-property tsd-parent-kind-interface tsd-is-external">
+								<a href="codecs.html#video" class="tsd-kind-icon">video</a>
+							</li>
+						</ul>
+					</li>
+				</ul>
+				<ul class="after-current">
+				</ul>
+			</nav>
+		</div>
+	</div>
+</div>
+<footer class="with-border-bottom">
+	<div class="container">
+		<h2>Legend</h2>
+		<div class="tsd-legend-group">
+		</div>
+	</div>
+</footer>
+<div class="container tsd-generator">
+	<p>Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p>
+</div>
+<div class="overlay"></div>
+<script src="../assets/js/main.js"></script>
+</body>
+</html>

+ 1 - 1
docs/interfaces/joinoptions.html

@@ -115,7 +115,7 @@
 					</aside>
 					<div class="tsd-comment tsd-typography">
 						<div class="lead">
-							<p>加入房间的<a href="../index.html#roomtype">房间类型</a>,默认 &#39;rtc&#39;</p>
+							<p>加入房间的<a href="../index.html#roomtype">房间类型</a>,默认 &#39;conference&#39;</p>
 						</div>
 					</div>
 				</section>

+ 2 - 4
docs/interfaces/localstreamoptions.html

@@ -181,10 +181,8 @@
 					</aside>
 					<div class="tsd-comment tsd-typography">
 						<div class="lead">
-							<p>是否读取屏幕共享的音频,默认: false</p>
-							<blockquote>
-								<p>注:仅部分浏览器支持,如 Chrome 74,且不同系统表现不同,如 windows 会读取桌面音频,macOS 只支持读取浏览器 tab 中的音频,</p>
-							</blockquote>
+							<p>是否读取屏幕共享的音频,默认: false
+							注:仅部分浏览器支持,如 Chrome 74,且不同系统表现不同,如 windows 会读取桌面音频,macOS 只支持读取浏览器 tab 中的音频,</p>
 						</div>
 					</div>
 				</section>

+ 183 - 0
docs/interfaces/playereventdata.html

@@ -0,0 +1,183 @@
+<!doctype html>
+<html class="default no-js">
+<head>
+	<meta charset="utf-8">
+	<meta http-equiv="X-UA-Compatible" content="IE=edge">
+	<title>PlayerEventData | @urtc/sdk-web</title>
+	<meta name="description" content="Documentation for @urtc/sdk-web">
+	<meta name="viewport" content="width=device-width, initial-scale=1">
+	<link rel="stylesheet" href="../assets/css/main.css">
+</head>
+<body>
+<header>
+	<div class="tsd-page-toolbar">
+		<div class="container">
+			<div class="table-wrap">
+				<div class="table-cell" id="tsd-search" data-index="../assets/js/search.json" data-base="..">
+					<div class="field">
+						<label for="tsd-search-field" class="tsd-widget search no-caption">Search</label>
+						<input id="tsd-search-field" type="text" />
+					</div>
+					<ul class="results">
+						<li class="state loading">Preparing search index...</li>
+						<li class="state failure">The search index is not available</li>
+					</ul>
+					<a href="../index.html" class="title">@urtc/sdk-web</a>
+				</div>
+				<div class="table-cell" id="tsd-widgets">
+					<div id="tsd-filter">
+						<a href="#" class="tsd-widget options no-caption" data-toggle="options">Options</a>
+						<div class="tsd-filter-group">
+							<div class="tsd-select" id="tsd-filter-visibility">
+								<span class="tsd-select-label">All</span>
+								<ul class="tsd-select-list">
+									<li data-value="public">Public</li>
+									<li data-value="protected">Public/Protected</li>
+									<li data-value="private" class="selected">All</li>
+								</ul>
+							</div>
+							<input type="checkbox" id="tsd-filter-inherited" checked />
+							<label class="tsd-widget" for="tsd-filter-inherited">Inherited</label>
+							<input type="checkbox" id="tsd-filter-externals" checked />
+							<label class="tsd-widget" for="tsd-filter-externals">Externals</label>
+						</div>
+					</div>
+					<a href="#" class="tsd-widget menu no-caption" data-toggle="menu">Menu</a>
+				</div>
+			</div>
+		</div>
+	</div>
+	<div class="tsd-page-title">
+		<div class="container">
+			<ul class="tsd-breadcrumb">
+				<li>
+					<a href="../index.html">Globals</a>
+				</li>
+				<li>
+					<a href="playereventdata.html">PlayerEventData</a>
+				</li>
+			</ul>
+			<h1>Interface PlayerEventData</h1>
+		</div>
+	</div>
+</header>
+<div class="container container-main">
+	<div class="row">
+		<div class="col-8 col-content">
+			<section class="tsd-panel tsd-comment">
+				<div class="tsd-comment tsd-typography">
+					<div class="lead">
+						<p>播放状态改变事件对应数据</p>
+					</div>
+				</div>
+			</section>
+			<section class="tsd-panel tsd-hierarchy">
+				<h3>Hierarchy</h3>
+				<ul class="tsd-hierarchy">
+					<li>
+						<span class="target">PlayerEventData</span>
+					</li>
+				</ul>
+			</section>
+			<section class="tsd-panel-group tsd-index-group">
+				<h2>Index</h2>
+				<section class="tsd-panel tsd-index-panel">
+					<div class="tsd-index-content">
+						<section class="tsd-index-section tsd-is-external">
+							<h3>Properties</h3>
+							<ul class="tsd-index-list">
+								<li class="tsd-kind-property tsd-parent-kind-interface tsd-is-external"><a href="playereventdata.html#status" class="tsd-kind-icon">status</a></li>
+								<li class="tsd-kind-property tsd-parent-kind-interface tsd-is-external"><a href="playereventdata.html#stream" class="tsd-kind-icon">stream</a></li>
+								<li class="tsd-kind-property tsd-parent-kind-interface tsd-is-external"><a href="playereventdata.html#type" class="tsd-kind-icon">type</a></li>
+							</ul>
+						</section>
+					</div>
+				</section>
+			</section>
+			<section class="tsd-panel-group tsd-member-group tsd-is-external">
+				<h2>Properties</h2>
+				<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-external">
+					<a name="status" class="tsd-anchor"></a>
+					<h3>status</h3>
+					<div class="tsd-signature tsd-kind-icon">status<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">"playing"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"paused"</span></div>
+					<aside class="tsd-sources">
+					</aside>
+					<div class="tsd-comment tsd-typography">
+						<div class="lead">
+							<p>状态</p>
+						</div>
+					</div>
+				</section>
+				<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-external">
+					<a name="stream" class="tsd-anchor"></a>
+					<h3>stream</h3>
+					<div class="tsd-signature tsd-kind-icon">stream<span class="tsd-signature-symbol">:</span> <a href="../classes/stream.html" class="tsd-signature-type">Stream</a></div>
+					<aside class="tsd-sources">
+					</aside>
+					<div class="tsd-comment tsd-typography">
+						<div class="lead">
+							<p>对应的流</p>
+						</div>
+					</div>
+				</section>
+				<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-external">
+					<a name="type" class="tsd-anchor"></a>
+					<h3>type</h3>
+					<div class="tsd-signature tsd-kind-icon">type<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">"audio"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"video"</span></div>
+					<aside class="tsd-sources">
+					</aside>
+					<div class="tsd-comment tsd-typography">
+						<div class="lead">
+							<p>类型,音频/视频</p>
+						</div>
+					</div>
+				</section>
+			</section>
+		</div>
+		<div class="col-4 col-menu menu-sticky-wrap menu-highlight">
+			<nav class="tsd-navigation primary">
+				<ul>
+					<li class="globals  ">
+						<a href="../index.html"><em>Globals</em></a>
+					</li>
+				</ul>
+			</nav>
+			<nav class="tsd-navigation secondary menu-sticky">
+				<ul class="before-current">
+				</ul>
+				<ul class="current">
+					<li class="current tsd-kind-interface tsd-is-external">
+						<a href="playereventdata.html" class="tsd-kind-icon">Player<wbr>Event<wbr>Data</a>
+						<ul>
+							<li class=" tsd-kind-property tsd-parent-kind-interface tsd-is-external">
+								<a href="playereventdata.html#status" class="tsd-kind-icon">status</a>
+							</li>
+							<li class=" tsd-kind-property tsd-parent-kind-interface tsd-is-external">
+								<a href="playereventdata.html#stream" class="tsd-kind-icon">stream</a>
+							</li>
+							<li class=" tsd-kind-property tsd-parent-kind-interface tsd-is-external">
+								<a href="playereventdata.html#type" class="tsd-kind-icon">type</a>
+							</li>
+						</ul>
+					</li>
+				</ul>
+				<ul class="after-current">
+				</ul>
+			</nav>
+		</div>
+	</div>
+</div>
+<footer class="with-border-bottom">
+	<div class="container">
+		<h2>Legend</h2>
+		<div class="tsd-legend-group">
+		</div>
+	</div>
+</footer>
+<div class="container tsd-generator">
+	<p>Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p>
+</div>
+<div class="overlay"></div>
+<script src="../assets/js/main.js"></script>
+</body>
+</html>

+ 16 - 0
docs/interfaces/playoptions.html

@@ -86,6 +86,7 @@
 						<section class="tsd-index-section tsd-is-external">
 							<h3>Properties</h3>
 							<ul class="tsd-index-list">
+								<li class="tsd-kind-property tsd-parent-kind-interface tsd-is-external"><a href="playoptions.html#controls" class="tsd-kind-icon">controls</a></li>
 								<li class="tsd-kind-property tsd-parent-kind-interface tsd-is-external"><a href="playoptions.html#fit" class="tsd-kind-icon">fit</a></li>
 								<li class="tsd-kind-property tsd-parent-kind-interface tsd-is-external"><a href="playoptions.html#mirror" class="tsd-kind-icon">mirror</a></li>
 								<li class="tsd-kind-property tsd-parent-kind-interface tsd-is-external"><a href="playoptions.html#mute" class="tsd-kind-icon">mute</a></li>
@@ -97,6 +98,18 @@
 			<section class="tsd-panel-group tsd-member-group tsd-is-external">
 				<h2>Properties</h2>
 				<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-external">
+					<a name="controls" class="tsd-anchor"></a>
+					<h3><span class="tsd-flag ts-flagOptional">Optional</span> controls</h3>
+					<div class="tsd-signature tsd-kind-icon">controls<span class="tsd-signature-symbol">:</span> <a href="../index.html#playcontrolstype" class="tsd-signature-type">PlayControlsType</a></div>
+					<aside class="tsd-sources">
+					</aside>
+					<div class="tsd-comment tsd-typography">
+						<div class="lead">
+							<p>视频播放时 audio / video 的控制面板的显示模式,默认自动判断(播放失败时显示,播放成功时隐藏)</p>
+						</div>
+					</div>
+				</section>
+				<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-external">
 					<a name="fit" class="tsd-anchor"></a>
 					<h3><span class="tsd-flag ts-flagOptional">Optional</span> fit</h3>
 					<div class="tsd-signature tsd-kind-icon">fit<span class="tsd-signature-symbol">:</span> <a href="../index.html#playervideofittype" class="tsd-signature-type">PlayerVideoFitType</a></div>
@@ -150,6 +163,9 @@
 						<a href="playoptions.html" class="tsd-kind-icon">Play<wbr>Options</a>
 						<ul>
 							<li class=" tsd-kind-property tsd-parent-kind-interface tsd-is-external">
+								<a href="playoptions.html#controls" class="tsd-kind-icon">controls</a>
+							</li>
+							<li class=" tsd-kind-property tsd-parent-kind-interface tsd-is-external">
 								<a href="playoptions.html#fit" class="tsd-kind-icon">fit</a>
 							</li>
 							<li class=" tsd-kind-property tsd-parent-kind-interface tsd-is-external">

+ 0 - 7
docs/interfaces/serverconfig.html

@@ -68,13 +68,6 @@
 				<div class="tsd-comment tsd-typography">
 					<div class="lead">
 						<p>服务器配置,可设置置网关(gateway)、信令(signal)、日志(log)服务器地址</p>
-						<blockquote>
-							<p>注:</p>
-							<ol>
-								<li>gateway 和 signal 须二选一进行设置</li>
-								<li>没有日志服务器时,log 可不设</li>
-							</ol>
-						</blockquote>
 					</div>
 				</div>
 			</section>

+ 191 - 36
lib/index.d.ts

@@ -10,6 +10,7 @@ declare module '@urtc/sdk-web' {
     * 创建客户端
     * @param appId - 应用 ID,可在控制台查看
     * @param opts - 定义客户端的属性
+    * @public
     * @example
     * ```js
     * const client = createClient('AppID');
@@ -28,12 +29,13 @@ declare module '@urtc/sdk-web' {
   /**
     * 创建本地流
     * @param opts - 必传,定义本地音视频流的属性
-    * > 注:
-    * > 1. video, screen 不可同时为 true
-    * > 2. audio, video, screen 不可同时为 false
-    * > 3. 若指定了 file,则 init 时将优先使用 file 来创建初始化本地流的视频
-    * > 4. screenAudio 在不同浏览器上表现不同,参见 {@link LocalStreamOptions}
+    * 注:
+    * 1. video, screen 不可同时为 true
+    * 2. audio, video, screen 不可同时为 false
+    * 3. 若指定了 file,则 init 时将优先使用 file 来创建初始化本地流的视频
+    * 4. screenAudio 在不同浏览器上表现不同,参见 {@link LocalStreamOptions}
     * @param id - 选传,指定本地流的 ID,请注意创建多条流时,不可传入重复值
+    * @public
     * @example
     * ```js
     * const localStream = createStream({ audio: true, video: true, screen: false });
@@ -54,6 +56,7 @@ declare module '@urtc/sdk-web' {
   /**
     * 设置日志打印级别,用于打印出更多日志来调试或定位问题
     * @param level - 日志级别,有 'debug', 'info', 'warn', 'error' 级别;
+    * @public
     * @example
     * ```js
     * setLogLevel('info');
@@ -63,6 +66,7 @@ declare module '@urtc/sdk-web' {
   /**
     * 开启/关闭操作/错误/状态日志的上报,未调用时,默认开启上报日志
     * @param enable - 是否开启上报
+    * @public
     * @example
     * ```js
     * reportLog(false); // 关闭日志上报,关闭后,在线上出现错误时,将无法根据日志进行排查
@@ -99,6 +103,7 @@ declare module '__@urtc/sdk-web/client' {
   import { ClientPlugin } from '__@urtc/sdk-web/plugin';
   /**
     * URTC 客户端,可进行加入、离开房间,发布、订阅流等操作。
+    * @public
     */
   export class Client {
       /**
@@ -284,6 +289,7 @@ declare module '__@urtc/sdk-web/stream/local-stream' {
   import { StreamPlugin } from '__@urtc/sdk-web/plugin';
   /**
     * 创建本地流的参数
+    * @public
     */
   export interface LocalStreamOptions {
       /**
@@ -308,7 +314,7 @@ declare module '__@urtc/sdk-web/stream/local-stream' {
       screen: boolean;
       /**
         * 是否读取屏幕共享的音频,默认: false
-        * > 注:仅部分浏览器支持,如 Chrome 74,且不同系统表现不同,如 windows 会读取桌面音频,macOS 只支持读取浏览器 tab 中的音频,
+        * 注:仅部分浏览器支持,如 Chrome 74,且不同系统表现不同,如 windows 会读取桌面音频,macOS 只支持读取浏览器 tab 中的音频,
         */
       screenAudio?: boolean;
       /**
@@ -322,6 +328,7 @@ declare module '__@urtc/sdk-web/stream/local-stream' {
   }
   /**
     * 本地流,可用于本地预览,也可用 client 进行发布
+    * @public
     */
   export class LocalStream extends Stream {
       /**
@@ -348,8 +355,8 @@ declare module '__@urtc/sdk-web/stream/local-stream' {
       init(): Promise<void>;
       /**
         * 添加一条媒体轨道(音轨或视轨)到当前流
-        * > 注:
-        * > 1. 若创建本地流时,audio 为 false,不可添加音轨,video 为 false 时,不可添加视轨
+        * 注:
+        * 1. 若创建本地流时,audio 为 false,不可添加音轨,video 为 false 时,不可添加视轨
         * @param track - 媒体轨道
         * @example
         * ```js
@@ -368,9 +375,9 @@ declare module '__@urtc/sdk-web/stream/local-stream' {
       removeTrack(track: MediaStreamTrack): void;
       /**
         * 替换当前流中的媒体轨道
-        * > 注:
-        * > 1. 替换视频时,请使用与原轨道相同的分辨率的媒体轨道
-        * > 2. 返回值为当前流中相同类型的媒体轨道,此媒体轨道仍可用(占用音频设备或视频设备),请自行决定是否调用其 stop 方法释放设备
+        * 注:
+        * 1. 替换视频时,请使用与原轨道相同的分辨率的媒体轨道
+        * 2. 返回值为当前流中相同类型的媒体轨道,此媒体轨道仍可用(占用音频设备或视频设备),请自行决定是否调用其 stop 方法释放设备
         * @param track - 新媒体轨道
         * @example
         * ```js
@@ -400,14 +407,28 @@ declare module '__@urtc/sdk-web/stream/local-stream' {
         * @param profile - 视频 Profile
         * @example
         * ```js
-        * stream.setVideoProfile('720p');
+        * stream
+        *   .setVideoProfile('720p')
+        *   .then(() => {
+        *     console.log('set video profile success');
+        *   })
+        *   .catch((err) => {
+        *     console.log('set video profile failed ', err);
+        *   });
         * ```
         * 或
         * ```js
-        * stream.setVideoProfile({width: 640, height: 480, framerate: 15, bitrate: 500});
+        * stream
+        *   .setVideoProfile({width: 640, height: 480, framerate: 15, bitrate: 500});
+        *   .then(() => {
+        *     console.log('set video profile success');
+        *   })
+        *   .catch((err) => {
+        *     console.log('set video profile failed ', err);
+        *   });
         * ```
         */
-      setVideoProfile(profile: VideoProfile | CustomVideoProfile): void;
+      setVideoProfile(profile: VideoProfile | CustomVideoProfile): Promise<void>;
       /**
         * 设置当前流(屏幕共享时)视频的 Profile,默认 '1080p'
         * 注:请务必在调用 init 方法之前,设置屏幕共享流的 Profile,否则无法生效。
@@ -465,6 +486,7 @@ declare module '__@urtc/sdk-web/utils/token' {
     * @param appKey - 应用密钥,可在控制台查看
     * @param roomId - 房间 ID
     * @param userId - 用户 ID
+    * @public
     * @example
     * ```js
     * const token = generateToken('urtc-xxx', 'yyy', 'roomId', 'userId');
@@ -475,16 +497,26 @@ declare module '__@urtc/sdk-web/utils/token' {
 }
 
 declare module '__@urtc/sdk-web/types' {
-  import { VideoCodec } from '__@urtc/sdk-web/stream/types';
+  import { AudioCodec, VideoCodec } from '__@urtc/sdk-web/stream/types';
   /**
     * 视频播放时的显示模式
     * - cover 模式:优先保证视窗被填满。
     * - contain 模式:优先保证视频内容全部显示。
     * 播放摄像头视频流默认使用 cover 模式,屏幕共享视频流默认使用 contain 模式。
+    * @public
     */
   export type PlayerVideoFitType = 'cover' | 'contain';
   /**
+    * 视频播放时 audio / video 的控制面板的显示模式
+    * - show 模式:一直显示
+    * - hide 模式:一直隐藏
+    * - auto 模式:自动判断
+    * @public
+    */
+  export type PlayControlsType = 'show' | 'hide' | 'auto';
+  /**
     * 播放器播放属性
+    * @public
     */
   export interface PlayOptions {
       /**
@@ -499,18 +531,25 @@ declare module '__@urtc/sdk-web/types' {
         * 视频播放时的{@link PlayerVideoFitType | 显示模式},默认 'cover',屏幕共享时默认使用 'contain'
         */
       fit?: PlayerVideoFitType;
+      /**
+        * 视频播放时 audio / video 的控制面板的显示模式,默认自动判断(播放失败时显示,播放成功时隐藏)
+        */
+      controls?: PlayControlsType;
   }
   export { /*AudioProfile,*/ VideoProfile, ScreenProfile } from '__@urtc/sdk-web/stream/profile';
   /**
     * 房间类型
+    * @public
     */
-  export type RoomType = 'rtc' | 'live';
+  export type RoomType = 'conference' | 'live';
   /**
     * 用户角色
+    * @public
     */
   export type RoleType = 'pull' | 'push' | 'push-and-pull';
   /**
     * 定义客户端的属性
+    * @public
     */
   export interface ClientOptions {
       /**
@@ -520,10 +559,11 @@ declare module '__@urtc/sdk-web/types' {
   }
   /**
     * 加入房间的属性
+    * @public
     */
   export interface JoinOptions {
       /**
-        * 加入房间的{@link RoomType | 房间类型},默认 'rtc'
+        * 加入房间的{@link RoomType | 房间类型},默认 'conference'
         */
       type?: RoomType;
       /**
@@ -531,6 +571,20 @@ declare module '__@urtc/sdk-web/types' {
         */
       role?: RoleType;
   }
+  /**
+    * 支持的音频、视频编解码格式
+    * @public
+    */
+  export interface Codecs {
+      /**
+        * 音频编解码格式
+        */
+      audio: AudioCodec[];
+      /**
+        * 视频编解码格式
+        */
+      video: VideoCodec[];
+  }
 }
 
 declare module '__@urtc/sdk-web/logger' {
@@ -541,8 +595,10 @@ declare module '__@urtc/sdk-web/logger' {
 }
 
 declare module '__@urtc/sdk-web/devices' {
+  import { Codecs } from '__@urtc/sdk-web/types';
   /**
     * 获取音视频输入/输出设备列表,点击 [MediaDeviceInfo](https://developer.mozilla.org/en-US/docs/Web/API/MediaDeviceInfo) 查看详情
+    * @public
     * @example
     * ```js
     * getDevices()
@@ -558,6 +614,7 @@ declare module '__@urtc/sdk-web/devices' {
   export function getDevices(): Promise<MediaDeviceInfo[]>;
   /**
     * 获取摄像头设备列表,点击 [MediaDeviceInfo](https://developer.mozilla.org/en-US/docs/Web/API/MediaDeviceInfo) 查看详情
+    * @public
     * @example
     * ```js
     * getCameras()
@@ -573,6 +630,7 @@ declare module '__@urtc/sdk-web/devices' {
   export function getCameras(): Promise<MediaDeviceInfo[]>;
   /**
     * 获取麦克风设备列表,点击 [MediaDeviceInfo](https://developer.mozilla.org/en-US/docs/Web/API/MediaDeviceInfo) 查看详情
+    * @public
     * @example
     * ```js
     * getMicrophones()
@@ -588,6 +646,7 @@ declare module '__@urtc/sdk-web/devices' {
   export function getMicrophones(): Promise<MediaDeviceInfo[]>;
   /**
     * 获取扬声器设备列表,点击 [MediaDeviceInfo](https://developer.mozilla.org/en-US/docs/Web/API/MediaDeviceInfo) 查看详情
+    * @public
     * @example
     * ```js
     * getLoudspeakers()
@@ -603,6 +662,7 @@ declare module '__@urtc/sdk-web/devices' {
   export function getLoudspeakers(): Promise<MediaDeviceInfo[]>;
   /**
     * 设备检测选项
+    * @public
     */
   export interface DeviceDetectionOptions {
       /**
@@ -625,6 +685,7 @@ declare module '__@urtc/sdk-web/devices' {
   /**
     * 设备可用性检测 - 创建包含麦克风音频或摄像头视频的本地流时,有可能因为麦克风或摄像头设备问题(如驱动问题,或未经授权等),导致无法正确创建。此方法可用于设备检测,根据检测结果,再决定创建本地流时启用麦克风或摄像头或麦克风和摄像头
     * @param options - 需指定设备时,请传入设备 ID
+    * @public
     * @example
     * ```js
     * deviceDetection({audio: true, video: true})
@@ -640,6 +701,7 @@ declare module '__@urtc/sdk-web/devices' {
   export function deviceDetection(options: DeviceDetectionOptions): Promise<void>;
   /**
     * 检测浏览器是否完全(可访问本地音视频设备)支持 WebRTC。
+    * @public
     * @example
     * ```js
     * if (!isSupportWebRTC()) {
@@ -650,6 +712,7 @@ declare module '__@urtc/sdk-web/devices' {
   export function isSupportWebRTC(): boolean;
   /**
     * 检测浏览器是否支持屏幕共享
+    * @public
     * @example
     * ```js
     * if (!isSupportScreenShare()) {
@@ -658,6 +721,21 @@ declare module '__@urtc/sdk-web/devices' {
     * ```
     */
   export function isSupportScreenShare(): boolean;
+  /**
+    * 检测浏览器支持的音视频编解码格式
+    * @public
+    * @example
+    * ```js
+    * getSupportedCodec()
+    *  .then((codecs) => {
+    *    console.log(`浏览器支持的音频编解码格式有 ${codecs.audio},视频编解码格式有 ${codecs.video}`);
+    *  })
+    *  .catch((err) => {
+    *    console.log(`浏览器获取音视频编解码格式失败,${err}`);
+    *  });
+    * ```
+    */
+  export function getSupportedCodec(): Promise<Codecs>;
 }
 
 declare module '__@urtc/sdk-web/event' {
@@ -667,16 +745,13 @@ declare module '__@urtc/sdk-web/event' {
   import { LocalStream } from '__@urtc/sdk-web/';
   import { RemoteStream } from '__@urtc/sdk-web/stream/remote-stream';
   /**
-    * @private
-    */
-  export const RtcEventTypes: readonly ["user-joined", "user-left", "stream-added", "stream-removed", "stream-subscribed", "stream-published", "mute-audio", "unmute-audio", "mute-video", "unmute-video", "connection-state-changed", "kick-off", "screenshare-stopped", "first-key-frame", "network-quality", "logoff"];
-  /**
     * Rtc 用户事件类型:
     *
     * {@link RtcUserEvent 用户事件}
     * - user-joined - 有用户加入房间
     * - user-left - 有用户离开房间
     * - kick-off - 当前用户被踢出房间
+    * @public
     * @example
     * ```js
     * client.on('user-joined', (event) => {
@@ -687,6 +762,7 @@ declare module '__@urtc/sdk-web/event' {
   export type RtcUserEventType = 'user-joined' | 'user-left' | 'kick-off';
   /**
     * Rtc 流事件类型:
+    * @public
     *
     * {@link RtcStreamEvent 流事件}
     * - stream-added - 有远端流加入,此时事件中的 data 为 {@link RemoteStream} 远端流
@@ -697,7 +773,6 @@ declare module '__@urtc/sdk-web/event' {
     * - unmute-audio - 流的音频被取消 mute
     * - mute-video - 流的视频被 mute
     * - unmute-video - 流的视频被取消 mute
-    * - first-key-frame - 接收到远端流的首帧
     * @example
     * ```js
     * client.on('stream-add', (event) => {
@@ -707,20 +782,65 @@ declare module '__@urtc/sdk-web/event' {
     *
     * **特别地,以下事件需在单条流上进行监听**
     * - screenshare-stopped - 屏幕共享流被中止,此时事件中的 data 为 {@link LocalStream} 本地流
+    * - first-key-frame - 接收到远端流的首帧
     * @example
     * ```js
     * localStream.on('screenshare-stopped', (event) => {
+    *   // 此事件只针对本地流有效,若本地流已发布,监听到此事件后,可以决定要不要取消发布
     *   client.unpublish(event.data);
     *   event.data.destroy();
     * });
     * ```
+    * @example
+    * ```js
+    * stream.on('first-key-frame', (event) => {
+    *   console.log(`stream ${event.data} got first key frame`);
+    * });
+    * ```
     */
   export type RtcStreamEventType = 'stream-added' | 'stream-removed' | 'stream-subscribed' | 'stream-published' | 'mute-audio' | 'unmute-audio' | 'mute-video' | 'unmute-video' | 'first-key-frame' | 'screenshare-stopped';
   /**
+    * Rtc 播放器事件类型:
+    * @public
+    *
+    * {@link RtcPlayerEvent 播放器事件}
+    * - player-status-change - 流播放器状态改变
+    * **注,此事件需在单条流上进行监听**
+    * @public
+    * @example
+    * ```js
+    * stream.on('player-status-change', (event) => {
+    *   const { data } = event;
+    *   const { type, status } = data;
+    *   console.log(`stream's ${type} status changed to ${status}`);
+    * });
+    * ```
+    */
+  export type RtcPlayerEventType = 'player-status-change';
+  /**
+    * 播放状态改变事件对应数据
+    * @public
+    */
+  interface PlayerEventData {
+      /**
+        * 类型,音频/视频
+        */
+      type: 'audio' | 'video';
+      /**
+        * 状态
+        */
+      status: 'playing' | 'paused';
+      /**
+        * 对应的流
+        */
+      stream: Stream;
+  }
+  /**
     * Rtc 客户端连接事件类型:
     *
     * {@link RtcConnectionEvent 连接事件}
     * - connection-state-changed - 连接状态改变
+    * @public
     * @example
     * ```js
     * client.on('connection-state-changed', (event) => {
@@ -731,14 +851,16 @@ declare module '__@urtc/sdk-web/event' {
   export type RtcConnectionEventType = 'connection-state-changed';
   /**
     * Rtc 事件类型
+    * @public
     */
-  export type RtcEventType = RtcUserEventType | RtcStreamEventType | RtcConnectionEventType;
+  export type RtcEventType = RtcUserEventType | RtcStreamEventType | RtcConnectionEventType | RtcPlayerEventType;
   /**
     * Rtc 事件
     *
     * 当 type - T 为 {@link RtcUserEventType} 事件时,data - S 为 {@link User} 类型
     * 当 type - T 为 {@link RtcStreamEventType} 事件时,data - S 为 {@link LocalStream} | {@link RemoteStream} 类型
     * 当 type - T 为 {@link RtcConnectionEventType } 事件时,data - S 为 {@link ConnectionStates } 类型
+    * @public
     */
   export interface RtcEvent<T, S> {
       type: T;
@@ -746,22 +868,32 @@ declare module '__@urtc/sdk-web/event' {
   }
   /**
     * Rtc 用户事件,事件类型参见 {@link RtcUserEventType}
+    * @public
     */
   export type RtcUserEvent = RtcEvent<RtcUserEventType, User>;
   /**
     * Rtc 流事件,事件类型参见 {@link RtcStreamEventType}
+    * @public
     */
   export type RtcStreamEvent = RtcEvent<RtcStreamEventType, Stream | LocalStream | RemoteStream>;
   /**
     * Rtc 连接事件,事件类型参见 {@link RtcConnectionEventType}
+    * @public
     */
   export type RtcConnectionEvent = RtcEvent<RtcConnectionEventType, ConnectionStates>;
+  /**
+    * Rtc 连接事件,事件类型参见 {@link RtcPlayerEventType}
+    * @public
+    */
+  export type RtcPlayerEvent = RtcEvent<RtcPlayerEventType, PlayerEventData>;
+  export {};
 }
 
 declare module '__@urtc/sdk-web/error' {
   /**
     * URTC 错误信息
     * 错误代码参见 {@link ErrorCode}
+    * @public
     */
   export class RtcError extends Error {
       constructor(code: ErrorCode, message: string);
@@ -956,6 +1088,7 @@ declare module '__@urtc/sdk-web/error' {
     * - 3017 - 流正在取消订阅
     * - 3018 - 流已经订阅
     * - 3019 - 自动播放被禁止错误
+    * @public
     */
   export type ErrorCode = typeof RtcError[Exclude<keyof typeof RtcError, 'prototype' | 'getCode' | 'stackTraceLimit' | 'prepareStackTrace' | 'captureStackTrace'>];
 }
@@ -963,6 +1096,7 @@ declare module '__@urtc/sdk-web/error' {
 declare module '__@urtc/sdk-web/user/user' {
   /**
     * 用户信息
+    * @public
     */
   export class User {
       /**
@@ -975,10 +1109,12 @@ declare module '__@urtc/sdk-web/user/user' {
 declare module '__@urtc/sdk-web/stream/types' {
   /**
     * 音频编解码格式
+    * @public
     */
   export type AudioCodec = 'opus';
   /**
     * 视频编解码格式
+    * @public
     */
   export type VideoCodec = 'vp8' | 'h264';
   /**
@@ -1005,6 +1141,7 @@ declare module '__@urtc/sdk-web/stream/types' {
   }
   /**
     * 流的视频的统计数据
+    * @public
     */
   export interface VideoStats {
       /**
@@ -1034,6 +1171,7 @@ declare module '__@urtc/sdk-web/stream/types' {
   }
   /**
     * 流的网络连接统计数据
+    * @public
     */
   export interface NetworkStats {
       /**
@@ -1043,6 +1181,7 @@ declare module '__@urtc/sdk-web/stream/types' {
   }
   /**
     * 已发布/已订阅流的统计数据
+    * @public
     */
   export interface StreamStats {
       /**
@@ -1059,11 +1198,13 @@ declare module '__@urtc/sdk-web/stream/types' {
       network?: NetworkStats;
   }
   /**
-    * 流的媒体类型, main - 主视频流,auxiliary - 辅助视频流,通常是一个屏幕分享流
+    * 流的媒体类型, main - 主视频流,screen - 辅助视频流,通常是一个屏幕分享流
+    * @public
     */
-  export type MediaType = 'main' | 'auxiliary';
+  export type MediaType = 'camera' | 'screen';
   /**
     * 切换设备的类型
+    * @public
     */
   export type SwitchDeviceType = 'audio' | 'video';
 }
@@ -1074,6 +1215,7 @@ declare module '__@urtc/sdk-web/stream/stream' {
   import { MediaType, StreamStats } from '__@urtc/sdk-web/stream/types';
   /**
     * LocalStream 和 RemoteStream 的基类
+    * @public
     */
   export class Stream extends EventEmitter {
       /**
@@ -1215,7 +1357,7 @@ declare module '__@urtc/sdk-web/stream/stream' {
       getAudioLevel(): number;
       /**
         * 销毁当前流,一般在本地流不再被使用时,可调用此方法销毁,解除摄像头或麦克风设备的占用。
-        * > 注:远端流,不需要手动调用此方法
+        * 注:远端流,不需要手动调用此方法
         * @example
         * ```js
         * stream.destroy();
@@ -1242,6 +1384,7 @@ declare module '__@urtc/sdk-web/stream/remote-stream' {
   import { StreamPlugin } from '__@urtc/sdk-web/plugin';
   /**
     * 远端流,房间内其他用户发布的流,可通过 client 进行订阅
+    * @public
     */
   export class RemoteStream extends Stream {
       /**
@@ -1278,9 +1421,10 @@ declare module '__@urtc/sdk-web/stream/remote-stream' {
 declare module '__@urtc/sdk-web/server' {
   /**
     * 服务器配置,可设置置网关(gateway)、信令(signal)、日志(log)服务器地址
-    * > 注:
-    * > 1. gateway 和 signal 须二选一进行设置
-    * > 2. 没有日志服务器时,log 可不设
+    * @public
+    * 注:
+    * 1. gateway 和 signal 须二选一进行设置
+    * 2. 没有日志服务器时,log 可不设
     */
   export interface ServerConfig {
       /**
@@ -1299,6 +1443,7 @@ declare module '__@urtc/sdk-web/server' {
   /**
     * 用于私有化部署时,指定部署的服务器地址
     * @param conf - 服务器配置,具体描述参见 ServerConfig 的说明
+    * @public
     * @example
     * ```js
     * setServers({
@@ -1339,18 +1484,19 @@ declare module '__@urtc/sdk-web/plugin' {
 declare module '__@urtc/sdk-web/version' {
   /**
     * 当前 sdk 的版本号
+    * @public
     */
   export const version: string;
 }
 
 declare module '__@urtc/sdk-web/event-emitter' {
-  import { RtcEventType, RtcUserEventType, RtcUserEvent, RtcStreamEvent, RtcConnectionEventType, RtcConnectionEvent, RtcStreamEventType } from '__@urtc/sdk-web/event';
+  import { RtcEventType, RtcUserEventType, RtcUserEvent, RtcStreamEvent, RtcConnectionEventType, RtcConnectionEvent, RtcStreamEventType, RtcPlayerEventType, RtcPlayerEvent } from '__@urtc/sdk-web/event';
   /**
     * 事件监听函数
     * 其中 T 为 RtcEvent 泛型
     * @private
     */
-  export type RtcEventInstance<T> = T extends RtcUserEventType ? RtcUserEvent : T extends RtcStreamEventType ? RtcStreamEvent : T extends RtcConnectionEventType ? RtcConnectionEvent : never;
+  export type RtcEventInstance<T> = T extends RtcUserEventType ? RtcUserEvent : T extends RtcStreamEventType ? RtcStreamEvent : T extends RtcConnectionEventType ? RtcConnectionEvent : T extends RtcPlayerEventType ? RtcPlayerEvent : never;
   /**
     * 事件监听函数
     * 其中 RtcEventInstance 为事件实例
@@ -1381,6 +1527,7 @@ declare module '__@urtc/sdk-web/event-emitter' {
 declare module '__@urtc/sdk-web/stream/profile' {
   /**
     * 预设的视频 Profile
+    * @public
     *
     * 名称 | 视频宽 | 视频高 | 帧率 (fps) | 码率 (kbps)
     * :-: | :-: | :-: | :-: | :-:
@@ -1400,6 +1547,7 @@ declare module '__@urtc/sdk-web/stream/profile' {
   export type VideoProfile = '180p' | '180p_2' | '240p' | '360p' | '360p_2' | '480p' | '720p' | '720p_2' | '720p_3' | '1080p' | '1080p_2' | '1080p_3';
   /**
     * 预设的屏幕共享视频 Profile
+    * @public
     *
     * 名称 | 视频宽 | 视频高 | 帧率 (fps) | 码率 (kbps)
     * :-: | :-: | :-: | :-: | :-:
@@ -1413,6 +1561,7 @@ declare module '__@urtc/sdk-web/stream/profile' {
   export type ScreenProfile = '480p' | '480p_2' | '720p' | '720p_2' | '1080p' | '1080p_2';
   /**
     * 自定义视频 Profile,请根据实际使用场景及网络环境,合理的设置
+    * @public
     * @example
     * ```js
     * { width: 640, height: 480, framerate: 15, bitrate: 500 }
@@ -1446,10 +1595,12 @@ declare module '__@urtc/sdk-web/connection/types' {
     * - CLOSING - 断开中
     * - RECONNECTING - 重连中
     * - CLOSED - 已断开
+    * @public
     */
   export type ConnectionState = 'OPEN' | 'CONNECTING' | 'CLOSING' | 'RECONNECTING' | 'CLOSED';
   /**
     * 客户端(Client)与服务器之间的{@link ConnectionState 连接状态}
+    * @public
     */
   export interface ConnectionStates {
       current: ConnectionState;
@@ -1467,6 +1618,7 @@ declare module '__@urtc/sdk-web/' {
     * 创建客户端
     * @param appId - 应用 ID,可在控制台查看
     * @param opts - 定义客户端的属性
+    * @public
     * @example
     * ```js
     * const client = createClient('AppID');
@@ -1485,12 +1637,13 @@ declare module '__@urtc/sdk-web/' {
   /**
     * 创建本地流
     * @param opts - 必传,定义本地音视频流的属性
-    * > 注:
-    * > 1. video, screen 不可同时为 true
-    * > 2. audio, video, screen 不可同时为 false
-    * > 3. 若指定了 file,则 init 时将优先使用 file 来创建初始化本地流的视频
-    * > 4. screenAudio 在不同浏览器上表现不同,参见 {@link LocalStreamOptions}
+    * 注:
+    * 1. video, screen 不可同时为 true
+    * 2. audio, video, screen 不可同时为 false
+    * 3. 若指定了 file,则 init 时将优先使用 file 来创建初始化本地流的视频
+    * 4. screenAudio 在不同浏览器上表现不同,参见 {@link LocalStreamOptions}
     * @param id - 选传,指定本地流的 ID,请注意创建多条流时,不可传入重复值
+    * @public
     * @example
     * ```js
     * const localStream = createStream({ audio: true, video: true, screen: false });
@@ -1511,6 +1664,7 @@ declare module '__@urtc/sdk-web/' {
   /**
     * 设置日志打印级别,用于打印出更多日志来调试或定位问题
     * @param level - 日志级别,有 'debug', 'info', 'warn', 'error' 级别;
+    * @public
     * @example
     * ```js
     * setLogLevel('info');
@@ -1520,6 +1674,7 @@ declare module '__@urtc/sdk-web/' {
   /**
     * 开启/关闭操作/错误/状态日志的上报,未调用时,默认开启上报日志
     * @param enable - 是否开启上报
+    * @public
     * @example
     * ```js
     * reportLog(false); // 关闭日志上报,关闭后,在线上出现错误时,将无法根据日志进行排查

File diff suppressed because it is too large
+ 3 - 3
lib/index.js


+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
   "name": "@urtc/sdk-web",
-  "version": "2.0.0-alpha.4",
+  "version": "2.0.0-alpha.5",
   "description": "UCloud RTC javascript SDK",
   "main": "lib/index.js",
   "types": "lib/index.d.ts",