Full Example AvailableThe complete working implementation is available on GitHub: RhombusSystems/player-example
Overview
The Rhombus video player integration enables you to:Stream Live Video
Display real-time camera feeds with adaptive bitrate streaming
Secure Authentication
Use federated session tokens for time-limited, secure access
Optimized Playback
Pre-configured settings optimized for security camera footage
Easy Integration
Drop-in solution with minimal configuration required
Architecture
The video player implementation follows a three-tier architecture:1
Frontend Requests Token
Your web application requests authentication from your backend server
2
Backend Proxies to Rhombus
Your server authenticates with Rhombus API using your API key and returns a federated token
3
Frontend Gets Media URI
Using the token, your frontend requests the camera’s streaming URI
4
Direct Stream Playback
DashJS player connects directly to Rhombus CDN using the authenticated URI
Prerequisites
Before implementing the video player, ensure you have:Rhombus API Credentials
Rhombus API Credentials
Generate an API key from your Rhombus Console. This key will be used by your backend server to authenticate with the Rhombus API.
Camera UUID
Camera UUID
Obtain your camera’s UUID from the Rhombus Console or via the API:
Backend Server
Backend Server
Set up a proxy server to handle API authentication. Your server must implement two endpoints:
- Token generation endpoint (forwards to
/org/generateFederatedSessionToken) - Media URI endpoint (forwards to
/camera/getMediaUris)
Implementation Guide
Step 1: Set Up Your HTML Page
Create a basic HTML structure with the DashJS player:index.html
Step 2: Configure Player Settings
Create your player configuration file:player.js
Step 3: Implement Authentication
Add token management functionality:Token Management
Step 4: Get Media Stream URI
Implement media URI retrieval:Media URI Request
Step 5: Initialize DashJS Player
Set up the video player with optimized settings:Player Initialization
Step 6: Add Playback Controls
Implement play/pause functionality:Playback Controls
Backend Server Implementation
Your backend server must proxy requests to the Rhombus API. Here’s an example using Node.js/Express:- Node.js/Express
- Python/Flask
server.js
Player Configuration Options
The DashJS player can be customized with various settings optimized for different use cases:boolean
default:"true"
Enable automatic catch-up to live edge when playback falls behind
number
default:"10"
Maximum allowed drift from live edge in seconds before catch-up kicks in
number
default:"12"
Target buffer size for stable playback in seconds
boolean
default:"false"
Disable fast quality switching to maintain consistent video quality
boolean
default:"true"
Automatically skip small gaps in the stream
number
default:"0.5"
Time in seconds before considering playback stalled
Security Best Practices
Never Expose API Keys
Never Expose API Keys
- Store API keys only on your backend server
- Use environment variables for sensitive credentials
- Never commit API keys to version control
- Rotate keys regularly
Implement Access Controls
Implement Access Controls
- Authenticate users before granting stream access
- Implement rate limiting on your proxy endpoints
- Log all access requests for audit trails
- Use short-lived federated tokens (24 hours or less)
Validate All Requests
Validate All Requests
- Sanitize camera UUID inputs
- Validate token expiration
- Check user permissions before proxying requests
- Implement CSRF protection
Use HTTPS Everywhere
Use HTTPS Everywhere
- Enforce HTTPS for all communications
- Implement proper SSL/TLS certificates
- Enable HSTS headers
- Validate certificate chains
Troubleshooting
Video Not Loading
Video Not Loading
Check these common issues:
- Verify your backend server is running and accessible
- Confirm camera UUID is correct (check Rhombus Console)
- Check browser console for error messages
- Verify API key has proper permissions
- Ensure CORS is properly configured on your server
Playback Issues
Playback Issues
Buffering or stuttering:
- Reduce
bufferTimeAtTopQualityfor faster startup - Increase
stableBufferTimefor smoother playback - Check network bandwidth and latency
- Verify CDN connectivity
- Check token expiration (default 24 hours)
- Verify continuous network connectivity
- Review firewall rules for CDN access
- Check browser console for errors
Authentication Errors
Authentication Errors
Token generation fails:
- Verify API key is valid and not expired
- Check API key permissions in Rhombus Console
- Ensure headers are correctly formatted
- Verify account is active
- Check token expiration time
- Verify URL parameters are properly appended
- Ensure token is correctly passed to all requests
- Check for special characters in token
Advanced Features
Multi-Camera Grid
Display multiple camera feeds simultaneously:Multi-Camera Setup
Custom Controls
Build custom video controls:Custom Controls
Next Steps
GitHub Example
Clone the complete working example
DashJS Documentation
Learn more about DashJS configuration
Get Support
Join the developer community for help
Support
Need help with your implementation?- Email: support@rhombus.com
- Community: rhombus.community
This implementation guide is based on the official Rhombus player example and is regularly updated to reflect best practices.