@cc-component/cc-video 1.1.6 → 1.1.7
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.
|
@@ -93,11 +93,11 @@ export class VideoManager {
|
|
|
93
93
|
return
|
|
94
94
|
}
|
|
95
95
|
const currentName = this.currentList[this.currentIndex]
|
|
96
|
-
//console.log("
|
|
96
|
+
//console.log("视频:时间:", !this.baseVideo.getisPause(),data.position , currentName.end);
|
|
97
97
|
if (this.isLoop) {
|
|
98
98
|
if (data.position >= currentName.end_time && !this.baseVideo.getisPause()) {
|
|
99
99
|
if (VideoManager.instance.Debug)
|
|
100
|
-
console.log("
|
|
100
|
+
console.log("视频:播放结束:", currentName, !this.baseVideo.getisPause);
|
|
101
101
|
await this.pause();
|
|
102
102
|
this.currentIndex++;
|
|
103
103
|
if (this.currentIndex === this.currentList.length) {
|
|
@@ -109,7 +109,7 @@ export class VideoManager {
|
|
|
109
109
|
} else {
|
|
110
110
|
if (data.position >= currentName.end_time && !this.baseVideo.getisPause()) {
|
|
111
111
|
if (VideoManager.instance.Debug)
|
|
112
|
-
console.log("
|
|
112
|
+
console.log("视频:播放结束:", currentName, !this.baseVideo.getisPause);
|
|
113
113
|
await this.pause();
|
|
114
114
|
this.paramPlay?.onFinish?.()
|
|
115
115
|
}
|
|
@@ -123,7 +123,7 @@ export class VideoManager {
|
|
|
123
123
|
|
|
124
124
|
this.baseVideo.onVideoEnd = () => {
|
|
125
125
|
if (VideoManager.instance.Debug)
|
|
126
|
-
console.warn("
|
|
126
|
+
console.warn("视频:视频播放完成")
|
|
127
127
|
const taskId = 'mainVideoList';
|
|
128
128
|
if (this.playTasks.has(taskId)) {
|
|
129
129
|
const task = this.playTasks.get(taskId);
|
|
@@ -141,12 +141,12 @@ export class VideoManager {
|
|
|
141
141
|
};
|
|
142
142
|
this.baseVideo.onRead = () => {
|
|
143
143
|
if (VideoManager.instance.Debug)
|
|
144
|
-
console.log("
|
|
144
|
+
console.log("视频:视频准备好了")
|
|
145
145
|
this.cover.node.active = false
|
|
146
146
|
this.seek(0)
|
|
147
147
|
if (this.param.isLocal) {
|
|
148
148
|
//this.play()
|
|
149
|
-
//console.log("
|
|
149
|
+
//console.log("视频:开始播放")
|
|
150
150
|
this.param?.onRead?.()
|
|
151
151
|
}
|
|
152
152
|
else if (this.param.isPlayTime) {
|
|
@@ -171,7 +171,7 @@ export class VideoManager {
|
|
|
171
171
|
loadVideo(name: string, param: IVideoParam): void {
|
|
172
172
|
name = param.isLocal ? name : `${this.remote_url}${name}.mp4`
|
|
173
173
|
if (VideoManager.instance.Debug)
|
|
174
|
-
console.log("
|
|
174
|
+
console.log("视频:加载视频:", name);
|
|
175
175
|
this.param = param;
|
|
176
176
|
this.cover.spriteFrame = assetManager.getBundle(this.paramInit.bundle)?.get(`${this.paramInit.cover_dir}/${param.coverImage}/spriteFrame`)
|
|
177
177
|
this.cover.node.active = this.cur_name === name ? false : true;
|
|
@@ -244,7 +244,7 @@ export class VideoManager {
|
|
|
244
244
|
this.currentList = list;
|
|
245
245
|
this.currentIndex = 0
|
|
246
246
|
if (VideoManager.instance.Debug)
|
|
247
|
-
console.log("
|
|
247
|
+
console.log("视频:当前播放列表", JSON.stringify(list))
|
|
248
248
|
this.coount++;
|
|
249
249
|
// 重置状态
|
|
250
250
|
this.stopRequested = false;
|
|
@@ -259,7 +259,7 @@ export class VideoManager {
|
|
|
259
259
|
}
|
|
260
260
|
};
|
|
261
261
|
if (VideoManager.instance.Debug)
|
|
262
|
-
console.log("
|
|
262
|
+
console.log("视频:开始任务", this.coount)
|
|
263
263
|
// 将停止函数和 finishPlayResolve 存储到Map中
|
|
264
264
|
this.playTasks.set(taskId, { count: this.coount, stop: stopFunction, finishPlayResolve: null });
|
|
265
265
|
const oldTask = this.playTasks.get(taskId);
|
|
@@ -295,7 +295,7 @@ export class VideoManager {
|
|
|
295
295
|
// 检查是否需要停止
|
|
296
296
|
if (this.stopRequested) {
|
|
297
297
|
if (VideoManager.instance.Debug)
|
|
298
|
-
console.log("
|
|
298
|
+
console.log("视频:播放被停止");
|
|
299
299
|
break;
|
|
300
300
|
}
|
|
301
301
|
if (this.isError) { break; }
|
|
@@ -42,7 +42,7 @@ export class VideoModule {
|
|
|
42
42
|
// }
|
|
43
43
|
VideoManager.instance.remote_url = param.remote_url
|
|
44
44
|
VideoManager.instance.initVideo(param)
|
|
45
|
-
console.log("
|
|
45
|
+
console.log("视频:视频初始化完成")
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
static Debug(enabled: boolean) { VideoManager.instance.Debug = enabled }
|
|
@@ -185,14 +185,14 @@ export class VideoPlayTT extends BaseVideo {
|
|
|
185
185
|
this.videoPlayer.pause();
|
|
186
186
|
this.isPlaying = false
|
|
187
187
|
|
|
188
|
-
console.log("
|
|
188
|
+
console.log("视频:暂停")
|
|
189
189
|
})
|
|
190
190
|
|
|
191
191
|
}
|
|
192
192
|
stop() {
|
|
193
193
|
this.videoPlayer.stop();
|
|
194
194
|
this.isPlaying = false
|
|
195
|
-
console.log("
|
|
195
|
+
console.log("视频:停止")
|
|
196
196
|
this.canPlay = false;
|
|
197
197
|
|
|
198
198
|
}
|
|
@@ -122,13 +122,13 @@ export class VideoPlayWX extends BaseVideo {
|
|
|
122
122
|
return new Promise<void>((resolve, reject) => {
|
|
123
123
|
this.pauseFinish = resolve;
|
|
124
124
|
this.videoPlayer.pause();
|
|
125
|
-
console.log("
|
|
125
|
+
console.log("视频:暂停")
|
|
126
126
|
})
|
|
127
127
|
}
|
|
128
128
|
stop() {
|
|
129
129
|
this.videoPlayer.stop();
|
|
130
130
|
this.isPlaying = false
|
|
131
|
-
console.log("
|
|
131
|
+
console.log("视频:停止")
|
|
132
132
|
|
|
133
133
|
}
|
|
134
134
|
resume() {
|
|
@@ -116,7 +116,7 @@ export class VideoPlayWeb extends BaseVideo {
|
|
|
116
116
|
if (isloop != undefined || isloop != null) {
|
|
117
117
|
this.videoPlayer.loop = isloop
|
|
118
118
|
}
|
|
119
|
-
//console.warn("
|
|
119
|
+
//console.warn("视频:播放2")
|
|
120
120
|
this.videoPlayer.play();
|
|
121
121
|
// this.videoPlayer.resume();
|
|
122
122
|
this.isPlaying = true
|
|
@@ -124,13 +124,13 @@ export class VideoPlayWeb extends BaseVideo {
|
|
|
124
124
|
async pause() {
|
|
125
125
|
this.videoPlayer.pause();
|
|
126
126
|
this.isPlaying = false
|
|
127
|
-
console.log("
|
|
127
|
+
console.log("视频:暂停")
|
|
128
128
|
|
|
129
129
|
}
|
|
130
130
|
stop() {
|
|
131
131
|
this.videoPlayer.stop();
|
|
132
132
|
this.isPlaying = false
|
|
133
|
-
//console.log("
|
|
133
|
+
//console.log("视频:停止")
|
|
134
134
|
|
|
135
135
|
}
|
|
136
136
|
resume() {
|
|
@@ -183,7 +183,7 @@ export class VideoPlayWeb extends BaseVideo {
|
|
|
183
183
|
this.activeVideo(false)
|
|
184
184
|
this.stop()
|
|
185
185
|
this.isReady = false;
|
|
186
|
-
console.log("
|
|
186
|
+
console.log("视频:销毁")
|
|
187
187
|
}
|
|
188
188
|
}
|
|
189
189
|
activeVideo(isActive: boolean) {
|