@ray-js/ipc-player-integration 0.0.1-beta-5 → 0.0.1-beta-6

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 (42) hide show
  1. package/lib/ctx/store.d.ts +1 -1
  2. package/lib/ctx/store.js +1 -0
  3. package/lib/hooks/useVideoBitKbps/index.js +3 -27
  4. package/lib/iconfont/iconfont.css +0 -1
  5. package/lib/interface.d.ts +2 -0
  6. package/lib/plugins/battery/battery.less +18 -19
  7. package/lib/plugins/fullScreen/fullScreen.js +15 -8
  8. package/lib/plugins/fullScreen/fullScreen.less +13 -5
  9. package/lib/plugins/fullScreen/verticalScreen.less +4 -2
  10. package/lib/plugins/fullScreen/voiceIntercom.d.ts +5 -0
  11. package/lib/plugins/fullScreen/voiceIntercom.js +32 -0
  12. package/lib/plugins/muted/muted.js +2 -2
  13. package/lib/plugins/muted/muted.less +3 -4
  14. package/lib/plugins/recordVideo/recordVideo.less +11 -11
  15. package/lib/plugins/screenshot/screenshot.less +18 -14
  16. package/lib/plugins/tempHumidity/tempHumidity.js +5 -7
  17. package/lib/plugins/tempHumidity/tempHumidity.less +10 -7
  18. package/lib/plugins/videoBitKbps/videoBitKbps.js +93 -3
  19. package/lib/plugins/videoBitKbps/videoBitKbps.less +5 -4
  20. package/lib/plugins/voiceIntercom/voiceIntercom.d.ts +4 -1
  21. package/lib/plugins/voiceIntercom/voiceIntercom.js +7 -3
  22. package/lib/plugins/voiceIntercom/voiceIntercom.less +5 -4
  23. package/lib/ui/bottomContent.d.ts +8 -0
  24. package/lib/ui/bottomContent.js +30 -0
  25. package/lib/ui/constant.d.ts +5 -0
  26. package/lib/ui/constant.js +5 -0
  27. package/lib/ui/context.d.ts +6 -0
  28. package/lib/ui/context.js +8 -0
  29. package/lib/ui/event.d.ts +8 -0
  30. package/lib/ui/event.js +26 -0
  31. package/lib/ui/hooks.d.ts +1 -0
  32. package/lib/ui/hooks.js +25 -0
  33. package/lib/ui/index.d.ts +2 -0
  34. package/lib/ui/index.js +3 -1
  35. package/lib/ui/topContent.d.ts +8 -0
  36. package/lib/ui/topContent.js +30 -0
  37. package/lib/ui/ui.d.ts +2 -1
  38. package/lib/ui/ui.js +128 -48
  39. package/lib/ui/ui.less +28 -22
  40. package/lib/utils/ipcApi/index.d.ts +78 -0
  41. package/lib/utils/ipcApi/index.js +251 -0
  42. package/package.json +2 -2
@@ -1,4 +1,5 @@
1
1
  import { RetAtom } from '../interface';
2
+ export { getDefaultStore } from 'jotai';
2
3
  export declare const topContent: import("jotai").PrimitiveAtom<never[]> & {
3
4
  init: never[];
4
5
  };
@@ -8,4 +9,3 @@ type ExtractReturnType<T> = {
8
9
  };
9
10
  export declare const useStore: <V, T extends Record<string, RetAtom<V>>>(options: T) => ExtractReturnType<T>;
10
11
  export declare const updateAtom: <T>(atom: RetAtom<T>, value: T | ((prevValue: T) => T)) => void;
11
- export {};
package/lib/ctx/store.js CHANGED
@@ -1,5 +1,6 @@
1
1
  import { useRef } from 'react';
2
2
  import { atom, useAtomValue, getDefaultStore } from 'jotai';
3
+ export { getDefaultStore } from 'jotai';
3
4
  export const topContent = atom([]);
4
5
  export const useAtom = defaultValue => {
5
6
  const ref = useRef();
@@ -1,3 +1,4 @@
1
+ import { getVideoBitrateKbps } from '../../utils/ipcApi';
1
2
  import { useEffect, useState } from 'react';
2
3
  export const useVideoBitKbps = devId => {
3
4
  const [bitKbps, setBitKbps] = useState('');
@@ -11,34 +12,9 @@ export const useVideoBitKbps = devId => {
11
12
  // };
12
13
  }, []);
13
14
  const init = async () => {
14
- let res = await getVideoBitrateKbps();
15
+ const res = await getVideoBitrateKbps(devId);
15
16
  console.log('res===bitKbps', res);
16
- res += 'KB/S';
17
- setBitKbps(res);
18
- };
19
- const getVideoBitrateKbps = () => {
20
- return new Promise((resolve, reject) => {
21
- ty.ipc.getVideoBitrateKbps({
22
- devId,
23
- extendParam: {},
24
- success: _ref => {
25
- let {
26
- kpbs = '0'
27
- } = _ref;
28
- resolve(kpbs);
29
- },
30
- fail: _ref2 => {
31
- let {
32
- errorMsg,
33
- errorCode
34
- } = _ref2;
35
- return reject(errorMsg);
36
- }
37
- });
38
- }).catch(error => {
39
- console.log('res===getVideoBitrateKbps', error);
40
- return '0';
41
- });
17
+ setBitKbps(res.kpbs + 'KB/S');
42
18
  };
43
19
  return bitKbps;
44
20
  };
@@ -7,7 +7,6 @@
7
7
 
8
8
  .icon-panel {
9
9
  font-family: "icon-panel" !important;
10
- font-size: 16px;
11
10
  font-style: normal;
12
11
  -webkit-font-smoothing: antialiased;
13
12
  -moz-osx-font-smoothing: grayscale;
@@ -54,6 +54,8 @@ export type ComponentConfig<T = ReturnType<UseCtx> & Record<string, any>> = {
54
54
  id: string;
55
55
  content: (props: T) => React.ReactElement;
56
56
  initProps?: T;
57
+ absolutePosition?: Pick<React.CSSProperties, 'top' | 'left' | 'right' | 'bottom'>;
58
+ absoluteContentClassName?: string;
57
59
  };
58
60
  export type ComponentConfigProps = {
59
61
  IPCPlayerContext: IpcContext;
@@ -1,16 +1,15 @@
1
1
  .ipc-player-plugin-battery {
2
2
  display: flex;
3
3
  align-items: center;
4
- background-color: red;
5
- height: 48rpx;
6
- padding: 0 18rpx;
7
- border-radius: 48rpx;
4
+ height: calc(24px * var(--ipc-player-size-scale, 1));
5
+ padding: 0 calc(9px * var(--ipc-player-size-scale, 1));
6
+ border-radius: calc(24px * var(--ipc-player-size-scale, 1));
8
7
  background-color: rgba(255, 255, 255, 0.1);
9
8
  backdrop-filter: blur(10px);
10
9
  &.ipc-player-plugin-battery-absolute {
11
10
  position: absolute;
12
11
  top: 50%;
13
- left: 11px;
12
+ left: calc(16px * var(--ipc-player-size-scale, 1));
14
13
  transform: translateY(-50%);
15
14
  }
16
15
  &.ipc-player-plugin-battery-relative {
@@ -21,26 +20,26 @@
21
20
  }
22
21
  .ipc-player-plugin-battery-border {
23
22
  position: relative;
24
- width: 32rpx;
25
- height: 24rpx;
23
+ width: calc(16px * var(--ipc-player-size-scale, 1));
24
+ height: calc(12px * var(--ipc-player-size-scale, 1));;
26
25
  box-sizing: border-box;
27
- border: 4rpx solid #fff;
28
- margin-right: 8rpx;
29
- border-radius: 6rpx;
26
+ border: calc(2px * var(--ipc-player-size-scale, 1)) solid #fff;
27
+ margin-right: calc(4px * var(--ipc-player-size-scale, 1));;
28
+ border-radius: calc(3px * var(--ipc-player-size-scale, 1));;
30
29
  overflow: visible;
31
30
  .ipc-player-plugin-battery-border-1 {
32
31
  position: absolute;
33
- height: 10rpx;
34
- width: 5rpx;
32
+ height: calc(5px * var(--ipc-player-size-scale, 1));
33
+ width: calc(2px * var(--ipc-player-size-scale, 1));
35
34
  background-color: #fff;
36
- left: -7rpx;
37
- top: 4rpx;
38
- border-radius: 4rpx;
35
+ left: calc(-3.5px * var(--ipc-player-size-scale, 1));
36
+ top: calc(2px * var(--ipc-player-size-scale, 1));
37
+ border-radius: calc(2px * var(--ipc-player-size-scale, 1));
39
38
  }
40
39
  .ipc-player-plugin-battery-value-wrap {
41
40
  position: absolute;
42
- width: 20rpx;
43
- height: 12rpx;
41
+ width: calc(10px * var(--ipc-player-size-scale, 1));
42
+ height: calc(6px * var(--ipc-player-size-scale, 1));
44
43
  left: 50%;
45
44
  top: 50%;
46
45
  transform: translate(-50%, -50%);
@@ -59,8 +58,8 @@
59
58
 
60
59
 
61
60
  .ipc-player-plugin-battery-text {
62
- font-size: 24rpx;
63
- line-height: 24rpx;
61
+ font-size: calc(12px * var(--ipc-player-size-scale, 1));
62
+ line-height: calc(12px * var(--ipc-player-size-scale, 1));
64
63
  color: var(--fontColor);
65
64
  font-family: 'Manrope';
66
65
  font-weight: 600;
@@ -1,9 +1,11 @@
1
1
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
- import React from 'react';
3
- import { View, setPageOrientation, CoverView } from '@ray-js/ray';
2
+ import React, { useContext } from 'react';
3
+ import { View, setPageOrientation } from '@ray-js/ray';
4
+ import { UIEventContext } from '../../ui/context';
5
+ import { startTimeToHideAllComponent, showAllComponent } from '../../ui/constant';
4
6
  import { useStore } from '../../ctx/store';
5
7
  import { VerticalScreen } from './verticalScreen';
6
- import { VoiceIntercom } from '../voiceIntercom';
8
+ import { VoiceIntercom } from './voiceIntercom';
7
9
  import './fullScreen.less';
8
10
  const VerticalScreenId = 'VerticalScreen';
9
11
  const VoiceIntercomId = 'VoiceIntercom';
@@ -19,6 +21,9 @@ export function FullScreen(props) {
19
21
  } = useStore({
20
22
  screenType: screenTypeAtom
21
23
  });
24
+ const {
25
+ event
26
+ } = useContext(UIEventContext);
22
27
  const handFull = () => {
23
28
  ty.hideMenuButton();
24
29
  ty.hideStatusBar();
@@ -26,36 +31,38 @@ export function FullScreen(props) {
26
31
  type: 'custom'
27
32
  });
28
33
 
29
- // 显示全屏按钮5s后隐藏
30
- // showFullButtonAnd5sHide();
31
34
  // 添加全屏后,返回竖屏的控件
32
35
  addContent('top', {
33
36
  id: VerticalScreenId,
34
37
  content: VerticalScreen,
35
38
  initProps: _objectSpread(_objectSpread({}, props), {}, {
36
- onClick: handClick.bind(null, 'vertical')
39
+ onClick: () => {
40
+ event.emit(showAllComponent);
41
+ handClick('vertical');
42
+ }
37
43
  })
38
44
  });
39
45
  // 全屏后,添加语音对讲控件
40
46
  addContent('absolute', {
41
47
  id: VoiceIntercomId,
42
48
  content: props => {
43
- return /*#__PURE__*/React.createElement(CoverView, {
49
+ return /*#__PURE__*/React.createElement(View, {
44
50
  className: "ipc-player-plugin-full-screen-voice"
45
51
  }, /*#__PURE__*/React.createElement(VoiceIntercom, props));
46
52
  },
53
+ absoluteContentClassName: 'ipc-player-plugin-full-screen-voice-warp',
47
54
  initProps: _objectSpread({}, props)
48
55
  });
49
56
  };
50
57
  const handClick = target => {
51
58
  const pageOrientation = target === 'vertical' ? 'portrait' : 'landscape';
52
59
  setScreenType(target);
53
- handFull(); // todo
54
60
  setPageOrientation({
55
61
  pageOrientation,
56
62
  success: () => {
57
63
  if (target === 'full') {
58
64
  handFull();
65
+ event.emit(startTimeToHideAllComponent);
59
66
  } else {
60
67
  ty.setNavigationBarBack({
61
68
  type: 'system'
@@ -2,15 +2,23 @@
2
2
  position: absolute;
3
3
  top: 50%;
4
4
  transform: translateY(-50%);
5
- right: 18px;
5
+ right: calc(16px * var(--ipc-player-size-scale, 1));
6
6
  color: var(--iconColor);
7
- font-size: var(--iconFontSize);
7
+ font-size: calc(var(--iconFontSize) * var(--ipc-player-size-scale, 1));
8
8
  }
9
9
 
10
- .ipc-player-plugin-full-screen-voice {
10
+ .ipc-player-plugin-full-screen-voice-warp {
11
11
  position: absolute;
12
12
  top: 50%;
13
- transform: translateY(-50%);
14
- right: 20px;
13
+ transform: translate(0, -50%);
14
+ right: calc(10px * var(--ipc-player-size-scale, 1));;
15
15
  z-index: 3;
16
+ }
17
+
18
+ .ipc-player-plugin-full-screen-voice {
19
+ transform: translate(0, 0);
20
+ transition: transform ease-in 0.3s;
21
+ &.ipc-player-plugin-full-screen-voice-hide {
22
+ transform: translate(180%, 0);
23
+ }
16
24
  }
@@ -3,9 +3,11 @@
3
3
  padding: 10rpx;
4
4
  top: 50%;
5
5
  transform: translateY(-50%);
6
- left: 24px;
6
+ // left: 24px;
7
+ left: calc(12px * var(--ipc-player-size-scale, 1));
7
8
  .ipc-player-plugin-vertical-screen-icon {
8
- font-size: var(--iconFontSize);
9
+ // font-size: var(--iconFontSize);
10
+ font-size: calc(var(--iconFontSize) * var(--ipc-player-size-scale, 1));
9
11
  color: var(--iconColor);
10
12
  }
11
13
  }
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import type { ComponentConfigProps } from '../../interface';
3
+ type Props = ComponentConfigProps;
4
+ export declare function VoiceIntercom(props: Props): React.JSX.Element;
5
+ export {};
@@ -0,0 +1,32 @@
1
+ import _extends from "@babel/runtime/helpers/esm/extends";
2
+ import React, { useContext } from 'react';
3
+ import { CoverView } from '@ray-js/ray';
4
+ import clsx from 'clsx';
5
+ import { VoiceIntercom as Component } from '../voiceIntercom';
6
+ import { useComponentHideState } from '../../ui/hooks';
7
+ import { UIEventContext } from '../../ui/context';
8
+ import { startTimeToHideAllComponent, pauseTimeToHideAllComponent } from '../../ui/constant';
9
+ import { useStore } from '../../ctx/store';
10
+ export function VoiceIntercom(props) {
11
+ const {
12
+ screenType
13
+ } = useStore({
14
+ screenType: props.screenType
15
+ });
16
+ const [shouldHide] = useComponentHideState(screenType);
17
+ const {
18
+ event
19
+ } = useContext(UIEventContext);
20
+ return /*#__PURE__*/React.createElement(CoverView, {
21
+ className: clsx('ipc-player-plugin-full-screen-voice', {
22
+ 'ipc-player-plugin-full-screen-voice-hide': shouldHide
23
+ })
24
+ }, /*#__PURE__*/React.createElement(Component, _extends({}, props, {
25
+ onTouchStart: () => {
26
+ event.emit(pauseTimeToHideAllComponent);
27
+ },
28
+ onTouchEnd: () => {
29
+ event.emit(startTimeToHideAllComponent);
30
+ }
31
+ })));
32
+ }
@@ -44,8 +44,8 @@ export const Muted = props => {
44
44
  display: 'flex'
45
45
  }
46
46
  }, isMuted ? /*#__PURE__*/React.createElement(Text, {
47
- className: "text-icon icon-panel icon-panel-jingyin"
47
+ className: "ipc-player-plugin-muted-text-icon icon-panel icon-panel-jingyin"
48
48
  }) : /*#__PURE__*/React.createElement(Text, {
49
- className: "text-icon icon-panel icon-panel-yinliang"
49
+ className: "ipc-player-plugin-muted-text-icon icon-panel icon-panel-yinliang"
50
50
  }));
51
51
  };
@@ -1,5 +1,4 @@
1
- .text-icon {
2
- color: var(--iconColor);
3
- font-size: var(--iconFontSize);
4
- padding: 8rpx;
1
+ .ipc-player-plugin-muted-text-icon {
2
+ color: var(--iconColor);
3
+ font-size: calc(var(--iconFontSize) * var(--ipc-player-size-scale, 1));
5
4
  }
@@ -1,37 +1,37 @@
1
1
  .ipc-player-plugin-record-video-icon {
2
- font-size: var(--iconFontSize);
2
+ font-size: calc(var(--iconFontSize) * var(--ipc-player-size-scale, 1));
3
3
  color: var(--iconColor);
4
4
  }
5
5
  .ipc-player-plugin-record-video-toast {
6
6
  z-index: 2;
7
7
  position: absolute;
8
8
  display: flex;
9
- padding: 24rpx;
9
+ padding: calc(12px * var(--ipc-player-size-scale, 1));
10
10
  align-items: center;
11
11
  left: 50%;
12
12
  transform: translateX(-50%);
13
- top: 14rpx;
13
+ top: calc(7px * var(--ipc-player-size-scale, 1));
14
14
  background-color: var(--bg-color);
15
- border-radius: 16rpx;
15
+ border-radius: calc(8px * var(--ipc-player-size-scale, 1));
16
16
  .ipc-player-plugin-record-video-toast-point {
17
- width: 12rpx;
18
- height: 12rpx;
19
- border-radius: 12rpx;
17
+ width: calc(6px * var(--ipc-player-size-scale, 1));
18
+ height: calc(6px * var(--ipc-player-size-scale, 1));
19
+ border-radius: calc(6px * var(--ipc-player-size-scale, 1));
20
20
  background-color: #FF3838;
21
21
  }
22
22
  .ipc-player-plugin-record-video-toast-time {
23
- font-size: 24rpx;
23
+ font-size: calc(12px * var(--ipc-player-size-scale, 1));;
24
24
  font-weight: 600;
25
25
  color: var(--fontColor);
26
- margin-left: 16rpx;
26
+ margin-left: calc(8px * var(--ipc-player-size-scale, 1));;
27
27
  display: flex;
28
28
  align-items: center;
29
29
  .ipc-player-plugin-record-video-toast-time-warp {
30
- width: 34rpx;
30
+ width: calc(17px * var(--ipc-player-size-scale, 1));;
31
31
  text-align: center;
32
32
  }
33
33
  .ipc-player-plugin-record-video-toast-time-delimiter {
34
- margin: 0 4rpx;
34
+ margin: 0 calc(2px * var(--ipc-player-size-scale, 1));;
35
35
  }
36
36
  }
37
37
  }
@@ -1,38 +1,42 @@
1
1
  .ipc-player-plugin-screenshot-icon {
2
2
  color: var(--iconColor);
3
- font-size: var(--iconFontSize);
3
+ font-size: calc(var(--iconFontSize) * var(--ipc-player-size-scale, 1));
4
4
  }
5
5
  .ipc-player-plugin-screenshot-toast {
6
6
  position: absolute;
7
7
  width: 90%;
8
- border-radius: 16rpx;
8
+ border-radius: calc(8px * var(--ipc-player-size-scale, 1));;
9
9
  background-color: var(--bg-color);
10
10
  left: 50%;
11
11
  transform: translateX(-50%);
12
- top: 32rpx;
12
+ top: calc(16px * var(--ipc-player-size-scale, 1));
13
13
  display: flex;
14
14
  align-items: center;
15
- padding: 16rpx 32rpx;
15
+ padding: calc(8px * var(--ipc-player-size-scale, 1)) calc(16px * var(--ipc-player-size-scale, 1));
16
16
  z-index: 3;
17
17
  .ipc-player-plugin-screenshot-toast-image {
18
- width: 132rpx;
19
- height: 74rpx;
20
- border-radius: 8rpx;
18
+ width: calc(66px * var(--ipc-player-size-scale, 1));
19
+ height: calc(37px * var(--ipc-player-size-scale, 1));
20
+ border-radius: calc(4px * var(--ipc-player-size-scale, 1));
21
21
  }
22
22
  .ipc-player-plugin-screenshot-toast-title {
23
- margin-left: 24rpx;
24
- font-size: 28rpx;
23
+ margin-left: calc(12px * var(--ipc-player-size-scale, 1));
24
+ font-size: calc(14px * var(--ipc-player-size-scale, 1));
25
25
  color: var(--fontColor);
26
- line-height: 40rpx;
26
+ line-height: calc(20px * var(--ipc-player-size-scale, 1));
27
27
  max-width: 60%;
28
28
  }
29
29
  .ipc-player-plugin-screenshot-toast-bottom {
30
30
  position: absolute;
31
- right: 32rpx;
31
+ // right: 32rpx;
32
+ right: calc(16px * var(--ipc-player-size-scale, 1));
32
33
  border: 1rpx solid #1989FA;
33
- border-radius: 8rpx;
34
- padding: 10rpx 22rpx;
34
+ // border-radius: 8rpx;
35
+ border-radius: calc(4px * var(--ipc-player-size-scale, 1));
36
+ // padding: 10rpx 22rpx;
37
+ padding: calc(5px * var(--ipc-player-size-scale, 1)) calc(11px * var(--ipc-player-size-scale, 1));
35
38
  color: #1989FA;
36
- font-size: 28rpx;
39
+ // font-size: 28rpx;
40
+ font-size: calc(14px * var(--ipc-player-size-scale, 1));
37
41
  }
38
42
  }
@@ -17,22 +17,20 @@ export const TempHumidity = props => {
17
17
  const tempRender = () => {
18
18
  if (tempUnit === '1') {
19
19
  return tempF && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Text, {
20
- className: "text-icon-tempHumidity icon-panel icon-panel-wendu"
20
+ className: "ipc-player-plugin-tempHumidity-text-icon icon-panel icon-panel-wendu"
21
21
  }), /*#__PURE__*/React.createElement(Text, {
22
22
  className: "tempHumidity"
23
23
  }, tempF));
24
24
  }
25
25
  return tempC && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Text, {
26
- className: "text-icon-tempHumidity icon-panel icon-panel-wendu"
27
- }), /*#__PURE__*/React.createElement(Text, {
28
- className: "tempHumidity"
29
- }, tempC), /*#__PURE__*/React.createElement(Text, {
30
- className: "divider"
26
+ className: "ipc-player-plugin-tempHumidity-text-icon icon-panel icon-panel-wendu"
27
+ }), /*#__PURE__*/React.createElement(Text, null, tempC), /*#__PURE__*/React.createElement(Text, {
28
+ className: "ipc-player-plugin-tempHumidity-divider"
31
29
  }, "/"));
32
30
  };
33
31
  const humRender = () => {
34
32
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Text, {
35
- className: "text-icon-tempHumidity icon-panel icon-panel-shidu"
33
+ className: "ipc-player-plugin-tempHumidity-text-icon icon-panel icon-panel-shidu"
36
34
  }), /*#__PURE__*/React.createElement(Text, {
37
35
  className: "tempHumidity"
38
36
  }, `${humidity}`));
@@ -1,21 +1,24 @@
1
1
  .ipc-player-plugin-tempHumidity {
2
2
  display: flex;
3
3
  align-items: center;
4
- padding: 5px 8px;
5
- border-radius: 12.5px;
4
+ height: calc(24px * var(--ipc-player-size-scale, 1));
5
+ padding: 0 calc(8px * var(--ipc-player-size-scale, 1));
6
+ border-radius: calc(24px * var(--ipc-player-size-scale, 1));
6
7
  opacity: 1;
7
8
  background: rgba(255, 255, 255, 0.1);
8
9
  backdrop-filter: blur(10px);
9
10
  color: var(--iconColor);
11
+ font-size: calc(12px * var(--ipc-player-size-scale, 1));
10
12
  }
11
13
 
12
- .divider {
13
- margin: 0 4px;
14
+ .ipc-player-plugin-tempHumidity-divider {
15
+ margin: calc(4px * var(--ipc-player-size-scale, 1));
14
16
  color: var(--iconColor);
15
17
  }
16
18
 
17
- .text-icon-tempHumidity {
19
+ // .text-icon-tempHumidity {
20
+ .ipc-player-plugin-tempHumidity-text-icon {
18
21
  color: var(--iconColor);
19
- font-size: var(--iconFontSize);
20
- margin-right: 4rpx;
22
+ font-size: calc(12px * var(--ipc-player-size-scale, 1));
23
+ margin-right: calc(2px * var(--ipc-player-size-scale, 1));
21
24
  }
@@ -1,13 +1,103 @@
1
- import React from 'react';
1
+ import React, { useEffect } from 'react';
2
2
  import { View } from '@ray-js/ray';
3
3
  import { useVideoBitKbps } from '../../hooks';
4
4
  import './videoBitKbps.less';
5
+ import { getCurrentSupportedTalkMode, getMobileOrientation, getVideoBitrateKbps, requestWifiSignal, isSupportedTalk, isSupportFloatWindow, openFloatWindow, setScreenOrientation, wakeUpDevice } from '../../utils/ipcApi';
5
6
  export const VideoBitKbps = props => {
6
7
  const {
7
- devId
8
+ devId,
9
+ IPCPlayerContext
8
10
  } = props;
9
11
  const bitKbps = useVideoBitKbps(devId);
12
+ useEffect(() => {
13
+ // TODO: test
14
+ // test();
15
+ }, []);
16
+ useEffect(() => {
17
+ // TODO: test
18
+ testOther();
19
+ }, []);
20
+ const testOther = async () => {
21
+ console.log('res===ttt');
22
+ try {
23
+ await requestWifiSignal(devId);
24
+ } catch (error) {
25
+ console.log('res===catch', error);
26
+ }
27
+ await getVideoBitrateKbps(devId); // 过
28
+ await wakeUpDevice(devId); // 过
29
+ await getMobileOrientation(); // 过
30
+ await setScreenOrientation('portrait'); // xxx
31
+ await isSupportFloatWindow(devId);
32
+ await isSupportedTalk(devId);
33
+ await getCurrentSupportedTalkMode(devId);
34
+ await openFloatWindow(devId); // 无
35
+ };
36
+
37
+ // const test = () => {
38
+ // console.log('res===ppp test');
39
+ // // 缩放倍数
40
+ // IPCPlayerContext.setScaleMultiple({
41
+ // scaleMultiple: 1,
42
+ // success: res => {
43
+ // console.log('res===ppp setScaleMultiple success', res);
44
+ // },
45
+ // fail: error => {
46
+ // console.log('res===ppp setScaleMultiple fail', error);
47
+ // },
48
+ // });
49
+
50
+ // IPCPlayerContext.setTrackingStatus({
51
+ // // status: false, // 非必传
52
+ // success: res => {
53
+ // console.log('res===ppp setTrackingStatus success', res);
54
+ // },
55
+ // fail: error => {
56
+ // console.log('res===ppp setTrackingStatus fail', error);
57
+ // },
58
+ // });
59
+
60
+ // IPCPlayerContext.setScalable({
61
+ // scaleble: 1,
62
+ // success: res => {
63
+ // console.log('res===ppp setScalable success', res);
64
+ // },
65
+ // fail: error => {
66
+ // console.log('res===ppp setScalable fail', error);
67
+ // },
68
+ // });
69
+
70
+ // IPCPlayerContext.isPTZControllable({
71
+ // success: res => {
72
+ // console.log('res===ppp isPTZControllable success', res);
73
+ // },
74
+ // fail: error => {
75
+ // console.log('res===ppp isPTZControllable fail', error);
76
+ // },
77
+ // });
78
+
79
+ // IPCPlayerContext.setRotateZ({
80
+ // rotateZ: 0,
81
+ // success: res => {
82
+ // console.log('res===ppp setRotateZ success', res);
83
+ // },
84
+ // fail: error => {
85
+ // console.log('res===ppp setRotateZ fail', error);
86
+ // },
87
+ // });
88
+
89
+ // // IPCPlayerContext.setMaxScaleMultiple({
90
+ // // maxScaleMultiple: 90, // 0-360
91
+ // // success: (res) => {
92
+ // // console.log('res===ppp maxScaleMultiple success', res);
93
+ // // },
94
+ // // fail: (error) => {
95
+ // // console.log('res===ppp maxScaleMultiple fail', error);
96
+ // // }
97
+ // // })
98
+ // };
99
+
10
100
  return /*#__PURE__*/React.createElement(View, {
11
- className: "videoBitKbps"
101
+ className: "ipc-player-plugin-videoBitKbps"
12
102
  }, bitKbps);
13
103
  };
@@ -1,11 +1,12 @@
1
- .videoBitKbps {
1
+ .ipc-player-plugin-videoBitKbps {
2
2
  display: flex;
3
3
  align-items: center;
4
- padding: 5px 8px;
5
- border-radius: 12.5px;
4
+ height: calc(24px * var(--ipc-player-size-scale, 1));
5
+ padding: 0 calc(8px * var(--ipc-player-size-scale, 1));
6
+ border-radius: calc(24px * var(--ipc-player-size-scale, 1));
6
7
  opacity: 1;
7
8
  background: rgba(255, 255, 255, 0.1);
8
9
  backdrop-filter: blur(10px);
9
- margin-right: 8px;
10
10
  color: var(--iconColor);
11
+ font-size: calc(12px * var(--ipc-player-size-scale, 1));
11
12
  }
@@ -1,9 +1,12 @@
1
1
  import React from 'react';
2
+ import { TouchEventHandler } from '@ray-js/components/lib/types';
2
3
  import './voiceIntercom.less';
3
4
  import { ComponentConfigProps } from '../../interface';
4
5
  type Props = ComponentConfigProps & {
5
6
  style?: React.CSSProperties;
6
7
  className?: string;
8
+ onTouchStart?: TouchEventHandler['onTouchStart'];
9
+ onTouchEnd?: TouchEventHandler['onTouchEnd'];
7
10
  };
8
- export declare function VoiceIntercom({ style, className, recording: recordingAtom, intercom: intercomAtom, setIntercom, mute: muteAtom, setMute, getStreamStatus, }: Props): React.JSX.Element;
11
+ export declare function VoiceIntercom({ style, className, recording: recordingAtom, intercom: intercomAtom, setIntercom, mute: muteAtom, setMute, getStreamStatus, onTouchStart, onTouchEnd, }: Props): React.JSX.Element;
9
12
  export {};