cocos_add_video_player
Add a video player component to Cocos Creator nodes for playing MP4 files from local clips or remote URLs, enabling cinematic intros, tutorials, and video ads in games.
Instructions
Attach cc.VideoPlayer — plays mp4 from a local cc.VideoClip or remote URL.
resource_type: 0=REMOTE (use remote_url), 1=LOCAL (use clip_uuid).
Use cases:
Cinematic intro / cutscenes (LOCAL with clip_uuid)
Rewarded video ads (REMOTE with ad-server URL)
In-game tutorials (LOCAL, loop=True)
On WeChat mini-game the player is a native overlay; stay_on_bottom and full_screen_on_awake change platform-specific layering.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| scene_path | Yes | ||
| node_id | Yes | ||
| resource_type | No | ||
| remote_url | No | ||
| clip_uuid | No | ||
| play_on_awake | No | ||
| volume | No | ||
| mute | No | ||
| loop | No | ||
| keep_aspect_ratio | No | ||
| full_screen_on_awake | No | ||
| stay_on_bottom | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |