@ray-js/ray-ipc-player 2.0.22 → 2.0.23
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 +12 -1
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -7,7 +7,7 @@ import { useImmer } from 'use-immer';
|
|
|
7
7
|
import _isEmpty from 'lodash/isEmpty';
|
|
8
8
|
import { IpcPlayer, View, CoverView } from '@ray-js/components';
|
|
9
9
|
import { useMount, useUnmount, useMemoizedFn } from 'ahooks';
|
|
10
|
-
import { setPageOrientation, usePageEvent, getNetworkType, offNetworkStatusChange, onNetworkStatusChange, publishDps, showToast, getSystemInfoSync, onMqttMessageReceived, registerMQTTProtocolListener, offMqttMessageReceived, unregisterMQTTProtocolListener, registerDeviceListListener, onDpDataChange, onDeviceOnlineStatusUpdate } from '@ray-js/ray';
|
|
10
|
+
import { setPageOrientation, usePageEvent, getNetworkType, offNetworkStatusChange, onNetworkStatusChange, publishDps, showToast, getSystemInfoSync, onMqttMessageReceived, registerMQTTProtocolListener, offMqttMessageReceived, unregisterMQTTProtocolListener, registerDeviceListListener, onDpDataChange, onDeviceOnlineStatusUpdate, performanceEvent } from '@ray-js/ray';
|
|
11
11
|
import clsx from 'clsx';
|
|
12
12
|
import Strings from './i18n';
|
|
13
13
|
import Styles from './index.module.less';
|
|
@@ -94,6 +94,7 @@ const Player = props => {
|
|
|
94
94
|
const privateDeviceWakeNeedPublishTimeRef = useRef(null);
|
|
95
95
|
// connectChangeRef
|
|
96
96
|
useRef(null);
|
|
97
|
+
const firstPreviewTimeRef = useRef(false);
|
|
97
98
|
const [isLowPowerDevice] = useState(awakeStatus !== undefined);
|
|
98
99
|
|
|
99
100
|
// 自定义计时老低功耗方案设备在线状态, 用于短暂时间报上下线的UI展示兼容 待实现
|
|
@@ -326,6 +327,7 @@ const Player = props => {
|
|
|
326
327
|
ipcTTTOperatorLog("VID: privateState_status_change: ".concat(privateState));
|
|
327
328
|
retry();
|
|
328
329
|
} else if (playState.initLy && privateState) {
|
|
330
|
+
stopPreview();
|
|
329
331
|
// 如果隐私模式为true, 主动推一波流变化的状态码,适配ios不触发connectChange的情况
|
|
330
332
|
onChangeStreamStatus && onChangeStreamStatus(-1001);
|
|
331
333
|
}
|
|
@@ -529,6 +531,15 @@ const Player = props => {
|
|
|
529
531
|
(_ipcCtx$current2 = ipcCtx.current) === null || _ipcCtx$current2 === void 0 || _ipcCtx$current2.startPreview({
|
|
530
532
|
success: () => {
|
|
531
533
|
ipcTTTOperatorLog('VID: start_preview_success');
|
|
534
|
+
if (typeof performanceEvent === 'function' && !firstPreviewTimeRef.current) {
|
|
535
|
+
performanceEvent({
|
|
536
|
+
launchData: '出流成功耗时',
|
|
537
|
+
success: () => {
|
|
538
|
+
firstPreviewTimeRef.current = true;
|
|
539
|
+
}
|
|
540
|
+
});
|
|
541
|
+
}
|
|
542
|
+
|
|
532
543
|
// console.log('开启预览:', devId);
|
|
533
544
|
setPlayState(d => {
|
|
534
545
|
d.loadingState = false;
|