zenlive

package module
v1.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 14, 2026 License: MIT Imports: 7 Imported by: 0

README ยถ

ZenLive

Go Version License Docker Pulls

Production-ready WebRTC SFU server for live streaming and video conferencing. Built with Go, similar to LiveKit architecture.

Features

  • WebRTC SFU - Selective Forwarding Unit for efficient media streaming
  • API Key Authentication - Secure token-based room access like LiveKit
  • Multi-Protocol - RTMP, HLS, WebRTC support
  • Real-time Communication - Video calls, live streaming, screen sharing
  • Redis Integration - Horizontal scaling with distributed session management
  • Docker Ready - Deploy with Docker or Docker Compose
  • Go SDK - Build custom streaming applications

Quick Start

1. Run with Docker
# Pull image
docker pull aminofox/zenlive:latest

# Run server
docker run -d --name zenlive -p 7880:7880 -p 7881:7881 aminofox/zenlive:latest

# Health check
curl http://localhost:7880/api/health
2. Use Docker Compose
git clone https://github.com/aminofox/zenlive.git
cd zenlive
docker-compose up -d
3. Build from Source
# Clone and build
git clone https://github.com/aminofox/zenlive.git
cd zenlive
make server

# Run
./bin/zenlive-server --config config.yaml --dev

SDK Usage

Generate API Keys
package main

import (
    "context"
    "time"
    "github.com/aminofox/zenlive/pkg/auth"
)

func main() {
    ctx := context.Background()
    store := auth.NewMemoryAPIKeyStore()
    manager := auth.NewAPIKeyManager(store)
    
    expiresIn := 365 * 24 * time.Hour
    key, _ := manager.GenerateAPIKey(ctx, "My App", &expiresIn, nil)
    
    println("API Key:", key.AccessKey)
    println("Secret:", key.SecretKey)
}
Create Room Token
package main

import (
    "time"
    "github.com/aminofox/zenlive/pkg/auth"
)

func main() {
    apiKey := "your-api-key"
    secretKey := "your-secret-key"
    
    token, _ := auth.NewAccessTokenBuilder(apiKey, secretKey).
        SetIdentity("user123").
        SetName("John Doe").
        SetRoomJoin("my-room").
        SetCanPublish(true).
        SetCanSubscribe(true).
        SetValidFor(24 * time.Hour).
        Build()
    
    println("Room Token:", token)
}
Join Room
package main

import (
    "context"
    "github.com/aminofox/zenlive/pkg/logger"
    "github.com/aminofox/zenlive/pkg/room"
)

func main() {
    ctx := context.Background()
    log := logger.NewDefaultLogger(logger.InfoLevel, "text")
    
    roomMgr := room.NewRoomManager(log)
    token := "your-room-token"
    
    participant, _ := room.JoinRoomWithToken(ctx, "my-room", token, roomMgr, log)
    
    println("Joined room as:", participant.ID)
}

Configuration

Create config.yaml:

server:
  host: 0.0.0.0
  port: 7880
  signaling_port: 7881
  dev_mode: false

auth:
  jwt_secret: "your-secret-key"
  default_api_key: ""
  default_secret_key: ""

redis:
  enabled: false
  address: "localhost:6379"
  password: ""
  db: 0

webrtc:
  stun_servers:
    - "stun:stun.l.google.com:19302"

Environment variables:

ZENLIVE_HOST=0.0.0.0
ZENLIVE_PORT=7880
JWT_SECRET=your-secret
REDIS_URL=redis:6379
REDIS_PASSWORD=

Docker Deployment

Standalone
docker run -d \
  --name zenlive \
  -p 7880:7880 \
  -p 7881:7881 \
  -e JWT_SECRET=my-secret \
  aminofox/zenlive:latest
With Redis
version: '3.8'
services:
  zenlive:
    image: aminofox/zenlive:latest
    ports:
      - "7880:7880"
      - "7881:7881"
    environment:
      - JWT_SECRET=${JWT_SECRET}
      - REDIS_URL=redis:6379
    depends_on:
      - redis
  
  redis:
    image: redis:7-alpine
    ports:
      - "6379:6379"
