TL;DR
- Budget canvas and RGBA RAM by slot concurrency: full-screen gifts (
750 × 1334portrait reference) play one at a time in a queue, whereas voice-chat avatar frames (240 × 240) and badges often run 8–12 simultaneous instances and require tight∑ w × h × 4memory caps. - Lock
imageKeynames and multilingual text safety before export: verify circular avatar masking and stress-testsetTextslots with CJK, long English usernames, and Arabic (RTL) strings inside the SVGA Online Editor. - Keep gift audio subordinate to voice chat: pause or duck gift MP3 audio when hosts or speakers talk, stop previous audio immediately on gift skip, and note that
SVGAPlayer-Web-Litedoes not play embedded audio. - Replace informal handoffs with a shared 11-field spec and 35-point QA pass: validate alpha edges in the SVGA Online Player and shrink oversized bitmaps in the SVGA Online Compressor before shipping.
Six standard gift and effect slots
| Slot type | Reference canvas (px) | Safe zone & layout constraints | Loop & cleanup behavior | Typical concurrency |
|---|---|---|---|---|
| Full-screen luxury gift | 750 × 1334 (9:16) |
Keep primary visuals in the center-upper 60%; clear the top host bar (~16%) and bottom chat/input bar (~28%) | Play once (loops = 1), clear on stop |
Queued (1 at a time) |
| Entrance ride / VIP banner | 750 × 200 to 750 × 300 |
Pad left/right margins for rounded corners and notches; no hard canvas-edge clipping | Enter, hold briefly, exit | Queued (1–2 streams) |
| Voice-chat avatar frame | 240 × 240 (or 2× 480 × 480) |
Transparent circular center cutout aligned to avatar component; keep seat badges unobstructed | Infinite loop (loops = 0) |
High (8–12 seats on screen) |
| Mic seat speaking wave | 180 × 180 to 240 × 240 |
Prefer ShapeEntity vectors or small bitmaps; never export full-canvas transparent PNGs for thin rings |
Loop while user speaks | High (multiple seats active) |
| Chat bubble skin | Fixed badge or padded frame | Keep inner text reading area clear and low-contrast behind message text | Play once or loop subtly | Medium–high (scrolling chat) |
| Gift icon / VIP badge | 120 × 120 to 160 × 160 |
Clean edges free of white/dark halos on both light and dark chat panels | loops = 0 or state-triggered |
High (repeated in chat feed) |
Download v2-gift-stage (750 × 1334 safe-zone reference) and v2-avatar-frame (240 × 240 transparent cutout reference) from the SVGA test samples library as starting templates.
Concurrency and low-end device fallback architecture
Avoid shipping a single heavy tier to every device class. Structure delivery across three tiers:
- Primary tier (full SVGA 2.0 or video effect): runs on mid-range and flagship hardware; releases decoded textures immediately when playback finishes (
clear()). - Constrained fallback tier: serves downscaled or reduced-bitmap SVGA 2.0 packages on low-RAM phones or weak networks; in battery-saver mode, pauses decorative loops on inactive voice seats.
- Static cover fallback: shows a lightweight PNG/WebP icon immediately while
.svgadownloads or if parsing fails, keeping gift bars and chat cells responsive.
Dynamic slot contract (imageKey, circular avatars, and CJK / EN / Arabic RTL safety)
Animations calling setImage or setText at runtime require strict contract alignment between designers and engineers:
- Stable ASCII
imageKeynames: lock explicit keys such asavatar_slotandbanner_text_slot. Never rely on auto-generated localized or numeric layer IDs that shift on re-export. - Circular avatar masking: either pass pre-masked circular PNGs from the client into
setImage, or bind amatteKeycircular mask layer in the composition (requires iOS>= 2.5.0/ Android>= 2.5.x). - Prevent CJK, English, and Arabic RTL text overflow:
- CJK nicknames are dense vertically; unspaced English handles clip horizontally; Arabic RTL strings and mixed bidirectional (
bidi) names shift visual alignment around centered anchors. - Define fixed bounding widths, ellipsis truncation (
...), and explicit text direction in the slot spec. - Load
v2-dynamic-slotfrom the samples library or your own asset into the SVGA Online Editor to test CJK, long English, and Arabic RTL presets live on stage and generate copy-ready SDK snippets containing the exactimageKey.
- CJK nicknames are dense vertically; unspaced English handles clip horizontally; Arabic RTL strings and mixed bidirectional (
Audio ducking and concurrency rules
- Voice chat always wins: duck or mute gift
AudioEntityMP3 tracks when active voice speakers are talking or global room mute is enabled. - Stop audio on gift skip: when a new combo gift interrupts the active full-screen animation, halt playback audio immediately (
SVGASoundManager.release()on Android2.6.0+, stop player on iOS) so two tracks never stack. - Account for Web Lite: because
SVGAPlayer-Web-Lite(svga) ignores embeddedAudioEntitytracks, mute web-only loops or route audio through a separate Web Audio trigger on user interaction.
11-field design-to-engineering handoff sheet
| # | Field | Example specification |
|---|---|---|
| 1 | Asset ID | gift_crown_full_v2 |
| 2 | Slot category | Full-screen gift / Avatar frame / Entrance banner |
| 3 | Target canvas (W × H) | 750 × 1334 (safe zone: center-upper 600 × 760) |
| 4 | FPS & frame count | 24 FPS / 72 frames (3.00s) |
| 5 | Loop & end behavior | loops = 1, clearsAfterStop = true |
| 6 | Container version | SVGA 2.0.0 (raw zlib + Protobuf, not 1.x ZIP) |
| 7 | Dynamic imageKey map |
avatar_slot (160×160 circle), banner_text_slot (360×64, max 12 chars / RTL safe) |
| 8 | Uses matteKey track matte |
Yes (requires iOS >= 2.5.0, Android >= 2.5.x) |
| 9 | Uses AudioEntity track |
Yes (chime_audio, frames 0–30; muted on Web Lite) |
| 10 | Measured wire bytes & RGBA RAM | 380 KB / 11.4 MiB (verified in SVGA Online Player) |
| 11 | Fallback asset | gift_crown_lite.svga + static gift_crown_cover.png |
35-item pre-launch QA checklist
A. Canvas & safe-zone layout (1–5)
- Canvas aspect ratio matches the target native/Web container with no distortion.
- Full-screen gift hero elements stay clear of top host bars and bottom chat/input overlays.
- Banners and badges leave corner/notch clearance on modern phones.
- Avatar frame circular cutout aligns cleanly with the client’s avatar view bounds.
- Soft-feathered edges fade to zero alpha before touching canvas borders (no hard clip line).
B. Alpha cleanliness & visual quality (6–10)
- No white or light halos appear over dark checkerboards in the SVGA Online Player.
- No dark premultiplied fringes appear over light checkerboards.
- PNG-8 quantized glows remain free of visible color banding.
- Small numbers, prices, and 1 px outlines stay sharp at target physical phone scale.
- First and last frames of infinite-loop assets (
loops = 0) connect smoothly with zero jump.
C. Wire size & RGBA memory budget (11–15)
- Orphan images and duplicate identical frames in
MovieEntity.imageshave been removed. - No bitmap exceeds
1024 × 1024or carries large transparent borders around a tiny icon. - Total decoded RGBA memory (
∑ w × h × 4) fits the slot’s low-end device budget. - Oversized assets passed through the SVGA Online Compressor without growing larger.
- Redundant trailing static hold frames trimmed; frame-by-frame FPS tuned (
24/20/15 fps).
D. Dynamic slots & multilingual text (16–20)
imageKeyidentifiers remained intact across design revisions.- Square, portrait, and landscape photos tested in
setImagevia the SVGA Online Editor. - Short CJK, long unspaced English, and Arabic RTL strings tested in
setTextslots for clipping/overlap. - Placeholder slot bitmaps are transparent or clean defaults before dynamic injection runs.
matteKeymasks align cleanly with dynamic replacements without offset artifacts.
E. Audio & timeline sync (21–25)
- Embedded MP3 files include ID3v2 headers (
SUQz) for Web Classic compatibility. AudioEntity.startFrameandendFramematch key visual impact frames.- Interrupting or skipping gifts stops the active sound immediately without overlapping audio.
- Gift sound effects obey room mute toggles and duck beneath active voice speakers.
- Silent avatar frames and Web-Lite-only assets contain zero leftover
AudioEntityblobs.
F. Cross-platform SDK compatibility (26–30)
- Output validated as SVGA 2.0 (not 1.x ZIP) for
SVGAPlayer-Web-Liteandflutter_svga. - Minimum app versions verified when
matteKeyis present (iOS>= 2.5.0, Android>= 2.5.x). - Android release builds include ProGuard / R8 keep rules for Wire and SVGA Proto classes.
- Remote CDN URLs return valid HTTPS +
Access-Control-Allow-Originheaders for Web. - Static cover images and fallback tiers are uploaded and verified alongside primary files.
G. Lifecycle & memory cleanup (31–35)
- Three consecutive loops play smoothly on a low-end test device without thermal/frame stalls.
- Scrolling lists (
RecyclerView/UICollectionView/FlatList) never show recycled avatars from previous cells. - Playback stop and screen exit call
stopAnimation(),clearDynamicObjects(), andclear()/destroy(). - Web SPA routes (Vue / React) destroy both
PlayerandParserWorkers on unmount. - Memory returns cleanly to baseline after ten back-to-back gift triggers with zero upward drift.
