@ray-js/ray-ipc-player 2.0.17-beta-beta-1 → 2.0.18-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.
- package/lib/index.js +10 -3
- package/lib/typings/index.d.ts +37 -17
- package/package.json +4 -4
package/lib/index.js
CHANGED
|
@@ -26,6 +26,10 @@ var Player = function (props) {
|
|
|
26
26
|
devId = _props$devId === void 0 ? '' : _props$devId,
|
|
27
27
|
onChangeStreamStatus = props.onChangeStreamStatus,
|
|
28
28
|
onPlayerTap = props.onPlayerTap,
|
|
29
|
+
onZoomChange = props.onZoomChange,
|
|
30
|
+
onSessionDidDisconnected = props.onSessionDidDisconnected,
|
|
31
|
+
onCameraPreviewFailure = props.onCameraPreviewFailure,
|
|
32
|
+
onCameraNotifyWeakNetwork = props.onCameraNotifyWeakNetwork,
|
|
29
33
|
onInitPreview = props.onInitPreview,
|
|
30
34
|
_props$defaultMute = props.defaultMute,
|
|
31
35
|
defaultMute = _props$defaultMute === void 0 ? true : _props$defaultMute,
|
|
@@ -466,8 +470,11 @@ var Player = function (props) {
|
|
|
466
470
|
}, /*#__PURE__*/React.createElement(IpcPlayer // @ts-ignore
|
|
467
471
|
, _extends({
|
|
468
472
|
className: "".concat(Styles.player, " ").concat(playState.updateLy),
|
|
469
|
-
|
|
470
|
-
|
|
473
|
+
onVideoTap: handlePlayerClick,
|
|
474
|
+
onZoomChange: onZoomChange,
|
|
475
|
+
onCameraPreviewFailure: onCameraPreviewFailure,
|
|
476
|
+
onCameraNotifyWeakNetwork: onCameraNotifyWeakNetwork,
|
|
477
|
+
onInitDone: function initDone() {
|
|
471
478
|
// console.log('视图层准备就绪:', devId);
|
|
472
479
|
setPlayState(function (d) {
|
|
473
480
|
d.updateLy = Math.random();
|
|
@@ -475,7 +482,7 @@ var Player = function (props) {
|
|
|
475
482
|
});
|
|
476
483
|
},
|
|
477
484
|
onError: onError,
|
|
478
|
-
|
|
485
|
+
onConnectChange: function connectChange(e) {
|
|
479
486
|
var _e$detail2;
|
|
480
487
|
|
|
481
488
|
// console.log('连接状态发生变化', e);
|
package/lib/typings/index.d.ts
CHANGED
|
@@ -13,10 +13,10 @@ export type IProps = {
|
|
|
13
13
|
*/
|
|
14
14
|
devId: string;
|
|
15
15
|
/**
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
* @description.en onlineStatus
|
|
17
|
+
* @description.zh 设备是否在线
|
|
18
|
+
* @default true
|
|
19
|
+
*/
|
|
20
20
|
onlineStatus: boolean;
|
|
21
21
|
/**
|
|
22
22
|
* @description.en privateState
|
|
@@ -31,10 +31,10 @@ export type IProps = {
|
|
|
31
31
|
*/
|
|
32
32
|
defaultMute?: boolean;
|
|
33
33
|
/**
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
34
|
+
* @description.en clarity
|
|
35
|
+
* @description.zh 清晰度 normal:标清,hd:高清
|
|
36
|
+
* @default "normal"
|
|
37
|
+
*/
|
|
38
38
|
clarity?: 'normal' | 'hd';
|
|
39
39
|
/**
|
|
40
40
|
* @description.en updateLayout
|
|
@@ -55,10 +55,10 @@ export type IProps = {
|
|
|
55
55
|
*/
|
|
56
56
|
onChangeStreamStatus?: (data) => void;
|
|
57
57
|
/**
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
58
|
+
* @description.en onCtx
|
|
59
|
+
* @description.zh 获取ipcPlayer实例ctx以及重试方法retry
|
|
60
|
+
* @default (playerRef) => void
|
|
61
|
+
*/
|
|
62
62
|
onCtx?: (playerRef) => void;
|
|
63
63
|
/**
|
|
64
64
|
* @description.en onInitPreview
|
|
@@ -72,6 +72,26 @@ export type IProps = {
|
|
|
72
72
|
* @default (devId) => void
|
|
73
73
|
*/
|
|
74
74
|
onPlayerTap?: (data) => void;
|
|
75
|
+
/**
|
|
76
|
+
* @description.en onZoomchange
|
|
77
|
+
* @description.zh 视频缩放比例及当前倍数变化,detail = { zoomLevel }, zoomLevel 为缩放比例
|
|
78
|
+
*/
|
|
79
|
+
onZoomChange?: (data) => void;
|
|
80
|
+
/**
|
|
81
|
+
* @description.en onSessionDidDisconnected
|
|
82
|
+
* @description.zh 事件:session断开事件
|
|
83
|
+
*/
|
|
84
|
+
onSessionDidDisconnected?: (data) => void;
|
|
85
|
+
/**
|
|
86
|
+
* @description.en onCameraPreviewFailure
|
|
87
|
+
* @description.zh 事件:预览失败,错误码监听事件
|
|
88
|
+
*/
|
|
89
|
+
onCameraPreviewFailure?: (data) => void;
|
|
90
|
+
/**
|
|
91
|
+
* @description.en onCameraNotifyWeakNetwork
|
|
92
|
+
* @description.zh 事件:画面网速监听状态值事件
|
|
93
|
+
*/
|
|
94
|
+
onCameraNotifyWeakNetwork?: (data) => void;
|
|
75
95
|
/**
|
|
76
96
|
* @description.en scalable
|
|
77
97
|
* @description.zh 是否可缩放
|
|
@@ -79,10 +99,10 @@ export type IProps = {
|
|
|
79
99
|
*/
|
|
80
100
|
scalable?: boolean;
|
|
81
101
|
/**
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
102
|
+
* @description.en scaleMultiple
|
|
103
|
+
* @description.zh 缩放比例
|
|
104
|
+
* @default 0
|
|
105
|
+
*/
|
|
86
106
|
scaleMultiple?: number;
|
|
87
107
|
/**
|
|
88
108
|
* @description.en rotateZ
|
|
@@ -119,7 +139,7 @@ export type IProps = {
|
|
|
119
139
|
* @description.zh 填充模式设置:contain: 图像长边填满屏幕,短边区域会被填充⿊⾊, fillCrop: 图像铺满屏幕
|
|
120
140
|
* @default "contain"
|
|
121
141
|
*/
|
|
122
|
-
|
|
142
|
+
objectFit?: string;
|
|
123
143
|
/**
|
|
124
144
|
* @description.en extend
|
|
125
145
|
* @description.zh 扩展属性
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ray-js/ray-ipc-player",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.18-beta-1",
|
|
4
4
|
"description": "ray小程序播放器",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"tuya-miniapp",
|
|
@@ -26,16 +26,16 @@
|
|
|
26
26
|
"license": "MIT",
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"@ray-js/panel-sdk": "latest",
|
|
29
|
+
"classnames": "^2.3.1",
|
|
29
30
|
"immer": "^9.0.15",
|
|
30
|
-
"use-immer": "^0.5.1"
|
|
31
|
-
"classnames": "^2.3.1"
|
|
31
|
+
"use-immer": "^0.5.1"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
|
-
"@ray-js/ray": "latest",
|
|
35
34
|
"@commitlint/cli": "^7.2.1",
|
|
36
35
|
"@commitlint/config-conventional": "^9.0.1",
|
|
37
36
|
"@ray-js/babel-preset-standard": "latest",
|
|
38
37
|
"@ray-js/cli": "latest",
|
|
38
|
+
"@ray-js/ray": "1.5.44-beta.0",
|
|
39
39
|
"@ray-js/rn-transformer-helper": "latest",
|
|
40
40
|
"@ray-js/types": "latest",
|
|
41
41
|
"@types/node": "^17.0.43",
|