Custom Config
docker run -d \
  -v $(pwd)/config.yaml:/app/config.yaml \
  -p 7880:7880 \
  aminofox/zenlive:latest \
  --config /app/config.yaml

Development

Build
# Build SDK packages
make build

# Build server binary
make server

# Build Docker image
make docker

# Run tests
make test
Examples
# API key generation
go run examples/apikey/main.go

# Room authentication
go run examples/room-auth/main.go

# Video call with media
go run examples/video-call-media/main.go
Project Structure
zenlive/
โ”œโ”€โ”€ cmd/
โ”‚   โ””โ”€โ”€ zenlive-server/      # Server binary
โ”œโ”€โ”€ pkg/
โ”‚   โ”œโ”€โ”€ api/                 # REST API server
โ”‚   โ”œโ”€โ”€ auth/                # Authentication & tokens
โ”‚   โ”œโ”€โ”€ room/                # Room management
โ”‚   โ”œโ”€โ”€ streaming/           # WebRTC, HLS, RTMP
โ”‚   โ”œโ”€โ”€ storage/             # Recording & storage
โ”‚   โ””โ”€โ”€ ...
โ”œโ”€โ”€ examples/                # SDK examples
โ”œโ”€โ”€ docs/                    # Documentation
โ””โ”€โ”€ config.yaml              # Configuration

Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”         โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”         โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  Client App  โ”‚         โ”‚  ZenLive Server  โ”‚         โ”‚  Redis  โ”‚
โ”‚  (Go SDK)    โ”‚โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ถโ”‚  (Docker)        โ”‚โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ถโ”‚ (Cache) โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  Token  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜         โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                  โ”‚
                                  โ–ผ
                         โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                         โ”‚  WebRTC SFU    โ”‚
                         โ”‚ (Media Stream) โ”‚
                         โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Components:

  • API Server (port 7880) - HTTP REST API for room management
  • WebRTC Signaling (port 7881) - WebSocket for WebRTC negotiation
  • Room Manager - Handles video call rooms and participants
  • API Key Manager - Authentication with API key/secret pairs
  • Redis (optional) - Session management for horizontal scaling

API Endpoints

  • GET /api/health - Health check
  • POST /api/keys - Generate API key pair
  • GET /api/rooms - List rooms
  • POST /api/tokens - Generate room token (via SDK)

Comparison with LiveKit

Feature ZenLive LiveKit
WebRTC SFU โœ… โœ…
API Key Auth โœ… โœ…
Token-based Access โœ… โœ…
Docker Deployment โœ… โœ…
Redis Scaling โœ… โœ…
Architecture Monorepo Separate repos
Go SDK Same repo livekit-go
JS/Mobile SDKs Planned โœ…

Note: ZenLive uses a monorepo approach (server + SDK together) for faster development. Can be split into separate repos like LiveKit in the future.


Production Deployment

