How Streaming Works
1
Connection Establishment
Your client establishes a WebRTC peer-to-peer connection using the session token
2
Media Stream Setup
Anam begins streaming the persona’s video feed to your specified video element
3
Bidirectional Communication
Your application can send messages while receiving real-time video and audio responses
4
Synchronized Output
The persona’s speech is automatically synchronized with lip movements and facial expressions
Stream Architecture
Understanding the streaming architecture helps you optimize performance and handle edge cases:Basic Streaming Setup
Simple Video Streaming
The most basic streaming setup connects a persona to a video element:Advanced Streaming Configuration
For more control over the streaming experience:Stream Quality Management
Adaptive Quality
Anam automatically adjusts stream quality based on network conditions, but you can also control it manually:Quality Settings
Ultra Quality
1080p, 60fps - Best visual quality for high-end applications
High Quality
720p, 30fps - Great balance of quality and performance
Medium Quality
480p, 30fps - Good quality with lower bandwidth usage
Low Quality
360p, 24fps - Optimized for poor network conditions
Audio Management
Audio Controls
Handle audio playback and user interactions:Performance Optimization
Connection Optimization
Optimize streaming performance for different scenarios:Bandwidth Management
- Low Bandwidth
- High Bandwidth
- Variable Network
Handling Stream Events
Connection Lifecycle
Monitor and respond to streaming events:Common Streaming Issues
Video Not Appearing
Video Not Appearing
Symptoms: Black screen or no video element contentCommon Causes & Solutions:
- Missing autoplay attribute: Add
autoplayto video element - Browser autoplay policy: Require user interaction before streaming
- Invalid session token: Check token creation and expiration
- Network connectivity: Verify internet connection and firewall settings
Audio Not Playing
Audio Not Playing
Symptoms: Video appears but no soundCommon Causes & Solutions:
- Browser autoplay policy: Audio requires user interaction
- Muted by default: Browsers often start videos muted
- Audio permissions: Check browser audio permissions
- Volume settings: Verify system and application volume
Poor Video Quality
Poor Video Quality
Symptoms: Pixelated, blurry, or low-resolution videoCommon Causes & Solutions:
- Bandwidth limitations: Stream quality auto-reduced
- Device performance: Lower quality for mobile/older devices
- Network congestion: Temporary quality reduction
- Manual quality setting: Check if quality is manually set to low
High Latency / Lag
High Latency / Lag
Symptoms: Delayed responses, out-of-sync audio/videoCommon Causes & Solutions:
- Network latency: Check internet connection speed
- Server distance: Use CDN or edge servers
- Device performance: Reduce quality on lower-end devices
- Browser optimization: Use hardware acceleration when available
Browser Compatibility
Supported Browsers
Chrome/Edge
Full Support - Best performance and feature compatibility
Firefox
Full Support - Excellent WebRTC implementation
Safari
Partial Support - Some limitations on iOS, works well on macOS
Mobile Browsers
Good Support - Optimized quality and features for mobile

