@cc-component/cc-video 1.1.9 → 1.2.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/assets/video/Interface.ts +1 -0
- package/assets/video/base/VideoManager.ts +2 -2
- package/assets/video/base/VideoModule.ts +1 -0
- package/assets/video/base/VideoPlayTT.ts +8 -5
- package/assets/video/base/VideoPlayWX.ts +4 -2
- package/assets/video/base/VideoPlayWeb.ts +4 -2
- package/package.json +1 -1
|
@@ -96,7 +96,7 @@ export class VideoManager {
|
|
|
96
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
|
-
if (
|
|
99
|
+
if (VideoModule.IsDebug())
|
|
100
100
|
console.log("视频:播放结束:", currentName, !this.baseVideo.getisPause);
|
|
101
101
|
await this.pause();
|
|
102
102
|
this.currentIndex++;
|
|
@@ -118,7 +118,7 @@ export class VideoManager {
|
|
|
118
118
|
};
|
|
119
119
|
this.baseVideo.onError = (err) => {
|
|
120
120
|
this.isError = true;
|
|
121
|
-
console.error("视频报错了", err)
|
|
121
|
+
console.error("视频报错了 ", err)
|
|
122
122
|
};
|
|
123
123
|
|
|
124
124
|
this.baseVideo.onVideoEnd = () => {
|
|
@@ -46,6 +46,7 @@ export class VideoModule {
|
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
static Debug(enabled: boolean) { VideoManager.instance.Debug = enabled }
|
|
49
|
+
static IsDebug() { return VideoManager.instance.Debug }
|
|
49
50
|
/**视频设置到指定大小 */
|
|
50
51
|
static SetSize(param: { x: number, y: number, width: number, height: number }) { VideoManager.instance.setSize(param) }
|
|
51
52
|
/**节点位置适配-自动适配 */
|
|
@@ -101,7 +101,8 @@ export class VideoPlayTT extends BaseVideo {
|
|
|
101
101
|
// return
|
|
102
102
|
// } else {
|
|
103
103
|
// }
|
|
104
|
-
|
|
104
|
+
if (VideoModule.IsDebug())
|
|
105
|
+
console.warn('准备好了')
|
|
105
106
|
this.videoTexture = new Texture2D();
|
|
106
107
|
this.imgAsset.reset(this.videoPlayer);
|
|
107
108
|
this.videoTexture.image = this.imgAsset;
|
|
@@ -184,15 +185,16 @@ export class VideoPlayTT extends BaseVideo {
|
|
|
184
185
|
this.pauseFinish = resolve;
|
|
185
186
|
this.videoPlayer.pause();
|
|
186
187
|
this.isPlaying = false
|
|
187
|
-
|
|
188
|
-
|
|
188
|
+
if (VideoModule.IsDebug())
|
|
189
|
+
console.log("视频:暂停")
|
|
189
190
|
})
|
|
190
191
|
|
|
191
192
|
}
|
|
192
193
|
stop() {
|
|
193
194
|
this.videoPlayer.stop();
|
|
194
195
|
this.isPlaying = false
|
|
195
|
-
|
|
196
|
+
if (VideoModule.IsDebug())
|
|
197
|
+
console.log("视频:停止")
|
|
196
198
|
this.canPlay = false;
|
|
197
199
|
|
|
198
200
|
}
|
|
@@ -266,7 +268,8 @@ export class VideoPlayTT extends BaseVideo {
|
|
|
266
268
|
this.video_sp.spriteFrame = null
|
|
267
269
|
//this.videoPlayer.x = 2000;
|
|
268
270
|
this.pause()
|
|
269
|
-
|
|
271
|
+
if (VideoModule.IsDebug())
|
|
272
|
+
console.warn('销毁了视频')
|
|
270
273
|
this.isReady = false;
|
|
271
274
|
|
|
272
275
|
this.videoPlayer.destroy()
|
|
@@ -122,13 +122,15 @@ export class VideoPlayWX extends BaseVideo {
|
|
|
122
122
|
return new Promise<void>((resolve, reject) => {
|
|
123
123
|
this.pauseFinish = resolve;
|
|
124
124
|
this.videoPlayer.pause();
|
|
125
|
-
|
|
125
|
+
if (VideoModule.IsDebug())
|
|
126
|
+
console.log("视频:暂停")
|
|
126
127
|
})
|
|
127
128
|
}
|
|
128
129
|
stop() {
|
|
129
130
|
this.videoPlayer.stop();
|
|
130
131
|
this.isPlaying = false
|
|
131
|
-
|
|
132
|
+
if (VideoModule.IsDebug())
|
|
133
|
+
console.log("视频:停止")
|
|
132
134
|
|
|
133
135
|
}
|
|
134
136
|
resume() {
|
|
@@ -124,7 +124,8 @@ export class VideoPlayWeb extends BaseVideo {
|
|
|
124
124
|
async pause() {
|
|
125
125
|
this.videoPlayer.pause();
|
|
126
126
|
this.isPlaying = false
|
|
127
|
-
|
|
127
|
+
if (VideoModule.IsDebug())
|
|
128
|
+
console.log("视频:暂停")
|
|
128
129
|
|
|
129
130
|
}
|
|
130
131
|
stop() {
|
|
@@ -183,7 +184,8 @@ export class VideoPlayWeb extends BaseVideo {
|
|
|
183
184
|
this.activeVideo(false)
|
|
184
185
|
this.stop()
|
|
185
186
|
this.isReady = false;
|
|
186
|
-
|
|
187
|
+
if (VideoModule.IsDebug())
|
|
188
|
+
console.log("视频:销毁")
|
|
187
189
|
}
|
|
188
190
|
}
|
|
189
191
|
activeVideo(isActive: boolean) {
|