Security Checklist
  • Change jwt_secret in production
  • Generate unique API keys (don't use defaults)
  • Enable HTTPS/TLS for API endpoint
  • Enable WSS for WebSocket signaling
  • Configure TURN servers for NAT traversal
  • Set up firewall rules (ports 7880, 7881)
  • Enable Redis authentication
  • Use environment variables for secrets
Monitoring

Prometheus metrics at http://localhost:9090/metrics:

  • Active rooms count
  • Participant count
  • WebRTC tracks
  • API request rate

Publishing Docker Image

# Login
docker login

# Build and tag
make docker

# Push to Docker Hub
make docker-push

# Users can pull
docker pull aminofox/zenlive:latest

Contributing

See docs/CONTRIBUTING.md for development guidelines.


License

MIT License - see LICENSE


Support

โœจ Features

Streaming Protocols
  • RTMP - Ingest from OBS, FFmpeg, Streamlabs
  • HLS - Deliver to web/mobile with adaptive bitrate
  • WebRTC - Ultra-low latency (<1s) for video calls
Additional Features
  • Real-time Chat - WebSocket chat with moderation
  • Recording - Save to local storage or S3
  • Analytics - Real-time metrics & Prometheus export
  • Authentication - JWT & role-based access control
  • Scalable - Horizontal scaling with Redis

๐Ÿ“ฆ Use Cases

Use Case Protocols Config
Live Streaming Platform RTMP + HLS Example
Video Call (1-1) WebRTC Example
Video Conference WebRTC + Chat Example
Recording Server RTMP + HLS + Storage Example

๐ŸŽฏ SDK Philosophy

ZenLive focuses on REAL-TIME DELIVERY - not data persistence.

โœ… SDK Does:

  • Real-time streaming (RTMP, HLS, WebRTC)
  • Real-time chat delivery
  • Session management
  • Recording to local/S3

โŒ SDK Does NOT:

  • Database persistence (you handle this)
  • Chat history storage (you save to your DB)
  • User account management (your responsibility)

๐Ÿ’ก Your Responsibility: The SDK delivers real-time. YOU decide what to save to YOUR database.

๐Ÿ“š Documentation

๐Ÿ’ป Examples

# Basic streaming server
cd examples/basic && go run main.go

# With authentication
cd examples/auth && go run main.go

# WebRTC video call
cd examples/webrtc && go run main.go

# With chat
cd examples/chat && go run main.go

# With recording
cd examples/storage && go run main.go

See examples/ for all 11+ examples.

๐Ÿ”ง Configuration

Simple (Development)
cfg := config.DefaultConfig()
cfg.Streaming.EnableRTMP = true
cfg.Streaming.EnableHLS = true
With Chat
cfg.Chat.Enabled = true

// Save chat to YOUR database
chatServer.OnMessage(func(msg *chat.Message) {
    myDB.SaveMessage(msg) // Your code
})
Production
cfg := config.DefaultConfig()
cfg.Auth.JWTSecret = os.Getenv("JWT_SECRET")
cfg.Storage.Type = "s3"
cfg.Analytics.Enabled = true
Multi-Server (Cluster)
cfg.Cluster.Enabled = true
cfg.Redis.Enabled = true // Required for cluster

๐Ÿ—๏ธ Architecture

Publishers (OBS/FFmpeg)
    โ†“ RTMP
ZenLive SDK
    โ”œโ”€โ”€ RTMP Server
    โ”œโ”€โ”€ HLS Server
    โ”œโ”€โ”€ WebRTC Server
    โ”œโ”€โ”€ Chat Server
    โ””โ”€โ”€ Storage
    โ†“
Viewers (Web/Mobile)

See ARCHITECTURE.md for details.

๐Ÿ“Š Performance

Metric Single Server Cluster (3 nodes)
Concurrent Streams ~1,000 ~10,000+
Concurrent Viewers ~10,000 ~100,000+
Latency (HLS) 10-30s 10-30s
Latency (WebRTC) <1s <1s

๐Ÿ” Security

  • JWT authentication
  • Role-based access control (RBAC)
  • TLS/HTTPS encryption
  • Rate limiting
  • Stream key rotation
  • Audit logging

๐Ÿค Contributing

Contributions are welcome! Please read our Contributing Guide.

๐Ÿ“„ License

MIT License - see LICENSE file.

๐Ÿ†˜ Support

๐ŸŒŸ Star Us!

If you find ZenLive useful, please give us a star! โญ


Made with โค๏ธ by the ZenLive Team

  • Viewer analytics and session tracking
  • Prometheus metrics export
  • Health check endpoints
  • Performance monitoring
  • Config: Set Analytics.Enabled = false to disable
๐ŸŽจ Interactive Features (Optional)
  • Live polling (single/multiple choice)
  • Virtual gifts and currency system
  • Real-time reactions and emojis
  • Co-streaming support
โšก Scalability (Optional - for distributed deployments)
  • Horizontal scaling with load balancing
  • Distributed session management (requires Redis)
  • Service discovery
  • CDN integration
  • Config: Set Cluster.Enabled = true and Redis.Enabled = true to enable

๐ŸŽฏ Use Cases

โœ… Perfect For
  • Livestreaming Platforms (Twitch-like, YouTube Live)

    • RTMP ingestion from OBS/StreamLabs
    • HLS playback for viewers
    • Real-time chat and interactions
  • Video Conferencing (Zoom-like, Google Meet)

    • WebRTC peer-to-peer connections
    • Low latency (<500ms)
    • Optional recording
  • Audio Calling (Discord-like voice channels)

    • WebRTC audio-only streams
    • Group voice channels
  • Hybrid Platforms

    • Combine streaming + video calls
    • Switch between protocols dynamically
โš™๏ธ Flexible Configuration

Simple Single-Server Livestream:

cfg := config.DefaultConfig()
cfg.Streaming.EnableRTMP = true
cfg.Streaming.EnableHLS = true
cfg.Chat.Enabled = true
cfg.Analytics.Enabled = false  // Disable analytics
cfg.Cluster.Enabled = false    // Single server

Video Call Only:

cfg := config.DefaultConfig()
cfg.Streaming.EnableRTMP = false
cfg.Streaming.EnableHLS = false
cfg.Streaming.EnableWebRTC = true
cfg.Chat.Enabled = false       // Not needed for 1-1 calls

Production Multi-Server:

cfg := config.DefaultConfig()
cfg.Cluster.Enabled = true
cfg.Redis.Enabled = true       // For distributed sessions
cfg.Analytics.Enabled = true
cfg.Storage.Type = "s3"

๐Ÿ“– See examples/config/ for complete configuration examples.

๐Ÿ“š Documentation

๐Ÿ’ก Usage Examples

RTMP Streaming Server
package main

import (
    "github.com/aminofox/zenlive/pkg/logger"
    "github.com/aminofox/zenlive/pkg/streaming/rtmp"
)

func main() {
    log := logger.NewDefaultLogger(logger.InfoLevel, "text")
    
    server := rtmp.NewServer(":1935", log)
    
    server.SetOnPublish(func(streamKey string, metadata map[string]interface{}) error {
        log.Info("Stream started", logger.String("key", streamKey))
        return nil
    })
    
    server.Start()
}

Publish with OBS: rtmp://localhost:1935/live/your-stream-key

WebRTC Low-Latency Streaming
package main

import (
    "github.com/aminofox/zenlive/pkg/logger"
    "github.com/aminofox/zenlive/pkg/streaming/webrtc"
)

func main() {
    log := logger.NewDefaultLogger(logger.InfoLevel, "json")
    
    sfuConfig := webrtc.DefaultSFUConfig()
    sfu, _ := webrtc.NewSFU(sfuConfig, log)
    
    signalingConfig := webrtc.DefaultSignalingServerConfig()
    signalingConfig.Address = ":8081"
    
    server, _ := webrtc.NewSignalingServer(signalingConfig, sfu, log)
    server.Start()
}
Stream Management
package main

import (
    "context"
    "github.com/aminofox/zenlive/pkg/sdk"
    "github.com/aminofox/zenlive/pkg/logger"
)

func main() {
    log := logger.NewDefaultLogger(logger.InfoLevel, "text")
    manager := sdk.NewStreamManager(log)
    ctx := context.Background()
    
    // Create a stream
    stream, _ := manager.CreateStream(ctx, &sdk.CreateStreamRequest{
        UserID:      "user-123",
        Title:       "My Gaming Stream",
        Description: "Playing Minecraft",
        Protocol:    sdk.ProtocolRTMP,
    })
    
    // Start stream
    controller := sdk.NewStreamController(manager, nil, log)
    controller.StartStream(ctx, stream.ID)
    
    // Get popular streams
    popular, _ := manager.GetPopularStreams(ctx, 10)
}
Real-time Chat
package main

import (
    "github.com/aminofox/zenlive/pkg/chat"
    "github.com/aminofox/zenlive/pkg/logger"
)

func main() {
    log := logger.NewDefaultLogger(logger.InfoLevel, "text")
    
    // SDK only handles real-time delivery
    // Users handle their own message persistence
    server := chat.NewServer(chat.DefaultServerConfig(), log)
    
    // Create chat room for stream
    room, _ := server.CreateRoom(ctx, "stream-123", "My Stream Chat")
    
    // Setup WebSocket endpoint
    http.HandleFunc("/ws", server.HandleWebSocket)
    http.ListenAndServe(":8080", nil)
}

More examples in examples/ directory (11 complete examples)

๐Ÿ—๏ธ Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚           Your Application              โ”‚
โ”‚   (import github.com/aminofox/zenlive)  โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                โ”‚
       โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
       โ”‚   ZenLive SDK   โ”‚
       โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                โ”‚
    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
    โ”‚                       โ”‚
โ”Œโ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”          โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚Streamingโ”‚          โ”‚   Features  โ”‚
โ”‚Protocolsโ”‚          โ”‚             โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค          โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ RTMP   โ”‚          โ”‚ Chat        โ”‚
โ”‚ HLS    โ”‚          โ”‚ Recording   โ”‚
โ”‚ WebRTC โ”‚          โ”‚ Analytics   โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜          โ”‚ Auth        โ”‚
                    โ”‚ Security    โ”‚
                    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

ZenLive is a library/SDK - you import it into your Go application. It's not a standalone service.

๐Ÿงช Testing

# Run all tests
go test ./...

# Run with coverage
go test -cover ./...

# Run specific package tests
go test ./pkg/streaming/rtmp/...

# Run benchmarks
go test -bench=. ./tests/performance/...

Test Coverage: 85%+ across all packages

๐Ÿ“ˆ Performance

  • RTMP: 1000+ concurrent publishers
  • HLS: 10,000+ concurrent viewers per node
  • WebRTC: Sub-second latency (200-500ms)
  • Chat: 10,000+ messages/second per room
  • Horizontal Scaling: Tested up to 10 nodes

๐Ÿ› ๏ธ Development

# Clone repository
git clone https://github.com/aminofox/zenlive.git
cd zenlive

# Install dependencies
go mod download

# Run tests
go test ./...

# Build examples
go build -o bin/basic ./examples/basic

๐Ÿ“‹ Requirements

  • Go: 1.24.0 or later
  • Optional: Redis (for distributed sessions), S3-compatible storage (for cloud recording)

๐Ÿ—บ๏ธ Roadmap

โœ… v1.0.0 (Current - January 2026)
  • Multi-protocol streaming (RTMP, HLS, WebRTC)
  • Real-time chat
  • Recording & storage
  • Authentication & security
  • Analytics & monitoring
  • Interactive features
๐Ÿ”ฎ Future Versions
  • v1.1.0: Enhanced WebRTC (simulcast, SVC)
  • v1.2.0: AI-powered analytics and insights
  • v1.3.0: Multi-region deployment
  • v2.0.0: GraphQL API, gRPC support

๐Ÿค Contributing

Contributions are welcome! Please see CONTRIBUTING.md for guidelines.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ’ฌ Community & Support

๐Ÿ™ Acknowledgments

Built with โค๏ธ for the livestreaming community.

Special thanks to:


Current Version: v1.0.0
Release Date: January 11, 2026
Status: โœ… Production Ready

Get Started: go get github.com/aminofox/zenlive@v1.0.0

Documentation ยถ

Index ยถ

Constants ยถ

This section is empty.

Variables ยถ

This section is empty.

Functions ยถ

This section is empty.

Types ยถ

type SDK ยถ

type SDK struct {
	// contains filtered or unexported fields
}

SDK is the main ZenLive SDK instance

func New ยถ

func New(cfg *config.Config) (*SDK, error)

New creates a new ZenLive SDK instance

func (*SDK) Config ยถ

func (s *SDK) Config() *config.Config

Config returns the SDK configuration

func (*SDK) CreateRoom ยถ added in v1.0.1

func (s *SDK) CreateRoom(name string, opts *room.CreateRoomRequest) (*room.Room, error)

CreateRoom creates a new room with the given name and options

func (*SDK) DeleteRoom ยถ added in v1.0.1

func (s *SDK) DeleteRoom(roomID string) error

DeleteRoom deletes a room by ID

func (*SDK) GetProvider ยถ

func (s *SDK) GetProvider(protocol types.StreamProtocol) (types.StreamProvider, error)

GetProvider returns a registered streaming provider

func (*SDK) GetRoom ยถ added in v1.0.1

func (s *SDK) GetRoom(roomID string) (*room.Room, error)

GetRoom retrieves a room by ID

func (*SDK) GetRoomManager ยถ added in v1.0.1

func (s *SDK) GetRoomManager() *room.RoomManager

GetRoomManager returns the room manager instance

func (*SDK) IsRunning ยถ

func (s *SDK) IsRunning() bool

IsRunning returns true if the SDK is currently running

func (*SDK) ListRooms ยถ added in v1.0.1

func (s *SDK) ListRooms() []*room.Room

ListRooms returns all active rooms

func (*SDK) Logger ยถ

func (s *SDK) Logger() logger.Logger

Logger returns the SDK logger

func (*SDK) OnMetadataUpdated ยถ added in v1.0.1

func (s *SDK) OnMetadataUpdated(callback func(roomID string, metadata map[string]interface{}))

OnMetadataUpdated registers a callback for metadata update events

func (*SDK) OnParticipantJoined ยถ added in v1.0.1

func (s *SDK) OnParticipantJoined(callback func(roomID string, participant *room.Participant))

OnParticipantJoined registers a callback for participant join events

func (*SDK) OnParticipantLeft ยถ added in v1.0.1

func (s *SDK) OnParticipantLeft(callback func(roomID string, participantID string))

OnParticipantLeft registers a callback for participant leave events

func (*SDK) OnRoomCreated ยถ added in v1.0.1

func (s *SDK) OnRoomCreated(callback func(*room.Room))

OnRoomCreated registers a callback for room creation events

func (*SDK) OnRoomDeleted ยถ added in v1.0.1

func (s *SDK) OnRoomDeleted(callback func(roomID string))

OnRoomDeleted registers a callback for room deletion events

func (*SDK) OnTrackPublished ยถ added in v1.0.1

func (s *SDK) OnTrackPublished(callback func(roomID string, track *room.MediaTrack))

OnTrackPublished registers a callback for track publication events

func (*SDK) OnTrackUnpublished ยถ added in v1.0.1

func (s *SDK) OnTrackUnpublished(callback func(roomID string, trackID string))

OnTrackUnpublished registers a callback for track unpublication events

func (*SDK) RegisterProvider ยถ

func (s *SDK) RegisterProvider(protocol types.StreamProtocol, provider types.StreamProvider) error

RegisterProvider registers a streaming protocol provider

func (*SDK) SetLogger ยถ

func (s *SDK) SetLogger(log logger.Logger)

SetLogger sets a custom logger

func (*SDK) Start ยถ

func (s *SDK) Start() error

Start starts the SDK and all enabled streaming providers

func (*SDK) Stop ยถ

func (s *SDK) Stop() error

Stop stops the SDK and all streaming providers

func (*SDK) Version ยถ

func (s *SDK) Version() string

Version returns the SDK version

Directories ยถ

Path Synopsis
cmd
zenlive-server command
examples
api command
apikey command
auth command
basic command
hls command
room command
Package main demonstrates multi-participant video conferencing with WebRTC integration
Package main demonstrates multi-participant video conferencing with WebRTC integration
room-auth command
rooms command
rtmp command
sdk command
security command
storage command
video-call-media command
Package main demonstrates a complete video call scenario with media publishing and subscribing
Package main demonstrates a complete video call scenario with media publishing and subscribing
webrtc command
Package main provides a WebRTC streaming example using ZenLive SDK.
Package main provides a WebRTC streaming example using ZenLive SDK.
websocket command
pkg
api
Package api provides middleware for authentication and rate limiting
Package api provides middleware for authentication and rate limiting
room
Package room provides automatic reconnection handling for participants
Package room provides automatic reconnection handling for participants
sdk
streaming/hls
Package hls implements adaptive bitrate (ABR) streaming
Package hls implements adaptive bitrate (ABR) streaming
streaming/webrtc
Package webrtc provides bandwidth estimation and congestion control for WebRTC.
Package webrtc provides bandwidth estimation and congestion control for WebRTC.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL