@ray-js/ipc-player-integration 0.0.16-beta-2 → 0.0.17

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.
@@ -18,7 +18,8 @@ const BottomLeftContent = _ref => {
18
18
  return /*#__PURE__*/React.createElement(CoverView, {
19
19
  className: clsx('ipc-player-bottom-left-content-wrap'),
20
20
  style: {
21
- paddingRight: screenType === 'vertical' ? '0' : '50px'
21
+ paddingRight: screenType === 'vertical' ? '0' : '50px',
22
+ height: screenType === 'vertical' ? shouldHide ? '41px' : '40px' : shouldHide ? '57px' : '58px'
22
23
  }
23
24
  }, /*#__PURE__*/React.createElement(View, {
24
25
  style: {
@@ -18,7 +18,8 @@ const BottomRightContent = _ref => {
18
18
  return /*#__PURE__*/React.createElement(CoverView, {
19
19
  className: clsx('ipc-player-bottom-right-content-wrap'),
20
20
  style: {
21
- paddingLeft: screenType === 'vertical' ? '10px' : '0'
21
+ paddingLeft: screenType === 'vertical' ? '10px' : '0',
22
+ height: screenType === 'vertical' ? shouldHide ? '41px' : '40px' : shouldHide ? '57px' : '58px'
22
23
  }
23
24
  }, /*#__PURE__*/React.createElement(View, {
24
25
  style: {
@@ -2,6 +2,7 @@ import React from 'react';
2
2
  import { CoverView, View } from '@ray-js/ray';
3
3
  import clsx from 'clsx';
4
4
  import { useStore } from '../ctx/store';
5
+ import { useComponentHideState } from './hooks';
5
6
  const TopLeftContent = _ref => {
6
7
  let {
7
8
  ctx,
@@ -13,10 +14,12 @@ const TopLeftContent = _ref => {
13
14
  screenType: ctx.screenType,
14
15
  playState: ctx.playState
15
16
  });
17
+ const [shouldHide] = useComponentHideState();
16
18
  return /*#__PURE__*/React.createElement(CoverView, {
17
19
  className: clsx('ipc-player-top-left-content-wrap'),
18
20
  style: {
19
- paddingRight: screenType === 'vertical' ? '0' : '20px'
21
+ paddingRight: screenType === 'vertical' ? '0' : '20px',
22
+ height: screenType === 'vertical' ? shouldHide ? '37px' : '36px' : shouldHide ? '41px' : '40px'
20
23
  }
21
24
  }, /*#__PURE__*/React.createElement(View, {
22
25
  style: {
@@ -16,7 +16,10 @@ const TopRightContent = _ref => {
16
16
  });
17
17
  const [shouldHide] = useComponentHideState();
18
18
  return /*#__PURE__*/React.createElement(CoverView, {
19
- className: clsx('ipc-player-top-right-content-wrap')
19
+ className: clsx('ipc-player-top-right-content-wrap'),
20
+ style: {
21
+ height: screenType === 'vertical' ? shouldHide ? '37px' : '36px' : shouldHide ? '41px' : '40px'
22
+ }
20
23
  }, /*#__PURE__*/React.createElement(View, {
21
24
  style: {
22
25
  paddingTop: screenType === 'vertical' ? '12px' : '16px',
@@ -108,6 +108,8 @@ export const PtzControl = props => {
108
108
  const res = await storage.get('ptzControlTip');
109
109
  showPtzControlTip.current = false;
110
110
  if (!res) {
111
+ // 结束操作提示
112
+ onTouchPtzEnd();
111
113
  addContent('absolute', {
112
114
  id: ptzControlTipId,
113
115
  content: props => {
@@ -119,6 +121,19 @@ export const PtzControl = props => {
119
121
  }
120
122
  }
121
123
  });
124
+ const onTouchPtzEnd = async () => {
125
+ const ptzStopData = await getDpIdByCode(devId, 'ptz_stop');
126
+ if (ptzStopData.code === 0) {
127
+ const ptzStopId = ptzStopData.data;
128
+ publishDps(devId, {
129
+ [ptzStopId]: true
130
+ });
131
+ }
132
+ if (ptzTimeId.current) {
133
+ clearInterval(ptzTimeId.current);
134
+ ptzTimeId.current = null;
135
+ }
136
+ };
122
137
  return /*#__PURE__*/React.createElement(CoverView, {
123
138
  className: clsx('ipc-player-plugin-full-screen-ptz-control', {
124
139
  'ipc-player-plugin-full-screen-ptz-control-hide': !isPtzActive || shouldHide,
@@ -129,19 +144,7 @@ export const PtzControl = props => {
129
144
  zoomData: [],
130
145
  ptzData: ptzData.current,
131
146
  onTouchPtzStart: onTouchPtzStart,
132
- onTouchPtzEnd: async () => {
133
- const ptzStopData = await getDpIdByCode(devId, 'ptz_stop');
134
- if (ptzStopData.code === 0) {
135
- const ptzStopId = ptzStopData.data;
136
- publishDps(devId, {
137
- [ptzStopId]: true
138
- });
139
- }
140
- if (ptzTimeId.current) {
141
- clearInterval(ptzTimeId.current);
142
- ptzTimeId.current = null;
143
- }
144
- },
147
+ onTouchPtzEnd: onTouchPtzEnd,
145
148
  brandColor: brandColor,
146
149
  iconClassName: Styles['arrow-icon-wrapper'],
147
150
  darkMode: true
@@ -1,20 +1,19 @@
1
1
  import "core-js/modules/esnext.iterator.constructor.js";
2
2
  import "core-js/modules/esnext.iterator.map.js";
3
- import React, { useCallback, useState, useContext, useEffect } from 'react';
3
+ import React, { useState, useContext, useEffect } from 'react';
4
4
  import { Text, View, showToast } from '@ray-js/ray';
5
5
  import clsx from 'clsx';
6
6
  import Strings from '../../i18n';
7
7
  import { useMemoizedFn } from '../../hooks';
8
8
  import { useStore } from '../../ctx/store';
9
9
  import { UIEventContext } from '../../ui/context';
10
- import { playerTap } from '../../ui/constant';
10
+ import { playerTap, showAllComponent, pauseTimeToHideAllComponent } from '../../ui/constant';
11
11
  import './resolution.less';
12
12
  export const FullResolutionControl = props => {
13
13
  const {
14
14
  setResolution
15
15
  } = props;
16
16
  const {
17
- screenType,
18
17
  resolution,
19
18
  resolutionList,
20
19
  brandColor
@@ -42,7 +41,7 @@ export const FullResolutionControl = props => {
42
41
  event.off(playerTap, onPlayerTap);
43
42
  };
44
43
  }, []);
45
- const changeResolution = useCallback(value => {
44
+ const changeResolution = useMemoizedFn(value => {
46
45
  if (value === resolution) {
47
46
  showToast({
48
47
  icon: 'none',
@@ -54,6 +53,8 @@ export const FullResolutionControl = props => {
54
53
  icon: 'none',
55
54
  title: Strings.getLang('ipc_player_change_resolution_success')
56
55
  });
56
+ event.emit(pauseTimeToHideAllComponent);
57
+ event.emit(showAllComponent);
57
58
  setHide(true);
58
59
  }).catch(() => {
59
60
  showToast({
@@ -62,7 +63,7 @@ export const FullResolutionControl = props => {
62
63
  });
63
64
  });
64
65
  }
65
- }, [resolution]);
66
+ });
66
67
  return /*#__PURE__*/React.createElement(View, {
67
68
  className: clsx('ipc-player-plugin-full-resolution-control', 'ipc-plugin-absolute-move-in-right', {
68
69
  'ipc-plugin-absolute-move-in-right-hide': hide
@@ -1,7 +1,7 @@
1
1
  @animation-time: 0.3s;
2
2
 
3
3
  .ipc-player-plugin-resolution {
4
- background-color: rgba(255,255,255,0.2);
4
+ background-color: rgba(255, 255, 255, 0.2);
5
5
  padding: calc(4px * var(--ipc-player-size-scale, 1)) calc(5px * var(--ipc-player-size-scale, 1));
6
6
  display: flex;
7
7
  justify-content: center;
@@ -24,12 +24,12 @@
24
24
 
25
25
  .ipc-player-plugin-full-resolution-control {
26
26
  height: 100%;
27
- width: 200px;
27
+ width: 200px;
28
28
  display: flex;
29
29
  flex-direction: column;
30
30
  justify-content: center;
31
31
  align-items: center;
32
- background-color: rgba(0,0,0,0.9);
32
+ background-color: rgba(0, 0, 0, 0.9);
33
33
  }
34
34
 
35
35
  .ipc-player-plugin-full-resolution-control-wrap {
@@ -60,4 +60,9 @@
60
60
  color: #ffffff;
61
61
  min-height: 40px;
62
62
  width: 100%;
63
+ margin-bottom: 5px;
64
+ }
65
+
66
+ .ipc-player-plugin-full-resolution-control-text:last-child {
67
+ margin-bottom: 0;
63
68
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ray-js/ipc-player-integration",
3
- "version": "0.0.16-beta-2",
3
+ "version": "0.0.17",
4
4
  "description": "IPC 融合播放器",
5
5
  "main": "lib/index",
6
6
  "files": [
@@ -38,7 +38,7 @@
38
38
  "@ray-js/ipc-ptz-zoom": "^0.0.2",
39
39
  "@ray-js/panel-sdk": "^1.13.1",
40
40
  "@ray-js/direction-control": "^0.0.8",
41
- "@ray-js/ray-ipc-player": "^2.0.24",
41
+ "@ray-js/ray-ipc-player": "^2.0.25",
42
42
  "@ray-js/ray-ipc-utils": "^1.1.10",
43
43
  "@ray-js/svg": "0.2.0",
44
44
  "clsx": "^1.2.1",