@cc-component/cc-video 1.1.0 → 1.1.2
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.
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { IVideoParam, IVideoData, InitParam } from "./base/IVideo";
|
|
2
2
|
|
|
3
3
|
declare module "cc" {
|
|
4
|
+
|
|
5
|
+
}
|
|
6
|
+
declare global {
|
|
4
7
|
namespace VideoModule {
|
|
5
8
|
/**开启日志打印 */
|
|
6
9
|
export function Debug(enabled: boolean);
|
|
@@ -23,9 +26,6 @@ declare module "cc" {
|
|
|
23
26
|
/**节点位置适配-自动适配 */
|
|
24
27
|
export function AutoSize()
|
|
25
28
|
}
|
|
26
|
-
}
|
|
27
|
-
declare global {
|
|
28
|
-
|
|
29
29
|
}
|
|
30
30
|
// // 必须在 game.init() 之前设置!
|
|
31
31
|
//macro.ENABLE_TRANSPARENT_CANVAS = true;
|
|
@@ -60,14 +60,16 @@ export class VideoModule {
|
|
|
60
60
|
/**提前加载视频 */
|
|
61
61
|
static LoadVideo(name: string, param: IVideoParam) {
|
|
62
62
|
VideoManager.instance.stopVideoList()
|
|
63
|
-
param.isLocal
|
|
63
|
+
if (param.isLocal === undefined)
|
|
64
|
+
param.isLocal = VideoModule.isLocal(name)
|
|
64
65
|
VideoManager.instance.loadVideo(name, param)
|
|
65
66
|
}
|
|
66
67
|
|
|
67
68
|
/**播放单个视频 */
|
|
68
69
|
static PlayVideo(video: IVideoData, param: IVideoParam) {
|
|
69
70
|
VideoManager.instance.stopVideoList()
|
|
70
|
-
param.isLocal
|
|
71
|
+
if (param.isLocal === undefined)
|
|
72
|
+
param.isLocal = VideoModule.isLocal(video.name)
|
|
71
73
|
const onRead = param.onRead
|
|
72
74
|
param.onRead = () => {
|
|
73
75
|
onRead?.()
|
|
@@ -79,7 +81,9 @@ export class VideoModule {
|
|
|
79
81
|
/** 播放多个视频*/
|
|
80
82
|
static PlayVideoMore(video_list: IVideoData[], param: IVideoParam) {
|
|
81
83
|
const url = video_list[0].name
|
|
82
|
-
param.isLocal
|
|
84
|
+
if (param.isLocal === undefined)
|
|
85
|
+
param.isLocal = VideoModule.isLocal(url)
|
|
86
|
+
|
|
83
87
|
if (param.isPlayTime) {
|
|
84
88
|
const onRead = param.onRead
|
|
85
89
|
param.onRead = () => {
|
package/index.ts
CHANGED