@ray-js/ipc-player-integration 0.0.28 → 0.0.29-beta.1

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.
Files changed (66) hide show
  1. package/lib/ctx/ctx.js +10 -2
  2. package/lib/ctx/multiCameraCtx.d.ts +73 -0
  3. package/lib/ctx/multiCameraCtx.js +176 -0
  4. package/lib/features/initPlayerWidgets/index.d.ts +5 -4
  5. package/lib/features/initPlayerWidgets/index.js +7 -0
  6. package/lib/features/initPlayerWidgets/multiCamera.d.ts +8 -0
  7. package/lib/features/initPlayerWidgets/multiCamera.js +78 -0
  8. package/lib/i18n/index.d.ts +20 -0
  9. package/lib/i18n/strings.d.ts +10 -0
  10. package/lib/i18n/strings.js +12 -2
  11. package/lib/iconfont/iconfont.css +197 -4
  12. package/lib/iconfont/iconfont.js +13 -13
  13. package/lib/iconfont/iconfont.json +336 -0
  14. package/lib/iconfont/iconfont.ttf +0 -0
  15. package/lib/iconfont/iconfont.woff +0 -0
  16. package/lib/iconfont/iconfont.woff2 +0 -0
  17. package/lib/interface.d.ts +90 -4
  18. package/lib/interface.js +56 -1
  19. package/lib/ui/constant.d.ts +6 -0
  20. package/lib/ui/constant.js +6 -0
  21. package/lib/ui/ui.js +187 -17
  22. package/lib/ui/ui.less +19 -21
  23. package/lib/utils/storage/index.d.ts +1 -0
  24. package/lib/utils/storage/index.js +8 -1
  25. package/lib/widgets/battery/battery.composition.d.ts +60 -4
  26. package/lib/widgets/fullScreen/fullScreen.js +5 -3
  27. package/lib/widgets/index.d.ts +2 -0
  28. package/lib/widgets/index.js +3 -1
  29. package/lib/widgets/multiCamera/constants.d.ts +1 -0
  30. package/lib/widgets/multiCamera/constants.js +1 -0
  31. package/lib/widgets/multiCamera/index.d.ts +8 -0
  32. package/lib/widgets/multiCamera/index.js +8 -0
  33. package/lib/widgets/multiCamera/index.less +214 -0
  34. package/lib/widgets/multiCamera/landscapeTip.d.ts +6 -0
  35. package/lib/widgets/multiCamera/landscapeTip.js +40 -0
  36. package/lib/widgets/multiCamera/moveView/index.d.ts +9 -0
  37. package/lib/widgets/multiCamera/moveView/index.js +22 -0
  38. package/lib/widgets/multiCamera/moveView/tyComponent/index.d.ts +1 -0
  39. package/lib/widgets/multiCamera/moveView/tyComponent/index.js +42 -0
  40. package/lib/widgets/multiCamera/moveView/tyComponent/index.json +3 -0
  41. package/lib/widgets/multiCamera/moveView/tyComponent/index.tyml +8 -0
  42. package/lib/widgets/multiCamera/moveView/tyComponent/index.tyss +4 -0
  43. package/lib/widgets/multiCamera/moveView/utils.d.ts +1 -0
  44. package/lib/widgets/multiCamera/moveView/utils.js +29 -0
  45. package/lib/widgets/multiCamera/moveablePtzControl.d.ts +22 -0
  46. package/lib/widgets/multiCamera/moveablePtzControl.js +302 -0
  47. package/lib/widgets/multiCamera/multiPtz.d.ts +11 -0
  48. package/lib/widgets/multiCamera/multiPtz.js +46 -0
  49. package/lib/widgets/multiCamera/ptzMoveableTip.d.ts +8 -0
  50. package/lib/widgets/multiCamera/ptzMoveableTip.js +66 -0
  51. package/lib/widgets/multiCamera/switchLayout.d.ts +8 -0
  52. package/lib/widgets/multiCamera/switchLayout.js +57 -0
  53. package/lib/widgets/multiCamera/tileActions.d.ts +6 -0
  54. package/lib/widgets/multiCamera/tileActions.js +15 -0
  55. package/lib/widgets/multiCamera/tileMultiPtz.d.ts +11 -0
  56. package/lib/widgets/multiCamera/tileMultiPtz.js +48 -0
  57. package/lib/widgets/multiCamera/tileSwitchLayout.d.ts +8 -0
  58. package/lib/widgets/multiCamera/tileSwitchLayout.js +38 -0
  59. package/lib/widgets/multiCamera/tileTip.d.ts +6 -0
  60. package/lib/widgets/multiCamera/tileTip.js +50 -0
  61. package/lib/widgets/ptz/ptz.less +15 -8
  62. package/lib/widgets/smallIntercom/index.d.ts +8 -0
  63. package/lib/widgets/smallIntercom/index.js +38 -0
  64. package/lib/widgets/smallIntercom/index.less +4 -0
  65. package/lib/widgets/voiceIntercom/voiceIntercom.d.ts +33 -2
  66. package/package.json +6 -5
