@dcloudio/uni-app-x 0.5.10 → 0.5.11
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/package.json +2 -1
- package/types/native/Element.d.ts +2 -2
- package/types/uni/core/lib/base/interceptor/interface.d.ts +120 -0
- package/types/uni/index.d.ts +1 -0
- package/types/uni/uts-plugin-component/lib/uni-video/utssdk/index.d.ts +12 -0
- package/types/uni/uts-plugin-component/lib/uni-video/utssdk/interface.d.ts +298 -158
- package/types/uni/uts-plugin-modules/index.d.ts +1 -0
- package/types/uni/uts-plugin-modules/lib/uni-facialRecognitionVerify/utssdk/index.d.ts +15 -0
- package/types/uni/uts-plugin-modules/lib/uni-facialRecognitionVerify/utssdk/interface.d.ts +66 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dcloudio/uni-app-x",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.11",
|
|
4
4
|
"description": "uni-app x types",
|
|
5
5
|
"typings": "index.d.ts",
|
|
6
6
|
"author": "DCloud",
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
"build:types:core": "node ./scripts/build-types.js -t core",
|
|
11
11
|
"build:types:plugin:api": "node ./scripts/build-types.js -t uts-plugin-api",
|
|
12
12
|
"build:types:plugin:component": "node ./scripts/build-types.js -t uts-plugin-component",
|
|
13
|
+
"build:types:plugin:modules": "node ./scripts/build-types.js -t uts-plugin-modules",
|
|
13
14
|
"build:types:plugin": "npm run build:types:plugin:api && npm run build:types:plugin:component",
|
|
14
15
|
"build:types:meta": "node ./scripts/build-meta.js",
|
|
15
16
|
"build:types": "npm run build:types:core && npm run build:types:plugin"
|
|
@@ -68,7 +68,7 @@ declare interface Element {
|
|
|
68
68
|
* 只读属性 获取当前元素的元素名称
|
|
69
69
|
* @autodoc false
|
|
70
70
|
*/
|
|
71
|
-
nodeName: string
|
|
71
|
+
nodeName: string | null
|
|
72
72
|
|
|
73
73
|
/**
|
|
74
74
|
* 只读属性 获取元素上自定义数据属性(data-*)的集合
|
|
@@ -157,7 +157,7 @@ declare interface Element {
|
|
|
157
157
|
* }
|
|
158
158
|
* }
|
|
159
159
|
*/
|
|
160
|
-
takeSnapshot(options: TakeSnapshotOptions):void
|
|
160
|
+
takeSnapshot(options: TakeSnapshotOptions): void
|
|
161
161
|
|
|
162
162
|
/**
|
|
163
163
|
* 将一个元素添加到指定父元素的子元素列表的末尾处。如果将被插入的元素已经存在于当前文档的文档树中,那么将会它从原先的位置移动到新的位置。
|
|
@@ -16,12 +16,132 @@ export interface Uni {
|
|
|
16
16
|
* 添加拦截器
|
|
17
17
|
* @param name 需要拦截的 API 名称
|
|
18
18
|
* @param interceptor 拦截器
|
|
19
|
+
* @uniPlatform {
|
|
20
|
+
* "app": {
|
|
21
|
+
* "android": {
|
|
22
|
+
* "osVer": "5.0",
|
|
23
|
+
* "uniVer": "√",
|
|
24
|
+
* "unixVer": "3.97"
|
|
25
|
+
* },
|
|
26
|
+
* "ios": {
|
|
27
|
+
* "osVer": "10.0",
|
|
28
|
+
* "uniVer": "√",
|
|
29
|
+
* "unixVer": "x"
|
|
30
|
+
* }
|
|
31
|
+
* },
|
|
32
|
+
* "mp": {
|
|
33
|
+
* "weixin": {
|
|
34
|
+
* "hostVer": "√",
|
|
35
|
+
* "uniVer": "√",
|
|
36
|
+
* "unixVer": "x"
|
|
37
|
+
* },
|
|
38
|
+
* "alipay": {
|
|
39
|
+
* "hostVer": "√",
|
|
40
|
+
* "uniVer": "√",
|
|
41
|
+
* "unixVer": "x"
|
|
42
|
+
* },
|
|
43
|
+
* "baidu": {
|
|
44
|
+
* "hostVer": "√",
|
|
45
|
+
* "uniVer": "√",
|
|
46
|
+
* "unixVer": "x"
|
|
47
|
+
* },
|
|
48
|
+
* "toutiao": {
|
|
49
|
+
* "hostVer": "√",
|
|
50
|
+
* "uniVer": "√",
|
|
51
|
+
* "unixVer": "x"
|
|
52
|
+
* },
|
|
53
|
+
* "lark": {
|
|
54
|
+
* "hostVer": "√",
|
|
55
|
+
* "uniVer": "√",
|
|
56
|
+
* "unixVer": "x"
|
|
57
|
+
* },
|
|
58
|
+
* "qq": {
|
|
59
|
+
* "hostVer": "√",
|
|
60
|
+
* "uniVer": "√",
|
|
61
|
+
* "unixVer": "x"
|
|
62
|
+
* },
|
|
63
|
+
* "kuaishou": {
|
|
64
|
+
* "hostVer": "√",
|
|
65
|
+
* "uniVer": "√",
|
|
66
|
+
* "unixVer": "x"
|
|
67
|
+
* },
|
|
68
|
+
* "jd": {
|
|
69
|
+
* "hostVer": "√",
|
|
70
|
+
* "uniVer": "√",
|
|
71
|
+
* "unixVer": "x"
|
|
72
|
+
* }
|
|
73
|
+
* },
|
|
74
|
+
* "web": {
|
|
75
|
+
* "uniVer": "√",
|
|
76
|
+
* "unixVer": "x"
|
|
77
|
+
* }
|
|
78
|
+
* }
|
|
19
79
|
*/
|
|
20
80
|
addInterceptor(name: string, interceptor: AddInterceptorOptions): void
|
|
21
81
|
/**
|
|
22
82
|
* 删除拦截器
|
|
23
83
|
* @param name 需要删除拦截器的 API 名称
|
|
24
84
|
* @param interceptor 拦截器
|
|
85
|
+
* @uniPlatform {
|
|
86
|
+
* "app": {
|
|
87
|
+
* "android": {
|
|
88
|
+
* "osVer": "5.0",
|
|
89
|
+
* "uniVer": "√",
|
|
90
|
+
* "unixVer": "3.97"
|
|
91
|
+
* },
|
|
92
|
+
* "ios": {
|
|
93
|
+
* "osVer": "10.0",
|
|
94
|
+
* "uniVer": "√",
|
|
95
|
+
* "unixVer": "x"
|
|
96
|
+
* }
|
|
97
|
+
* },
|
|
98
|
+
* "mp": {
|
|
99
|
+
* "weixin": {
|
|
100
|
+
* "hostVer": "√",
|
|
101
|
+
* "uniVer": "√",
|
|
102
|
+
* "unixVer": "x"
|
|
103
|
+
* },
|
|
104
|
+
* "alipay": {
|
|
105
|
+
* "hostVer": "√",
|
|
106
|
+
* "uniVer": "√",
|
|
107
|
+
* "unixVer": "x"
|
|
108
|
+
* },
|
|
109
|
+
* "baidu": {
|
|
110
|
+
* "hostVer": "√",
|
|
111
|
+
* "uniVer": "√",
|
|
112
|
+
* "unixVer": "x"
|
|
113
|
+
* },
|
|
114
|
+
* "toutiao": {
|
|
115
|
+
* "hostVer": "√",
|
|
116
|
+
* "uniVer": "√",
|
|
117
|
+
* "unixVer": "x"
|
|
118
|
+
* },
|
|
119
|
+
* "lark": {
|
|
120
|
+
* "hostVer": "√",
|
|
121
|
+
* "uniVer": "√",
|
|
122
|
+
* "unixVer": "x"
|
|
123
|
+
* },
|
|
124
|
+
* "qq": {
|
|
125
|
+
* "hostVer": "√",
|
|
126
|
+
* "uniVer": "√",
|
|
127
|
+
* "unixVer": "x"
|
|
128
|
+
* },
|
|
129
|
+
* "kuaishou": {
|
|
130
|
+
* "hostVer": "√",
|
|
131
|
+
* "uniVer": "√",
|
|
132
|
+
* "unixVer": "x"
|
|
133
|
+
* },
|
|
134
|
+
* "jd": {
|
|
135
|
+
* "hostVer": "√",
|
|
136
|
+
* "uniVer": "√",
|
|
137
|
+
* "unixVer": "x"
|
|
138
|
+
* }
|
|
139
|
+
* },
|
|
140
|
+
* "web": {
|
|
141
|
+
* "uniVer": "√",
|
|
142
|
+
* "unixVer": "x"
|
|
143
|
+
* }
|
|
144
|
+
* }
|
|
25
145
|
*/
|
|
26
146
|
removeInterceptor(
|
|
27
147
|
name: string,
|
package/types/uni/index.d.ts
CHANGED
|
@@ -3,6 +3,12 @@ import {
|
|
|
3
3
|
Danmu as DanmuOrigin,
|
|
4
4
|
RequestFullScreenOptions as RequestFullScreenOptionsOrigin,
|
|
5
5
|
VideoContext as VideoContextOrigin,
|
|
6
|
+
VideoTimeUpdateEventDetail as VideoTimeUpdateEventDetailOrigin,
|
|
7
|
+
VideoFullScreenChangeEventDetail as VideoFullScreenChangeEventDetailOrigin,
|
|
8
|
+
VideoProgressChangeEventDetail as VideoProgressChangeEventDetailOrigin,
|
|
9
|
+
VideoFullScreenClickEventDetail as VideoFullScreenClickEventDetailOrigin,
|
|
10
|
+
VideoControlsToggleEventDetail as VideoControlsToggleEventDetailOrigin,
|
|
11
|
+
VideoErrorCode as VideoErrorCodeOrigin,
|
|
6
12
|
Uni as UniOrigin
|
|
7
13
|
} from './interface'
|
|
8
14
|
|
|
@@ -11,5 +17,11 @@ declare global {
|
|
|
11
17
|
type Danmu = DanmuOrigin
|
|
12
18
|
type RequestFullScreenOptions = RequestFullScreenOptionsOrigin
|
|
13
19
|
type VideoContext = VideoContextOrigin
|
|
20
|
+
type VideoTimeUpdateEventDetail = VideoTimeUpdateEventDetailOrigin
|
|
21
|
+
type VideoFullScreenChangeEventDetail = VideoFullScreenChangeEventDetailOrigin
|
|
22
|
+
type VideoProgressChangeEventDetail = VideoProgressChangeEventDetailOrigin
|
|
23
|
+
type VideoFullScreenClickEventDetail = VideoFullScreenClickEventDetailOrigin
|
|
24
|
+
type VideoControlsToggleEventDetail = VideoControlsToggleEventDetailOrigin
|
|
25
|
+
type VideoErrorCode = VideoErrorCodeOrigin
|
|
14
26
|
interface Uni extends UniOrigin { }
|
|
15
27
|
}
|
|
@@ -1,171 +1,311 @@
|
|
|
1
|
-
import { ComponentPublicInstance } from 'vue'
|
|
1
|
+
import { ComponentPublicInstance } from 'vue';
|
|
2
2
|
|
|
3
|
-
export type CreateVideoContext = (videoId:
|
|
3
|
+
export type CreateVideoContext = (videoId : string, component ?: ComponentPublicInstance | null) => VideoContext | null;
|
|
4
4
|
|
|
5
5
|
export type Danmu = {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
6
|
+
/**
|
|
7
|
+
* 弹幕文字
|
|
8
|
+
*/
|
|
9
|
+
text : string | null,
|
|
10
|
+
/**
|
|
11
|
+
* 弹幕颜色
|
|
12
|
+
*/
|
|
13
|
+
color : string | null,
|
|
14
|
+
/**
|
|
15
|
+
* 显示时刻
|
|
16
|
+
*/
|
|
17
|
+
time : number | null
|
|
18
18
|
};
|
|
19
19
|
|
|
20
20
|
export type RequestFullScreenOptions = {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
21
|
+
/**
|
|
22
|
+
* direction
|
|
23
|
+
* - 0: 正常竖向
|
|
24
|
+
* - 90: 屏幕逆时针90度
|
|
25
|
+
* - -90: 屏幕顺时针90度
|
|
26
|
+
* @type 0 | 90 | -90
|
|
27
|
+
*/
|
|
28
|
+
direction : number | null
|
|
29
29
|
};
|
|
30
30
|
|
|
31
31
|
export interface VideoContext {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
32
|
+
/**
|
|
33
|
+
* @description 播放
|
|
34
|
+
* @uniPlatform {
|
|
35
|
+
* "app": {
|
|
36
|
+
* "android": {
|
|
37
|
+
* "osVer": "4.4",
|
|
38
|
+
* "uniVer": "√",
|
|
39
|
+
* "unixVer": "3.9.0"
|
|
40
|
+
* }
|
|
41
|
+
* }
|
|
42
|
+
* }
|
|
43
|
+
* @uniVueVersion 2,3
|
|
44
|
+
*/
|
|
45
|
+
play() : void;
|
|
46
|
+
/**
|
|
47
|
+
* @description 暂停
|
|
48
|
+
* @uniPlatform {
|
|
49
|
+
* "app": {
|
|
50
|
+
* "android": {
|
|
51
|
+
* "osVer": "4.4",
|
|
52
|
+
* "uniVer": "√",
|
|
53
|
+
* "unixVer": "3.9.0"
|
|
54
|
+
* }
|
|
55
|
+
* }
|
|
56
|
+
* }
|
|
57
|
+
* @uniVueVersion 2,3
|
|
58
|
+
*/
|
|
59
|
+
pause() : void;
|
|
60
|
+
/**
|
|
61
|
+
* @description 跳转到指定位置
|
|
62
|
+
* @param {number} position 跳转到指定位置(秒)
|
|
63
|
+
* @uniPlatform {
|
|
64
|
+
* "app": {
|
|
65
|
+
* "android": {
|
|
66
|
+
* "osVer": "4.4",
|
|
67
|
+
* "uniVer": "√",
|
|
68
|
+
* "unixVer": "3.9.0"
|
|
69
|
+
* }
|
|
70
|
+
* }
|
|
71
|
+
* }
|
|
72
|
+
* @uniVueVersion 2,3
|
|
73
|
+
*/
|
|
74
|
+
seek(position : number) : void;
|
|
75
|
+
/**
|
|
76
|
+
* @description 停止视频
|
|
77
|
+
* @uniPlatform {
|
|
78
|
+
* "app": {
|
|
79
|
+
* "android": {
|
|
80
|
+
* "osVer": "4.4",
|
|
81
|
+
* "uniVer": "√",
|
|
82
|
+
* "unixVer": "3.9.0"
|
|
83
|
+
* }
|
|
84
|
+
* }
|
|
85
|
+
* }
|
|
86
|
+
* @uniVueVersion 2,3
|
|
87
|
+
*/
|
|
88
|
+
stop() : void;
|
|
89
|
+
/**
|
|
90
|
+
* @description 发送弹幕
|
|
91
|
+
* @param {Danmu} 属性 text, color
|
|
92
|
+
* @uniPlatform {
|
|
93
|
+
* "app": {
|
|
94
|
+
* "android": {
|
|
95
|
+
* "osVer": "4.4",
|
|
96
|
+
* "uniVer": "√",
|
|
97
|
+
* "unixVer": "3.9.0"
|
|
98
|
+
* }
|
|
99
|
+
* }
|
|
100
|
+
* }
|
|
101
|
+
* @uniVueVersion 2,3
|
|
102
|
+
*/
|
|
103
|
+
sendDanmu(danmu : Danmu) : void;
|
|
104
|
+
/**
|
|
105
|
+
* @description 设置倍速播放
|
|
106
|
+
* @param {number} rate, 支持倍率 0.5/0.8/1.0/1.25/1.5
|
|
107
|
+
* @uniPlatform {
|
|
108
|
+
* "app": {
|
|
109
|
+
* "android": {
|
|
110
|
+
* "osVer": "4.4",
|
|
111
|
+
* "uniVer": "√",
|
|
112
|
+
* "unixVer": "3.9.0"
|
|
113
|
+
* }
|
|
114
|
+
* }
|
|
115
|
+
* }
|
|
116
|
+
* @uniVueVersion 2,3
|
|
117
|
+
*/
|
|
118
|
+
playbackRate(rate : number) : void;
|
|
119
|
+
/**
|
|
120
|
+
* @description 进入全屏
|
|
121
|
+
* @param {RequestFullScreenOptions} direction, 0|正常竖向, 90|屏幕逆时针90度, -90|屏幕顺时针90度
|
|
122
|
+
* @uniPlatform {
|
|
123
|
+
* "app": {
|
|
124
|
+
* "android": {
|
|
125
|
+
* "osVer": "4.4",
|
|
126
|
+
* "uniVer": "√",
|
|
127
|
+
* "unixVer": "3.9.0"
|
|
128
|
+
* }
|
|
129
|
+
* }
|
|
130
|
+
* }
|
|
131
|
+
* @uniVueVersion 2,3
|
|
132
|
+
*/
|
|
133
|
+
requestFullScreen(direction : RequestFullScreenOptions | null) : void;
|
|
134
|
+
/**
|
|
135
|
+
* 退出全屏
|
|
136
|
+
* @description 退出全屏
|
|
137
|
+
* @uniPlatform {
|
|
138
|
+
* "app": {
|
|
139
|
+
* "android": {
|
|
140
|
+
* "osVer": "4.4",
|
|
141
|
+
* "uniVer": "√",
|
|
142
|
+
* "unixVer": "3.9.0"
|
|
143
|
+
* }
|
|
144
|
+
* }
|
|
145
|
+
* }
|
|
146
|
+
* @uniVueVersion 2,3
|
|
147
|
+
*/
|
|
148
|
+
exitFullScreen() : void;
|
|
149
149
|
}
|
|
150
150
|
|
|
151
151
|
export interface Uni {
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
152
|
+
/**
|
|
153
|
+
* 创建并返回 video 上下文 videoContext 对象
|
|
154
|
+
* @description 创建并返回 video 上下文 videoContext 对象
|
|
155
|
+
* @uniPlatform {
|
|
156
|
+
* "app": {
|
|
157
|
+
* "android": {
|
|
158
|
+
* "osVer": "4.4",
|
|
159
|
+
* "uniVer": "√",
|
|
160
|
+
* "unixVer": "√"
|
|
161
|
+
* }
|
|
162
|
+
* }
|
|
163
|
+
* }
|
|
164
|
+
* @uniVueVersion 2,3
|
|
165
|
+
* @return {VideoContext} 视频对象
|
|
166
|
+
*
|
|
167
|
+
* @tutorial http://uniapp.dcloud.io/api/media/video-context?id=createVideoContext
|
|
168
|
+
*
|
|
169
|
+
*/
|
|
170
|
+
createVideoContext(videoId : string, component ?: ComponentPublicInstance | null) : VideoContext | null
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* timeupdate 事件
|
|
175
|
+
* 播放进度变化时触发
|
|
176
|
+
*/
|
|
177
|
+
export class VideoTimeUpdateEvent extends CustomEvent<VideoTimeUpdateEventDetail> {
|
|
178
|
+
constructor(detail : VideoTimeUpdateEventDetail) {
|
|
179
|
+
super("timeupdate", detail);
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* @param currentTime 当前进度
|
|
185
|
+
* @param duration 总进度
|
|
186
|
+
*/
|
|
187
|
+
export type VideoTimeUpdateEventDetail = {
|
|
188
|
+
currentTime : number,
|
|
189
|
+
duration : number
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
/**
|
|
193
|
+
* fullscreenchange 事件
|
|
194
|
+
* 当视频进入和退出全屏是触发
|
|
195
|
+
*/
|
|
196
|
+
export class VideoFullScreenChangeEvent extends CustomEvent<VideoFullScreenChangeEventDetail> {
|
|
197
|
+
constructor(detail : VideoFullScreenChangeEventDetail) {
|
|
198
|
+
super("fullscreenchange", detail);
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
/**
|
|
203
|
+
* @param fullScreen 是否全屏
|
|
204
|
+
* @param direction 横竖屏,取值 vertical 或 horizontal
|
|
205
|
+
*/
|
|
206
|
+
export type VideoFullScreenChangeEventDetail = {
|
|
207
|
+
fullScreen : boolean,
|
|
208
|
+
direction : string
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
/**
|
|
212
|
+
* error 事件
|
|
213
|
+
* 视频播放出错时触发
|
|
214
|
+
*/
|
|
215
|
+
export class VideoErrorEvent extends CustomEvent<VideoError> {
|
|
216
|
+
constructor(detail : VideoError) {
|
|
217
|
+
super("error", detail);
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
/**
|
|
222
|
+
* progress 事件
|
|
223
|
+
* 加载进度变化时触发
|
|
224
|
+
*/
|
|
225
|
+
export class VideoProgressChangeEvent extends CustomEvent<VideoProgressChangeEventDetail> {
|
|
226
|
+
constructor(detail : VideoProgressChangeEventDetail) {
|
|
227
|
+
super("progress", detail);
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
/**
|
|
232
|
+
* @param buffered 加载进度百分比
|
|
233
|
+
*/
|
|
234
|
+
export type VideoProgressChangeEventDetail = {
|
|
235
|
+
buffered : number
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
/**
|
|
239
|
+
* fullscreenclick 事件
|
|
240
|
+
* 视频播放全屏播放时点击事件
|
|
241
|
+
*/
|
|
242
|
+
export class VideoFullScreenClickEvent extends CustomEvent<VideoFullScreenClickEventDetail> {
|
|
243
|
+
constructor(detail : VideoFullScreenClickEventDetail) {
|
|
244
|
+
super("fullscreenclick", detail);
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
/**
|
|
249
|
+
* @param screenX 点击点相对于屏幕左侧边缘的 X 轴坐标
|
|
250
|
+
* @param screenY 点击点相对于屏幕顶部边缘的 Y 轴坐标
|
|
251
|
+
* @param screenWidth 屏幕总宽度
|
|
252
|
+
* @param screenHeight 屏幕总高度
|
|
253
|
+
*/
|
|
254
|
+
export type VideoFullScreenClickEventDetail = {
|
|
255
|
+
screenX : number,
|
|
256
|
+
screenY : number,
|
|
257
|
+
screenWidth : number,
|
|
258
|
+
screenHeight : number
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
/**
|
|
262
|
+
* controlstoggle 事件
|
|
263
|
+
* 切换播放控件显示隐藏时触发
|
|
264
|
+
*/
|
|
265
|
+
export class VideoControlsToggleEvent extends CustomEvent<VideoControlsToggleEventDetail> {
|
|
266
|
+
constructor(detail : VideoControlsToggleEventDetail) {
|
|
267
|
+
super("controlstoggle", detail);
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
/**
|
|
272
|
+
* @param show 是否显示
|
|
273
|
+
*/
|
|
274
|
+
export type VideoControlsToggleEventDetail = {
|
|
275
|
+
show : boolean
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
/**
|
|
279
|
+
* 错误主题
|
|
280
|
+
*/
|
|
281
|
+
export const UniErrorSubject = 'uni-video';
|
|
282
|
+
|
|
283
|
+
/**
|
|
284
|
+
* 错误码
|
|
285
|
+
* 100001 网络错误
|
|
286
|
+
* 200001 内部错误
|
|
287
|
+
* 300001 SDK错误
|
|
288
|
+
*/
|
|
289
|
+
export type VideoErrorCode = 100001 | 200001 | 300001
|
|
290
|
+
|
|
291
|
+
/**
|
|
292
|
+
* 错误信息
|
|
293
|
+
*/
|
|
294
|
+
export const UniErrors : Map<VideoErrorCode, string> = new Map([
|
|
295
|
+
[100001, 'video:network error'],
|
|
296
|
+
[200001, 'video:internal error'],
|
|
297
|
+
[300001, 'video:sdk error']
|
|
298
|
+
]);
|
|
299
|
+
|
|
300
|
+
/**
|
|
301
|
+
* 错误实现
|
|
302
|
+
*/
|
|
303
|
+
export class VideoError extends UniError {
|
|
304
|
+
constructor(errCode : VideoErrorCode, cause : SourceError | null = null) {
|
|
305
|
+
super();
|
|
306
|
+
this.errSubject = UniErrorSubject;
|
|
307
|
+
this.errCode = errCode;
|
|
308
|
+
this.errMsg = UniErrors[errCode] ?? "";
|
|
309
|
+
this.cause = cause;
|
|
310
|
+
}
|
|
171
311
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/// <reference path='./lib/uni-facialRecognitionVerify/utssdk/index.d.ts' />
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import {
|
|
2
|
+
StartFacialRecognitionVerifySuccess as StartFacialRecognitionVerifySuccessOrigin,
|
|
3
|
+
StartFacialRecognitionVerifyOptions as StartFacialRecognitionVerifyOptionsOrigin,
|
|
4
|
+
GetFacialRecognitionMetaInfo as GetFacialRecognitionMetaInfoOrigin,
|
|
5
|
+
StartFacialRecognitionVerify as StartFacialRecognitionVerifyOrigin,
|
|
6
|
+
Uni as UniOrigin
|
|
7
|
+
} from './interface'
|
|
8
|
+
|
|
9
|
+
declare global {
|
|
10
|
+
type StartFacialRecognitionVerifySuccess = StartFacialRecognitionVerifySuccessOrigin
|
|
11
|
+
type StartFacialRecognitionVerifyOptions = StartFacialRecognitionVerifyOptionsOrigin
|
|
12
|
+
type GetFacialRecognitionMetaInfo = GetFacialRecognitionMetaInfoOrigin
|
|
13
|
+
type StartFacialRecognitionVerify = StartFacialRecognitionVerifyOrigin
|
|
14
|
+
interface Uni extends UniOrigin { }
|
|
15
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
export type StartFacialRecognitionVerifySuccess = {
|
|
2
|
+
/**
|
|
3
|
+
* 错误码
|
|
4
|
+
*/
|
|
5
|
+
errCode: number,
|
|
6
|
+
/**
|
|
7
|
+
* 调用API的名称
|
|
8
|
+
*/
|
|
9
|
+
errSubject: string,
|
|
10
|
+
/**
|
|
11
|
+
* 错误的详细信息
|
|
12
|
+
*/
|
|
13
|
+
errMsg: string,
|
|
14
|
+
/**
|
|
15
|
+
* 错误来源
|
|
16
|
+
*/
|
|
17
|
+
cause?: any
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export type StartFacialRecognitionVerifyOptions = {
|
|
21
|
+
/**
|
|
22
|
+
* certifyId 调用实人认证的id
|
|
23
|
+
*/
|
|
24
|
+
certifyId: string,
|
|
25
|
+
/**
|
|
26
|
+
* 活体检测页面的进度条颜色。
|
|
27
|
+
*/
|
|
28
|
+
progressBarColor?: string,
|
|
29
|
+
/**
|
|
30
|
+
* 认证界面UI朝向。仅Android支持
|
|
31
|
+
*/
|
|
32
|
+
screenOrientation?: string,
|
|
33
|
+
/**
|
|
34
|
+
* 成功回调
|
|
35
|
+
*/
|
|
36
|
+
success?: (res: StartFacialRecognitionVerifySuccess) => void,
|
|
37
|
+
/**
|
|
38
|
+
* 失败回调
|
|
39
|
+
*/
|
|
40
|
+
fail?: (res: UniError) => void,
|
|
41
|
+
/**
|
|
42
|
+
* 完成回调
|
|
43
|
+
*/
|
|
44
|
+
complete?: (res: any) => void
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* 获取阿里云实人认证meta info
|
|
49
|
+
*/
|
|
50
|
+
export type GetFacialRecognitionMetaInfo = () => string
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* 启动人脸识别
|
|
54
|
+
*/
|
|
55
|
+
export type StartFacialRecognitionVerify = (faceStyle: StartFacialRecognitionVerifyOptions) => void
|
|
56
|
+
|
|
57
|
+
export interface Uni {
|
|
58
|
+
/**
|
|
59
|
+
* 获取阿里云实人认证meta info
|
|
60
|
+
*/
|
|
61
|
+
getFacialRecognitionMetaInfo() : string,
|
|
62
|
+
/**
|
|
63
|
+
* 启动人脸识别
|
|
64
|
+
*/
|
|
65
|
+
startFacialRecognitionVerify(faceStyle: StartFacialRecognitionVerifyOptions) : void
|
|
66
|
+
}
|