@douyinfe/semi-foundation 2.89.0-beta.0 → 2.89.0
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.
|
@@ -40,6 +40,8 @@ export default class VideoPlayerFoundation<P = Record<string, any>, S = Record<s
|
|
|
40
40
|
handlePlayOrPause(): void;
|
|
41
41
|
handlePlay(): void;
|
|
42
42
|
handlePause(): void;
|
|
43
|
+
handleVideoPlay: () => void;
|
|
44
|
+
handleVideoPause: () => void;
|
|
43
45
|
handleCanPlay: () => void;
|
|
44
46
|
handleWaiting: (locale: any) => void;
|
|
45
47
|
handleStalled: (locale: any) => void;
|
|
@@ -18,6 +18,14 @@ class VideoPlayerFoundation extends _foundation.default {
|
|
|
18
18
|
this._adapter.setShowControls(false);
|
|
19
19
|
}, 3000);
|
|
20
20
|
}, 200);
|
|
21
|
+
this.handleVideoPlay = () => {
|
|
22
|
+
this._adapter.setIsPlaying(true);
|
|
23
|
+
this._adapter.notifyPlay();
|
|
24
|
+
};
|
|
25
|
+
this.handleVideoPause = () => {
|
|
26
|
+
this._adapter.setIsPlaying(false);
|
|
27
|
+
this._adapter.notifyPause();
|
|
28
|
+
};
|
|
21
29
|
this.handleCanPlay = () => {
|
|
22
30
|
this._adapter.setShowNotification(false);
|
|
23
31
|
};
|
|
@@ -197,17 +205,17 @@ class VideoPlayerFoundation extends _foundation.default {
|
|
|
197
205
|
handlePlay() {
|
|
198
206
|
const video = this._adapter.getVideo();
|
|
199
207
|
if (video) {
|
|
208
|
+
// 触发原生 onPlay 后通过 handleVideoPlay 更新 isPlaying 状态
|
|
209
|
+
// After triggering the native onPlay, the isPlaying state is updated via handleVideoPlay.
|
|
200
210
|
video.play();
|
|
201
|
-
this._adapter.setIsPlaying(true);
|
|
202
|
-
this._adapter.notifyPlay();
|
|
203
211
|
}
|
|
204
212
|
}
|
|
205
213
|
handlePause() {
|
|
206
214
|
const video = this._adapter.getVideo();
|
|
207
215
|
if (video) {
|
|
216
|
+
// 触发原生 onPause 后通过 handleVideoPause 更新 isPlaying 状态
|
|
217
|
+
// After triggering the native onPause, the isPlaying state is updated via handleVideoPause.
|
|
208
218
|
video.pause();
|
|
209
|
-
this._adapter.setIsPlaying(false);
|
|
210
|
-
this._adapter.notifyPause();
|
|
211
219
|
}
|
|
212
220
|
}
|
|
213
221
|
handleVolumeChange(value) {
|
|
@@ -40,6 +40,8 @@ export default class VideoPlayerFoundation<P = Record<string, any>, S = Record<s
|
|
|
40
40
|
handlePlayOrPause(): void;
|
|
41
41
|
handlePlay(): void;
|
|
42
42
|
handlePause(): void;
|
|
43
|
+
handleVideoPlay: () => void;
|
|
44
|
+
handleVideoPause: () => void;
|
|
43
45
|
handleCanPlay: () => void;
|
|
44
46
|
handleWaiting: (locale: any) => void;
|
|
45
47
|
handleStalled: (locale: any) => void;
|
|
@@ -11,6 +11,14 @@ export default class VideoPlayerFoundation extends BaseFoundation {
|
|
|
11
11
|
this._adapter.setShowControls(false);
|
|
12
12
|
}, 3000);
|
|
13
13
|
}, 200);
|
|
14
|
+
this.handleVideoPlay = () => {
|
|
15
|
+
this._adapter.setIsPlaying(true);
|
|
16
|
+
this._adapter.notifyPlay();
|
|
17
|
+
};
|
|
18
|
+
this.handleVideoPause = () => {
|
|
19
|
+
this._adapter.setIsPlaying(false);
|
|
20
|
+
this._adapter.notifyPause();
|
|
21
|
+
};
|
|
14
22
|
this.handleCanPlay = () => {
|
|
15
23
|
this._adapter.setShowNotification(false);
|
|
16
24
|
};
|
|
@@ -190,17 +198,17 @@ export default class VideoPlayerFoundation extends BaseFoundation {
|
|
|
190
198
|
handlePlay() {
|
|
191
199
|
const video = this._adapter.getVideo();
|
|
192
200
|
if (video) {
|
|
201
|
+
// 触发原生 onPlay 后通过 handleVideoPlay 更新 isPlaying 状态
|
|
202
|
+
// After triggering the native onPlay, the isPlaying state is updated via handleVideoPlay.
|
|
193
203
|
video.play();
|
|
194
|
-
this._adapter.setIsPlaying(true);
|
|
195
|
-
this._adapter.notifyPlay();
|
|
196
204
|
}
|
|
197
205
|
}
|
|
198
206
|
handlePause() {
|
|
199
207
|
const video = this._adapter.getVideo();
|
|
200
208
|
if (video) {
|
|
209
|
+
// 触发原生 onPause 后通过 handleVideoPause 更新 isPlaying 状态
|
|
210
|
+
// After triggering the native onPause, the isPlaying state is updated via handleVideoPause.
|
|
201
211
|
video.pause();
|
|
202
|
-
this._adapter.setIsPlaying(false);
|
|
203
|
-
this._adapter.notifyPause();
|
|
204
212
|
}
|
|
205
213
|
}
|
|
206
214
|
handleVolumeChange(value) {
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@douyinfe/semi-foundation",
|
|
3
|
-
"version": "2.89.0
|
|
3
|
+
"version": "2.89.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build:lib": "node ./scripts/compileLib.js",
|
|
7
7
|
"prepublishOnly": "npm run build:lib"
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
|
-
"@douyinfe/semi-animation": "2.89.0
|
|
11
|
-
"@douyinfe/semi-json-viewer-core": "2.89.0
|
|
10
|
+
"@douyinfe/semi-animation": "2.89.0",
|
|
11
|
+
"@douyinfe/semi-json-viewer-core": "2.89.0",
|
|
12
12
|
"@mdx-js/mdx": "^3.0.1",
|
|
13
13
|
"async-validator": "^3.5.0",
|
|
14
14
|
"classnames": "^2.2.6",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"*.scss",
|
|
30
30
|
"*.css"
|
|
31
31
|
],
|
|
32
|
-
"gitHead": "
|
|
32
|
+
"gitHead": "9928f1af6b523f59aaf103f4afd4b8ea95469dd5",
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@babel/plugin-transform-runtime": "^7.15.8",
|
|
35
35
|
"@babel/preset-env": "^7.15.8",
|
|
@@ -107,21 +107,31 @@ export default class VideoPlayerFoundation<P = Record<string, any>, S = Record<s
|
|
|
107
107
|
handlePlay() {
|
|
108
108
|
const video = this._adapter.getVideo();
|
|
109
109
|
if (video) {
|
|
110
|
+
// 触发原生 onPlay 后通过 handleVideoPlay 更新 isPlaying 状态
|
|
111
|
+
// After triggering the native onPlay, the isPlaying state is updated via handleVideoPlay.
|
|
110
112
|
video.play();
|
|
111
|
-
this._adapter.setIsPlaying(true);
|
|
112
|
-
this._adapter.notifyPlay();
|
|
113
113
|
}
|
|
114
114
|
}
|
|
115
115
|
|
|
116
116
|
handlePause() {
|
|
117
117
|
const video = this._adapter.getVideo();
|
|
118
118
|
if (video) {
|
|
119
|
+
// 触发原生 onPause 后通过 handleVideoPause 更新 isPlaying 状态
|
|
120
|
+
// After triggering the native onPause, the isPlaying state is updated via handleVideoPause.
|
|
119
121
|
video.pause();
|
|
120
|
-
this._adapter.setIsPlaying(false);
|
|
121
|
-
this._adapter.notifyPause();
|
|
122
122
|
}
|
|
123
123
|
}
|
|
124
124
|
|
|
125
|
+
handleVideoPlay = () => {
|
|
126
|
+
this._adapter.setIsPlaying(true);
|
|
127
|
+
this._adapter.notifyPlay();
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
handleVideoPause = () => {
|
|
131
|
+
this._adapter.setIsPlaying(false);
|
|
132
|
+
this._adapter.notifyPause();
|
|
133
|
+
}
|
|
134
|
+
|
|
125
135
|
handleCanPlay = () => {
|
|
126
136
|
this._adapter.setShowNotification(false);
|
|
127
137
|
}
|