@ray-js/ray-ipc-player 2.0.21-beta-2 → 2.0.21-beta-3

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/lib/index.js CHANGED
@@ -51,7 +51,8 @@ const Player = props => {
51
51
  isShare = false,
52
52
  onPlayerContainerTap,
53
53
  reConnect = false,
54
- awakeStatus = undefined
54
+ awakeStatus = undefined,
55
+ ignoreHideStopPreview = false
55
56
  } = props;
56
57
  const {
57
58
  borderRadius,
@@ -172,14 +173,17 @@ const Player = props => {
172
173
  });
173
174
  onDpDataChange(handleDpDataChange);
174
175
  }, []);
175
- usePageEvent('onHide', async () => {
176
+ usePageEvent('onHide', useMemoizedFn(async () => {
176
177
  setPlayState(d => {
177
178
  d.loadingState = true;
178
179
  });
180
+ if (ignoreHideStopPreview) {
181
+ return;
182
+ }
179
183
  // 先停流
180
184
  stopPreview();
181
185
  // await getCurMute();
182
- });
186
+ }));
183
187
  useMount(() => {
184
188
  onNetworkStatusChange(res => {
185
189
  setPhoneNetworkConnect(res.isConnected);
@@ -320,6 +324,9 @@ const Player = props => {
320
324
  } else if (playState.initLy && !privateState) {
321
325
  ipcTTTOperatorLog("VID: privateState_status_change: ".concat(privateState));
322
326
  retry();
327
+ } else if (playState.initLy && privateState) {
328
+ // 如果隐私模式为true, 主动推一波流变化的状态码,适配ios不触发connectChange的情况
329
+ onChangeStreamStatus && onChangeStreamStatus(-1001);
323
330
  }
324
331
  }
325
332
  }, [phoneNetworkConnect, onlineStatus, playState.initLy, privateState]);
@@ -715,7 +722,7 @@ const Player = props => {
715
722
  errCode,
716
723
  errorCode
717
724
  } = data === null || data === void 0 ? void 0 : data.detail;
718
- const codeValue = errCode || errorCode;
725
+ const codeValue = errCode !== undefined ? errCode : errorCode;
719
726
  if (deviceId) {
720
727
  if (deviceId === devId) {
721
728
  setVideoErrCode(codeValue);
@@ -18,6 +18,24 @@ export type IProps = {
18
18
  * @default true
19
19
  */
20
20
  onlineStatus: boolean;
21
+ /**
22
+ * @description.en brandColor
23
+ * @description.zh 品牌色
24
+ * @default true
25
+ */
26
+ brandColor: string;
27
+ /**
28
+ * @description.en renderErrIcon
29
+ * @description.zh 自定义渲染错误图标
30
+ * @default true
31
+ */
32
+ renderErrIcon?: () => React.ReactNode;
33
+ /**
34
+ * @description.en isShare
35
+ * @description.zh 是否为分享设备
36
+ * @default true
37
+ */
38
+ isShare: string;
21
39
  /**
22
40
  * @description.en privateState
23
41
  * @description.zh 隐私模式
@@ -32,10 +50,16 @@ export type IProps = {
32
50
  defaultMute?: boolean;
33
51
  /**
34
52
  * @description.en clarity
35
- * @description.zh 清晰度 normal:标清,hd:高清
53
+ * @description.zh 清晰度 normal:标清,hd:高清 ss: 省流 ud: 超清 ssp: 超高清 auto: 自动 audio: 音频
54
+ * @default "normal"
55
+ */
56
+ clarity?: 'normal' | 'hd' | 'ss' | 'ud' | 'ssp' | 'auto' | 'audio';
57
+ /**
58
+ * @description.en ipcPlayerContext
59
+ * @description.zh 播放器上下文
36
60
  * @default "normal"
37
61
  */
38
- clarity?: 'normal' | 'hd';
62
+ ipcPlayerContext?: any;
39
63
  /**
40
64
  * @description.en updateLayout
41
65
  * @description.zh 外层父节点样式变化,播放器监听不到,需要主动触发播放器视图更新,每次需要设置不同的字符串值
@@ -48,6 +72,30 @@ export type IProps = {
48
72
  * @default (data) => void
49
73
  */
50
74
  onChangeStreamStatus?: (data) => void;
75
+ /**
76
+ * @description.en onPlayerContainerTap
77
+ * @description.zh 点击视频播放器区域
78
+ * @default (data) => void
79
+ */
80
+ onPlayerContainerTap?: (data) => void;
81
+ /**
82
+ * @description.en onZoomChange
83
+ * @description.zh 视频播放器比例变化
84
+ * @default (data) => void
85
+ */
86
+ onZoomChange?: (data) => void;
87
+ /**
88
+ * @description.en onCameraPreviewFailure
89
+ * @description.zh 视频错误码回调
90
+ * @default (data) => void
91
+ */
92
+ onCameraPreviewFailure?: (data) => void;
93
+ /**
94
+ * @description.en onCameraNotifyWeakNetwork
95
+ * @description.zh 弱网检测回调
96
+ * @default (data) => void
97
+ */
98
+ onCameraNotifyWeakNetwork?: (data) => void;
51
99
  /**
52
100
  * @description.en onCtx
53
101
  * @description.zh 获取ipcPlayer实例ctx以及重试方法retry
@@ -132,4 +180,10 @@ export type IProps = {
132
180
  * @default {}
133
181
  */
134
182
  awakeStatus?: boolean | undefined;
183
+ /**
184
+ * @description.en needReconnect
185
+ * @description.zh 是否需要唤醒
186
+ * @default {}
187
+ */
188
+ ignoreHideStopPreview: boolean;
135
189
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ray-js/ray-ipc-player",
3
- "version": "2.0.21-beta-2",
3
+ "version": "2.0.21-beta-3",
4
4
  "description": "ray小程序播放器",
5
5
  "keywords": [
6
6
  "tuya-miniapp",