@@ -0,0 +1,214 @@
1
+ @prefix: ~'ipc-player-plugin-multi';
2
+
3
+ .@{prefix} {
4
+ color: var(--iconColor);
5
+ font-size: calc(var(--iconPlayerSize) * var(--ipc-player-size-scale, 1)) !important;
6
+ }
7
+
8
+ .@{prefix}-actions {
9
+ display: flex;
10
+ flex-direction: column;
11
+ align-items: center;
12
+ justify-content: center;
13
+ gap: 8px;
14
+ }
15
+
16
+ .@{prefix}-actions-wrap {
17
+ position: absolute;
18
+ bottom: 98px;
19
+ right: 16px;
20
+ z-index: 340;
21
+ }
22
+
23
+ .@{prefix}-action-wrap {
24
+ display: flex;
25
+ align-items: center;
26
+ justify-content: center;
27
+ width: calc(42px * var(--ipc-player-size-scale, 1));
28
+ height: calc(42px * var(--ipc-player-size-scale, 1));
29
+ background-color: rgba(0, 0, 0, 0.7);
30
+ border: 1px solid rgba(255, 255, 255, 0.2);
31
+ border-radius: 8px;
32
+ }
33
+
34
+ .@{prefix}-ptz-control-wrap {
35
+ position: absolute;
36
+ bottom: 98px;
37
+ left: calc(32px * var(--ipc-player-size-scale, 1));
38
+ z-index: 348;
39
+ }
40
+
41
+ .@{prefix}-moveable-ptz-control {
42
+ --ptz-bg-color: rgba(0, 0, 0, 0.4);
43
+ --ptz-arrow-bg-color: rgba(0, 0, 0, 0.4);
44
+ --app-native-btn-bg-color: transparent;
45
+ --ptz-border-color: rgba(255, 255, 255, 0.2);
46
+ --ptz-arrow-icon-color: #fff;
47
+ --ptz-circle-inner-bg-color: rgba(255, 255, 255, 0.65);
48
+ }
49
+
50
+ .@{prefix}-tile-tip-wrap {
51
+ position: absolute;
52
+ top: 0;
53
+ left: 0;
54
+ right: 0;
55
+ bottom: 0;
56
+ z-index: 999;
57
+ transition: all 0.3 ease;
58
+ font-size: 14px;
59
+ color: #fff;
60
+
61
+ .@{prefix}-tile-tip-content {
62
+ position: absolute;
63
+
64
+ width: 54px;
65
+ height: 54px;
66
+ border-radius: 12px;
67
+ border: 1px dashed rgba(255, 255, 255, 0.5);
68
+ box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.7);
69
+
70
+ &.@{prefix}-step1 {
71
+ right: 46px;
72
+ bottom: 0px;
73
+ }
74
+
75
+ &.@{prefix}-step2 {
76
+ right: 10px;
77
+ bottom: 91px;
78
+ }
79
+
80
+ &.@{prefix}-ptz-tip {
81
+ width: 204px;
82
+ height: 204px;
83
+ border-radius: 50%;
84
+ left: 18px;
85
+ bottom: 75px;
86
+ }
87
+
88
+ &.@{prefix}-landscape-tip {
89
+ right: 25px;
90
+ bottom: 18px;
91
+ }
92
+
93
+ &::after {
94
+ content: '';
95
+ position: absolute;
96
+ box-sizing: border-box;
97
+ }
98
+
99
+ &.@{prefix}-step1::after {
100
+ border-left: 1px dashed rgba(255, 255, 255, 0.5);
101
+ height: 50px;
102
+ width: 1px;
103
+ left: 50%;
104
+ transform: translateX(-50%) translateY(-100%);
105
+ }
106
+
107
+ &.@{prefix}-step2::after {
108
+ top: 50%;
109
+ left: 0;
110
+ transform: translateX(-100%) translateY(-50%);
111
+ height: 1px;
112
+ width: 50px;
113
+ border-top: 1px dashed rgba(255, 255, 255, 0.5);
114
+ }
115
+
116
+ &.@{prefix}-ptz-tip::after {
117
+ border-left: 1px dashed rgba(255, 255, 255, 0.5);
118
+ height: 50px;
119
+ width: 1px;
120
+ left: 50%;
121
+ transform: translateX(-50%) translateY(-100%);
122
+ }
123
+
124
+ &.@{prefix}-landscape-tip::after {
125
+ border-left: 1px dashed rgba(255, 255, 255, 0.5);
126
+ height: 50px;
127
+ width: 1px;
128
+ left: 50%;
129
+ transform: translateX(-50%) translateY(-100%);
130
+ }
131
+
132
+ &::before {
133
+ content: '';
134
+ position: absolute;
135
+ background-color: rgba(255, 255, 255, 0.5);
136
+ height: 4px;
137
+ width: 4px;
138
+ border-radius: 50%;
139
+ }
140
+
141
+ &.@{prefix}-step1::before {
142
+ left: 50%;
143
+ transform: translateX(-50%) translateY(-54px);
144
+ }
145
+
146
+ &.@{prefix}-step2::before {
147
+ top: 50%;
148
+ left: 0;
149
+ transform: translateX(-54px) translateY(-50%);
150
+ }
151
+
152
+ &.@{prefix}-ptz-tip::before {
153
+ left: 50%;
154
+ transform: translateX(-50%) translateY(-54px);
155
+ }
156
+
157
+ &.@{prefix}-landscape-tip::before {
158
+ left: 50%;
159
+ transform: translateX(-50%) translateY(-54px);
160
+ }
161
+ }
162
+
163
+ .@{prefix}-tile-tip-text {
164
+ position: absolute;
165
+ max-width: 200px;
166
+
167
+ &.@{prefix}-step1 {
168
+ right: 60px;
169
+ bottom: 190px;
170
+ }
171
+
172
+ &.@{prefix}-step2 {
173
+ right: 130px;
174
+ bottom: 110px;
175
+ }
176
+
177
+ &.@{prefix}-ptz-tip {
178
+ left: 75px;
179
+ bottom: 420px;
180
+ }
181
+
182
+ &.@{prefix}-landscape-tip {
183
+ right: 20px;
184
+ bottom: 210px;
185
+ }
186
+ }
187
+
188
+ .@{prefix}-tile-tip-button {
189
+ padding: 12px 32px;
190
+ border-radius: 250px;
191
+ border: 1px solid rgba(255, 255, 255, 0.5);
192
+ position: absolute;
193
+
194
+ &.@{prefix}-step1 {
195
+ right: 60px;
196
+ bottom: 120px;
197
+ }
198
+
199
+ &.@{prefix}-step2 {
200
+ right: 130px;
201
+ bottom: 50px;
202
+ }
203
+
204
+ &.@{prefix}-ptz-tip {
205
+ left: 75px;
206
+ bottom: 360px;
207
+ }
208
+
209
+ &.@{prefix}-landscape-tip {
210
+ right: 20px;
211
+ bottom: 140px;
212
+ }
213
+ }
214
+ }
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ import { ComponentConfigProps } from '../../interface';
3
+ import './index.less';
4
+ type Props = ComponentConfigProps;
5
+ export declare const LandscapeTip: (props: Props) => React.JSX.Element | null;
6
+ export {};
@@ -0,0 +1,40 @@
1
+ import React, { useState } from 'react';
2
+ import { View, CoverView, Text } from '@ray-js/ray';
3
+ import clsx from 'clsx';
4
+ import { useStore } from '../../ctx/store';
5
+ import { landscapeTipId } from '../../ui/constant';
6
+ import { PlayState } from '../../interface';
7
+ import Strings from '../../i18n';
8
+ import { multiPrefix } from './constants';
9
+ import { Storage } from '../../utils/storage';
10
+ import './index.less';
11
+ export const LandscapeTip = props => {
12
+ const {
13
+ devId,
14
+ deleteContent
15
+ } = props;
16
+ const [showTipModal, setShowTipModal] = useState(true);
17
+ const {
18
+ playState
19
+ } = useStore({
20
+ playState: props.playState
21
+ });
22
+ // 获取缓存状态
23
+ const hideTipModal = () => {
24
+ setShowTipModal(false);
25
+ deleteContent('absolute', landscapeTipId);
26
+ const storage = new Storage(devId);
27
+ storage.set(landscapeTipId, true);
28
+ };
29
+ if (showTipModal && playState === PlayState.PLAYING) {
30
+ return /*#__PURE__*/React.createElement(CoverView, null, /*#__PURE__*/React.createElement(View, {
31
+ className: clsx(`${multiPrefix}-tile-tip-content`, `${multiPrefix}-landscape-tip`)
32
+ }), /*#__PURE__*/React.createElement(Text, {
33
+ className: clsx(`${multiPrefix}-tile-tip-text`, `${multiPrefix}-landscape-tip`)
34
+ }, Strings.getLang(`ipc_player_tile_tip_text_step2`)), /*#__PURE__*/React.createElement(View, {
35
+ className: clsx(`${multiPrefix}-tile-tip-button`, `${multiPrefix}-landscape-tip`),
36
+ onClick: hideTipModal
37
+ }, Strings.getLang('ipc_player_tip_confirm')));
38
+ }
39
+ return null;
40
+ };
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ interface MoveViewProps {
3
+ instanceId: string;
4
+ className?: string;
5
+ style?: React.CSSProperties;
6
+ children?: React.ReactNode;
7
+ }
8
+ export default function MoveView(props: MoveViewProps): React.JSX.Element;
9
+ export {};
@@ -0,0 +1,22 @@
1
+ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
+ import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
3
+ const _excluded = ["style", "className", "children"];
4
+ import React from 'react';
5
+ import { style as styleTrans } from './utils';
6
+ // @ts-ignore
7
+ import MoveViewTy from './tyComponent';
8
+ export default function MoveView(props) {
9
+ const {
10
+ style = {},
11
+ className = '',
12
+ children
13
+ } = props,
14
+ rest = _objectWithoutProperties(props, _excluded);
15
+ return /*#__PURE__*/React.createElement(MoveViewTy, (() => {
16
+ return _objectSpread({
17
+ customStyle: styleTrans(style),
18
+ id: rest.instanceId,
19
+ customClass: className
20
+ }, rest);
21
+ })(), children);
22
+ }
@@ -0,0 +1 @@
1
+ import './index.tyss';
@@ -0,0 +1,42 @@
1
+ import './index.tyss';
2
+ import { style as styleTrans } from '../utils';
3
+
4
+ // eslint-disable-next-line no-undef
5
+ Component({
6
+ properties: {
7
+ customStyle: {
8
+ type: String,
9
+ value: '',
10
+ observer: function (v) {
11
+ if (!v) return;
12
+ this.setData({
13
+ currStyle: styleTrans(v)
14
+ });
15
+ }
16
+ },
17
+ customClass: {
18
+ type: String,
19
+ value: ''
20
+ },
21
+ instanceId: {
22
+ type: String,
23
+ value: 'test'
24
+ }
25
+ },
26
+ data: {
27
+ currStyle: ''
28
+ },
29
+ lifetimes: {
30
+ ready() {
31
+ //
32
+ }
33
+ },
34
+ methods: {
35
+ setStyle(value) {
36
+ if (!value) return;
37
+ this.setData({
38
+ currStyle: styleTrans(value)
39
+ });
40
+ }
41
+ }
42
+ });
@@ -0,0 +1,3 @@
1
+ {
2
+ "component": true
3
+ }
@@ -0,0 +1,8 @@
1
+ <view
2
+ id="{{instanceId}}"
3
+ instanceId="{{instanceId}}"
4
+ class="ray-move-view {{customClass}}"
5
+ style="{{currStyle}}"
6
+ >
7
+ <slot></slot>
8
+ </view>
@@ -0,0 +1,4 @@
1
+ .ray-move-view {
2
+ position: relative;
3
+ z-index: 89;
4
+ }
@@ -0,0 +1 @@
1
+ export declare function style(styles: any): any;
@@ -0,0 +1,29 @@
1
+ import "core-js/modules/esnext.iterator.constructor.js";
2
+ import "core-js/modules/esnext.iterator.filter.js";
3
+ import "core-js/modules/esnext.iterator.map.js";
4
+ function kebabCase(word) {
5
+ const newWord = word.replace(RegExp('[A-Z]', 'g'), function (i) {
6
+ return '-' + i;
7
+ }).toLowerCase();
8
+ return newWord;
9
+ }
10
+ export function style(styles) {
11
+ if (typeof styles === 'string') {
12
+ return styles;
13
+ }
14
+ if (Array.isArray(styles)) {
15
+ return styles.filter(function (item) {
16
+ return item != null && item !== '';
17
+ }).map(function (item) {
18
+ return style(item);
19
+ }).join(';');
20
+ }
21
+ if (typeof styles === 'object') {
22
+ return Object.keys(styles).filter(function (key) {
23
+ return styles[key] != null && styles[key] !== '';
24
+ }).map(function (key) {
25
+ return [kebabCase(key), [styles[key]]].join(':');
26
+ }).join(';');
27
+ }
28
+ return styles || '';
29
+ }
@@ -0,0 +1,22 @@
1
+ import React from 'react';
2
+ import { ComponentConfigProps } from '../../interface';
3
+ import './index.less';
4
+ type Props = ComponentConfigProps & {
5
+ positionLeft?: number;
6
+ positionBottom?: number;
7
+ height?: number;
8
+ onDragStart?: (data: {
9
+ positionLeft: number;
10
+ positionBottom: number;
11
+ }) => void;
12
+ onDragEnd?: (data: {
13
+ positionLeft: number;
14
+ positionBottom: number;
15
+ }) => void;
16
+ };
17
+ /**
18
+ * 可移动的 PTZ 控制器,目前仅在多目使用
19
+ */
20
+ export declare const MoveablePtzControlItem: (props: Props) => React.JSX.Element;
21
+ export declare const MoveablePtzControl: (props: Props) => React.JSX.Element;
22
+ export {};