@besovideo/webrtc-player 0.10.13 → 0.10.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -33,6 +33,7 @@ import {
33
33
  IPuPlayerProps,
34
34
  IPuPlayerInstance,
35
35
  clearAllDialog,
36
+ callEndPointUtils
36
37
  } from "@besovideo/webrtc-player";
37
38
  import "@besovideo/webrtc-player/dist/main.es.css";
38
39
 
@@ -472,6 +473,58 @@ instance.open()
472
473
 
473
474
  ```
474
475
 
476
+ ***媒体流推送***
477
+ ``` typescript
478
+ const callEndPointUtils: {
479
+ pushLocalMedia: (params: {
480
+ // token
481
+ token: string;
482
+ // div 用于渲染
483
+ container?: HTMLDivElement;
484
+ // 是否获取视频
485
+ video?: boolean;
486
+ // 是否获取音频
487
+ audio?: boolean;
488
+ // 推窗口流,
489
+ displayMedia?: {
490
+ // 必选
491
+ video: {
492
+ // 窗口选择页面,哪一个优先显示
493
+ displaySurface?: "monitor" | "window" | "application" | "browser";
494
+ // 画面中是否显示鼠标
495
+ cursor?: "always" | "motion" | "never";
496
+ };
497
+ // 是否推窗口音频
498
+ audio?: boolean
499
+ // 停止分享事件通知,此时webrtc流没有关闭,要主动调用close
500
+ onInactive?: () => void;
501
+ };
502
+ // 连接失败
503
+ onClose?: () => void;
504
+ // peer connection 连接状态发生改变
505
+ onStatusChange?: (status: "CONNECTEDING" | "CONNECTED") => void;
506
+ // 试用回调,说明AVcall 没认证
507
+ onTrial?: (info: {
508
+ totalTimeMs: number; // 单个Call可试用总时长
509
+ currentTimeMs: number; // 当前已试用时间
510
+ isTrialOver: boolean; // 是否试用结束
511
+ }) => void;
512
+ }) => Promise<{
513
+ // 关闭已经打开的推流, code == 'SUCCESS' 有效
514
+ close?: () => Promise<void>;
515
+ code: "SUCCESS" | "GET_MEDIA_ERROR" | "CREATE_LOCALE_SDP_ERROR" | "SET_LOCAL_SDP_ERROR" | "POST_SDP_ERROR" | "GET_REMOTE_SDP_ERROR" | "SET_REMOTE_SDP_ERROR" | "CREATE_VIDEO_ELE_ERROR" | "WAIT_TRACK_ERROR" | "WAIT_PEER_CONNECTED_ERROR" | "BUSY_ERROR";
516
+ message?: string | undefined;
517
+ // code == 'SUCCESS' 有效, 推送的媒体流信息
518
+ streamIdInfo?: {
519
+ id: string; // https://bvcsp.apifox.cn/api-379317162 返回的 id 设备ID
520
+ index: number; // https://bvcsp.apifox.cn/api-379317162 返回的 index 通道号
521
+ mediaStream: MediaStream; // 媒体流用于播放
522
+ dialogId: string; // dialog id
523
+ };
524
+ }>
525
+ }
526
+ ```
527
+
475
528
 
476
529
  **Vue 示例**
477
530
 
@@ -1174,7 +1174,7 @@
1174
1174
  width: 100%;
1175
1175
  }
1176
1176
  .videoCall_dialogPanel .remoteUserTitle {
1177
- height: 32px;
1177
+ height: 30px;
1178
1178
  line-height: 32px;
1179
1179
  border: 1px solid #c4c4c4;
1180
1180
  border-bottom-left-radius: 5px;
@@ -1221,6 +1221,26 @@
1221
1221
  cursor: -webkit-grabbing;
1222
1222
  cursor: grabbing;
1223
1223
  }
1224
+ .videoCall_dialogPanel .mainStatusSpan {
1225
+ position: absolute;
1226
+ top: calc(50% - 50px);
1227
+ color: black;
1228
+ text-align: center;
1229
+ z-index: 2;
1230
+ font-size: 20px;
1231
+ background-color: white;
1232
+ -webkit-user-select: none;
1233
+ -ms-user-select: none;
1234
+ user-select: none;
1235
+ padding-left: 10px;
1236
+ padding-right: 10px;
1237
+ width: 320px;
1238
+ height: 100px;
1239
+ left: calc(50% - 160px);
1240
+ border-radius: 5px;
1241
+ opacity: 0.9;
1242
+ line-height: 100px;
1243
+ }
1224
1244
  .videoCall_dialogPanel .callPanelCloseButton {
1225
1245
  position: absolute;
1226
1246
  top: 2px;