Contributing to the Broadsign Integration
The Adlocaite Broadsign integration is open source and contributions are welcome. This guide covers the architecture, development workflow, and standards you need to know before submitting changes.
GitHub Repository
Source code, issues, and pull requests: github.com/Adlocaite/adlocaite-broadsign
How to contribute
There are several ways to contribute:
Bug reports
Found a bug? Open an issue on GitHub with:
- Steps to reproduce the problem
- Expected behavior vs. actual behavior
- Broadsign Control version and browser/Chromium version
- Console logs (enable
debugMode: true)
Feature requests
Have an idea? Open an issue describing:
- The problem you want to solve
- Your proposed solution (if you have one)
- How it relates to existing features or the V2 roadmap
Code contributions
Ready to write code? Follow the development workflow below.
Documentation
Improvements to documentation (this site) are also welcome. The documentation source lives in a separate repository.
Architecture overview
Understanding the module structure is essential before making code changes.
Project structure
adlocaite-broadsign/
package/ # The HTML5 package (deployed to Broadsign)
index.html # Main entry point + AdlocaiteApp orchestrator
js/
config.example.js # Configuration template
config.js # Local config (gitignored)
adlocaite-api.js # API client module
broadsign-adapter.js # Broadsign Player integration
vast-parser.js # VAST XML parser
player.js # Media playback engine
cache-manager.js # Asset pre-caching (V2, not yet functional)
css/
styles.css # Player styles
test/
index.html # Browser-based test interface
server.js # Local HTTP server for testing
README.md # Test documentation
build.sh # Build script (Unix)
build.bat # Build script (Windows)
release.sh # Release workflow script
package.json # Project metadata and npm scripts
Module responsibilities
Each module is a standalone JavaScript class exposed as a global (window.ClassName). There is no module bundler -- scripts are loaded via <script> tags in order.
Load order matters:
config.js-- Must load first (provideswindow.ADLOCAITE_CONFIG)adlocaite-api.js-- No dependencies beyond configbroadsign-adapter.js-- No dependencies beyond configvast-parser.js-- No dependencies beyond configplayer.js-- Depends on API client, Broadsign adapter, and VAST parsercache-manager.js-- Depends on API clientindex.htmlinline script -- Orchestrates everything (AdlocaiteApp)
Data flow
Page Load
|
v
AdlocaiteApp.initialize() --> config validation, module setup
|
v
BroadSignPlay() --> AdlocaiteApp.start()
|
v
BroadsignAdapter.getScreenId() --> frame_id extracted
|
v
AdlocaiteAPIClient.requestOfferByExternalId(frameId)
|
v
VASTParser.parse(vastXml) --> mediaFiles, trackingUrls, dealId
|
v
AdlocaitePlayer.loadAndPlay(mediaFile) --> video/image loaded + played
|
v
VAST tracking events fired (impression, quartiles, complete)
|
v
AdlocaiteAPIClient.confirmPlayout(dealId)
Key design decisions
- No build step: The package is vanilla JS so publishers can read and audit every line. This also avoids toolchain compatibility issues with older build environments.
- Global scope: Modules are exposed as globals rather than ES modules because Broadsign's Chromium version may have inconsistent module support, and the package must work without a bundler.
- Muted autoplay: Chromium 87+ blocks unmuted autoplay. All videos are set to
muted=trueto ensure reliable playback. - Graceful 404 handling: A 404 from the API (no offers) returns a structured object instead of throwing, to prevent Broadsign from interpreting HTTP errors as crashes.
Development workflow
1. Fork and clone
# Fork on GitHub, then:
git clone https://github.com/YOUR_USERNAME/adlocaite-broadsign.git
cd adlocaite-broadsign
2. Set up config
cp package/js/config.example.js package/js/config.js
# Edit config.js with your staging API key
3. Create a feature branch from dev
git checkout dev
git pull origin dev
git checkout -b feature/your-feature-name
Branch naming conventions:
feature/description-- New featuresfix/description-- Bug fixeschore/description-- Maintenance, docs, tooling
4. Make changes and test
# Start the test server
npm run test:serve
# Open test interface
# http://127.0.0.1:8000/test/
Test your changes manually through the test interface. Verify:
- Normal playback works (happy path)
- Error handling works (invalid screen, no offers)
- Console shows no unexpected errors
5. Build and verify
./build.sh
Ensure the build completes without errors and the package size is reasonable.
6. Commit and push
git add .
git commit -m "feat: description of your changes"
git push -u origin feature/your-feature-name
7. Create a pull request
Open a PR from your branch to the dev branch on the main repository.
Code standards
Language and style
- All code and comments in English
- Follow the existing code style (no linter is configured yet -- match what you see)
- Use
classsyntax for modules - Use
async/awaitfor asynchronous operations - Include JSDoc comments for public methods
Logging
Each module has log() and error() methods:
// Debug log (only shown when debugMode is true)
this.log('Message', optionalData);
// Error log (always shown)
this.error('Error message', optionalData);
Always include timestamps and the module name prefix (this is handled by the log()/error() methods).
Configuration validation
If you add a new config parameter:
- Add it to
config.example.jswith a descriptive JSDoc comment - Add validation in
AdlocaiteApp._performInitialization()if the parameter is required - Provide a sensible default value
Files to never commit
package/js/config.js-- Contains API key.envor.env.*-- Environment files*.x-html-package-- Build artifacts
Git hooks are in place to prevent accidental commits of these files.
Pull request process
PR requirements
- Target branch: Always
dev(nevermaindirectly) - Description: Explain what your change does and why
- Testing: Describe how you tested the change
- No breaking changes without discussion first
Branch protection
- Direct pushes to
mainanddevare blocked - All changes must go through pull requests
- PRs require review before merging
Review process
- Submit your PR to
dev - A maintainer will review within 5 business days
- Address any feedback with additional commits (do not force-push during review)
- Once approved, a maintainer will merge the PR
After merge
Your changes will flow through the release pipeline:
feature branch --> dev --> staging --> main (release)
Release process
Releases are managed by the maintainers using release.sh:
- All changes are merged to
devvia PRs - When ready for release,
release.shruns from thedevbranch - The script bumps the version in
package.json, creates a git tag, and builds the package - A PR is created from
devtomain - After merge, a GitHub Release is created with the tag and changelog
Version format
The project follows Semantic Versioning:
- MAJOR: Breaking changes to the configuration or behavior
- MINOR: New features, backward-compatible
- PATCH: Bug fixes, backward-compatible
Changelog
Release notes are maintained in the GitHub Releases section. When contributing, include a brief description of your change in the PR -- it will be incorporated into the release notes.