How scottschiller/soundmanager2 works
Project type and purpose
• This is an open-source JavaScript audio library (“SoundManager2”) that provides a unified API for HTML5 Audio and Flash fallback.
• It ships core JS modules, pre-compiled Flash SWFs (for legacy support), extensive demos and documentation, and a build pipeline to recompile both JS and SWF assets.
File structure
• Top-level directories:
• script/ – built JS artifacts (soundmanager2.js, .jsmin, nodebug builds)
• src/ – ActionScript sources (AS2, AS3) plus shell scripts/batch files to compile them
• swf/ – compiled SWF binaries (flash8, flash9, debug variants)
• demo/ – dozens of standalone HTML+CSS+JS demos showing widget/animation usage
• doc/ – documentation site (source, generated via docco, demos, getstarted, technotes)
• troubleshoot/ – debug tools & pages
• script/ & build.xml – Ant build file defining JS and SWF compilation tasks
• package.json, bower.json, component.json – package metadata
• Patterns:
• Facade/API layer in JS abstracts HTML5 vs. Flash
• Build pipeline orchestrated by Ant + Closure Compiler + MTASC + Flex SDK
README for additional insights
• Core features: load/play/pause/stop/mute/seek, events, HTML5-first with Flash fallback
• Build instructions: Ant targets for JS builds and SWF compilation (AS2 via MTASC, AS3 via mxmlc)
• Documentation & demos are first-class citizens, and the project is versioned by date tags.
Elements
• Blue for runtime modules
• Green for build-time tools
• Gray for demos/documentation
Detail
• Every essential piece: config files, build scripts, source directories, compiled outputs, and the multiple demo use-cases.