@ray-js/ray-ipc-player 2.0.20-beta-7 → 2.0.20-beta-9
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.d.ts +1 -0
- package/lib/index.js +14 -2
- package/lib/index.module.less +1 -1
- package/lib/typings/index.d.ts +123 -0
- package/package.json +1 -1
package/lib/index.d.ts
CHANGED
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 } from 'ahooks';
|
|
10
|
-
import { setPageOrientation, usePageEvent, getNetworkType, offNetworkStatusChange, onNetworkStatusChange, publishDps, showToast } from '@ray-js/ray';
|
|
10
|
+
import { setPageOrientation, usePageEvent, getNetworkType, offNetworkStatusChange, onNetworkStatusChange, publishDps, showToast, getSystemInfoSync } from '@ray-js/ray';
|
|
11
11
|
import clsx from 'clsx';
|
|
12
12
|
import Strings from './i18n';
|
|
13
13
|
import Styles from './index.module.less';
|
|
@@ -112,7 +112,15 @@ const Player = props => {
|
|
|
112
112
|
const {
|
|
113
113
|
type
|
|
114
114
|
} = sizeData;
|
|
115
|
-
|
|
115
|
+
const {
|
|
116
|
+
platform,
|
|
117
|
+
deviceType
|
|
118
|
+
} = getSystemInfoSync();
|
|
119
|
+
if (platform === 'ios' && deviceType === 'pad') {
|
|
120
|
+
setScreenType('portrait');
|
|
121
|
+
} else {
|
|
122
|
+
setScreenType(type);
|
|
123
|
+
}
|
|
116
124
|
});
|
|
117
125
|
useMount(() => {
|
|
118
126
|
onNetworkStatusChange(res => {
|
|
@@ -565,6 +573,7 @@ const Player = props => {
|
|
|
565
573
|
* 跳转反馈小程序
|
|
566
574
|
*/
|
|
567
575
|
|
|
576
|
+
console.log(borderRadius, 'borderRadius=====');
|
|
568
577
|
return /*#__PURE__*/React.createElement(View, {
|
|
569
578
|
className: Styles.ipc_player,
|
|
570
579
|
onClick: () => {
|
|
@@ -669,6 +678,9 @@ const Player = props => {
|
|
|
669
678
|
className: clsx(Styles.errOperatorContainer)
|
|
670
679
|
}, getErrorContentByType(videoErrCode, 'retry') && /*#__PURE__*/React.createElement(View, {
|
|
671
680
|
className: clsx(Styles.operatorBtn, Styles.operatorRetry),
|
|
681
|
+
style: {
|
|
682
|
+
backgroundColor: "".concat(brandColor)
|
|
683
|
+
},
|
|
672
684
|
onClick: retry
|
|
673
685
|
}, getErrorContentByType(videoErrCode, 'retryText')), getErrorContentByType(videoErrCode, 'help') && /*#__PURE__*/React.createElement(View, {
|
|
674
686
|
className: clsx(Styles.operatorBtn, Styles.operatorHelp),
|
package/lib/index.module.less
CHANGED
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
declare module '*.module.less' {
|
|
2
|
+
const classes: {
|
|
3
|
+
readonly [key: string]: string;
|
|
4
|
+
};
|
|
5
|
+
export default classes;
|
|
6
|
+
declare module '*.less';
|
|
7
|
+
}
|
|
8
|
+
export type IProps = {
|
|
9
|
+
/**
|
|
10
|
+
* @description.en devId
|
|
11
|
+
* @description.zh 设备id
|
|
12
|
+
* @default ""
|
|
13
|
+
*/
|
|
14
|
+
devId: string;
|
|
15
|
+
/**
|
|
16
|
+
* @description.en onlineStatus
|
|
17
|
+
* @description.zh 设备是否在线
|
|
18
|
+
* @default true
|
|
19
|
+
*/
|
|
20
|
+
onlineStatus: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* @description.en privateState
|
|
23
|
+
* @description.zh 隐私模式
|
|
24
|
+
* @default false
|
|
25
|
+
*/
|
|
26
|
+
privateState?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* @description.en defaultMute
|
|
29
|
+
* @description.zh 默认静音
|
|
30
|
+
* @default true
|
|
31
|
+
*/
|
|
32
|
+
defaultMute?: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* @description.en clarity
|
|
35
|
+
* @description.zh 清晰度 normal:标清,hd:高清
|
|
36
|
+
* @default "normal"
|
|
37
|
+
*/
|
|
38
|
+
clarity?: 'normal' | 'hd';
|
|
39
|
+
/**
|
|
40
|
+
* @description.en updateLayout
|
|
41
|
+
* @description.zh 外层父节点样式变化,播放器监听不到,需要主动触发播放器视图更新,每次需要设置不同的字符串值
|
|
42
|
+
* @default ""
|
|
43
|
+
*/
|
|
44
|
+
updateLayout?: any;
|
|
45
|
+
/**
|
|
46
|
+
* @description.en onChangeStreamStatus
|
|
47
|
+
* @description.zh 通知视频流状态发生变化
|
|
48
|
+
* @default (data) => void
|
|
49
|
+
*/
|
|
50
|
+
onChangeStreamStatus?: (data) => void;
|
|
51
|
+
/**
|
|
52
|
+
* @description.en onCtx
|
|
53
|
+
* @description.zh 获取ipcPlayer实例ctx以及重试方法retry
|
|
54
|
+
* @default (playerRef) => void
|
|
55
|
+
*/
|
|
56
|
+
onCtx?: (playerRef) => void;
|
|
57
|
+
/**
|
|
58
|
+
* @description.en onInitPreview
|
|
59
|
+
* @description.zh 初始化预览成功通知
|
|
60
|
+
* @default (devId) => void
|
|
61
|
+
*/
|
|
62
|
+
onInitPreview?: (data) => void;
|
|
63
|
+
/**
|
|
64
|
+
* @description.en onPlayerTap
|
|
65
|
+
* @description.zh 播放器区域点击事件
|
|
66
|
+
* @default (devId) => void
|
|
67
|
+
*/
|
|
68
|
+
onPlayerTap?: (data) => void;
|
|
69
|
+
/**
|
|
70
|
+
* @description.en scalable
|
|
71
|
+
* @description.zh 是否可缩放
|
|
72
|
+
* @default true
|
|
73
|
+
*/
|
|
74
|
+
scalable?: boolean;
|
|
75
|
+
/**
|
|
76
|
+
* @description.en scaleMultiple
|
|
77
|
+
* @description.zh 缩放比例
|
|
78
|
+
* @default 0
|
|
79
|
+
*/
|
|
80
|
+
scaleMultiple?: number;
|
|
81
|
+
/**
|
|
82
|
+
* @description.en rotateZ
|
|
83
|
+
* @description.zh 摄像头旋转角度
|
|
84
|
+
* @default 0
|
|
85
|
+
*/
|
|
86
|
+
rotateZ?: number;
|
|
87
|
+
/**
|
|
88
|
+
* @description.en ptzControllable
|
|
89
|
+
* @description.zh 是否开启视频区云平台控制
|
|
90
|
+
* @default true
|
|
91
|
+
*/
|
|
92
|
+
ptzControllable?: boolean;
|
|
93
|
+
/**
|
|
94
|
+
* @description.en playerStyle
|
|
95
|
+
* @description.zh 播放器样式
|
|
96
|
+
* @default {}
|
|
97
|
+
*/
|
|
98
|
+
playerStyle?: {
|
|
99
|
+
bgColor?: string; // 背景底色
|
|
100
|
+
borderRadius?: number | string; // 边框圆角
|
|
101
|
+
borderStyle?: 'solid' | 'dashed'; // 边框样式
|
|
102
|
+
borderColor?: string; // 边框颜色
|
|
103
|
+
borderWidth?: string | number; // 边框宽度
|
|
104
|
+
};
|
|
105
|
+
/**
|
|
106
|
+
* @description.en loadText
|
|
107
|
+
* @description.zh 加载过程中的文案,可结合onChangeStreamStatus事件做文案配置
|
|
108
|
+
* @default "正在获取视频流..."
|
|
109
|
+
*/
|
|
110
|
+
loadText?: string;
|
|
111
|
+
/**
|
|
112
|
+
* @description.en objectFit:contain|fillCrop
|
|
113
|
+
* @description.zh 填充模式设置:contain: 图像长边填满屏幕,短边区域会被填充⿊⾊, fillCrop: 图像铺满屏幕
|
|
114
|
+
* @default "contain"
|
|
115
|
+
*/
|
|
116
|
+
objectFit?: string;
|
|
117
|
+
/**
|
|
118
|
+
* @description.en extend
|
|
119
|
+
* @description.zh 扩展属性
|
|
120
|
+
* @default {}
|
|
121
|
+
*/
|
|
122
|
+
extend?: Record<string, any>;
|
|
123
|
+
};
|