Index of every page on this site: llms.txt
All skills
oahc09 avatar

/cocosair-audio-video

@ed38648
by oahc09oahc09/cocosairjs3 stars
2
Run it yourself

Play media with AudioService, VideoPlayer and WebView. Use for silent autoplay, advancing currentTime, BGM/SFX channels or DOM video and iframe overlays.

  • 9 files
  • 40.4 KB
  • MIT
  • Updated last month
  • GitHub
Use this Skill: https://skilld.dev/gh/oahc09/cocosairjs/cocosair-audio-video

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

referencescontext.md

≈1.1k tokens on demand. Your agent reads this file only when SKILL.md points to it.

Working context

Use package imports and shipped docs for an application; use source paths and repository commands only in a confirmed AIR checkout. A copied host skill is not a runtime installation.

Read the shared environment rules when locating these roots. If sibling resources are unavailable, use the installed canonical chapter and disclose the limitation. Tool declarations identify workflow capabilities; they do not authorize installation, writes, publication or any action outside the user and host scope.

Related skills

Original entry guidance

The original entry wording below is an on-demand archive, not a second routing source.

Use the environment rules to locate the checkout or installed package; sibling skills are optional direct dependencies, not a recursive load list.

Play background music and sound effects through AudioService, mount real <video> and <iframe> DOM overlays through VideoPlayer and WebView, and prove playback with measured time instead of boolean flags - all from code, no Creator pipeline.

Read references/quick-start.md when constructing the minimal example. It preserves the complete setup and teardown sequence; select the source-checkout or npm-consumer environment first.

Read references/context.md to select the owner of this step and only its directly needed dependencies. Reuse already loaded skills; this is not a recursive load list.

Original mistake navigation

Before implementing the relevant path, read its wrong/right examples in references/common-mistakes.md:

  • [HIGH] Trusting a playing boolean instead of the measured playback head
  • [HIGH] Mounting WebView on an active node before setting the url
  • [MEDIUM] Expecting sound before any user gesture
  • [MEDIUM] Setting ENABLE_TRANSPARENT_CANVAS after the app is created

Original metadata

Description and description_en

The two original fields contained exactly the same value, retained once here.

Drives Cocos AIR audio, video and WebView from code - AudioService business channels over AudioSource (load, playBgm, pauseBgm, resumeBgm, stopBgm, setBgmVolume, playSfx, setMusicEnabled, setSfxEnabled, bgmState, dispose, maxSfxVoices cap with sfxDropped), measured-currentTime playback evidence, browser autoplay gesture unlock, VideoPlayer DOM-overlay events and transparent video, WebView iframe limits and evaluateJS. Use when audio starts silently or play() seems ignored, when proving a channel actually advances, when a video or iframe must sit under or over the WebGL canvas, or when WebView loads the wrong URL on mount.

Keywords

Cocos AIR, cocosair.js, audio, video

References

  • audio-service.md - full AudioService surface, SFX voice cap and drop counter, gesture unlock plumbing, autoplay rejection evidence.
  • videoplayer.md - event bridge, DOM overlay geometry, transparent video, fullscreen branches, source switching and leak counting.
  • webview.md - iframe overlay lifecycle, url/listener mount order, evaluateJS side effects, error-event sniffing, Web platform limits.

Canonical docs

  • docs/manual/audio-video-webview.md - the three-domain overview, gesture routes, AudioService contract and example matrix.
  • docs/notes/audio-notes.md - Code First audio path, per-source player facts, WebKit silent branches.
  • docs/notes/video-notes.md - stayOnBottom composition, fullscreen defect chain, decode-frame evidence rules.
  • docs/notes/webview-notes.md - overlay hit-testing, 404-sniffing, mount ordering, evaluateJS failure shape.

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No third-party reports yet.

Signed by skilld at ed38648. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub yesterday.

Activeupdated last month
layer
subsystem
All 1 allowed tools
Read Edit Write Bash
Other metadata
compatibility
Cocos AIR source checkout or installed cocosair.js package. Browser rendering requires WebGL 2; source tooling requires Node.js >=18. Use the host-provided tools and user-authorized workspace.
when_to_use
[
  "audio starts silently before a user gesture",
  "control BGM and SFX channels or volume",
  "prove playback time actually advances",
  "place video above or below the canvas",
  "WebView mounts the wrong URL"
]
owns
[
  "audio-service",
  "autoplay-unlock",
  "playback-time",
  "video-player",
  "webview"
]
not_for
[
  "shared remote-file caching -> cocosair-assets",
  "DOM input geometry or HTML textures -> cocosair-graphics-and-dom",
  "keyboard and action focus -> cocosair-input-action"
]
metadata
{
  "author": "oahc09@gmail.com",
  "version": "1.0.0",
  "last-updated": "2026-10-13",
  "description_zh": "管理音频通道、用户手势解锁、播放证据、VideoPlayer 和 WebView。用于媒体加载、播放、平台限制或资源清理。"
}

README badge

README badge for oahc09/cocosairjs/cocosair-audio-video