@cc-component/cc-video 1.2.6 → 1.2.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.
@@ -3,6 +3,7 @@ import { VideoModule } from './VideoModule';
3
3
  import { Camera } from 'cc';
4
4
  import { director } from 'cc';
5
5
  import { Color } from 'cc';
6
+ import { gfx } from 'cc';
6
7
  const { ccclass, property } = _decorator;
7
8
  @ccclass('VideoComponent')
8
9
  export class VideoComponent extends Component {
@@ -17,8 +18,11 @@ export class VideoComponent extends Component {
17
18
  @property({ displayName: '远程地址根目录', tooltip: '视频远程地址全路径示例: https://hcy-cdn-domestic.wyx.cn/online/comeback/xxx.mp4' })
18
19
  remote_url: string = 'https://hcy-cdn-domestic.wyx.cn/online/comeback/video/'
19
20
  protected onLoad(): void {
20
- //const camera = director.getScene().getComponentsInChildren(Camera)[0]
21
- // camera.clearColor = new Color(0, 0, 0, 0)
21
+ const cameras = director.getScene().getComponentsInChildren(Camera)
22
+ cameras.forEach(camera => {
23
+ camera.clearColor = new Color(0, 0, 0, 0)
24
+ camera.clearFlags = gfx.ClearFlagBit.COLOR
25
+ })
22
26
  VideoModule.InitVideo({
23
27
  node: this.node.getChildByPath('video'),
24
28
  cover: this.node.getChildByName('cover'),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cc-component/cc-video",
3
- "version": "1.2.6",
3
+ "version": "1.2.7",
4
4
  "engine": ">=3.8.6",
5
5
  "description": "系统组件添加常用扩展方法",
6
6
  "main": "index.ts",