Download the PHP package weblivehub/sdk without Composer
On this page you can find all versions of the php package weblivehub/sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download weblivehub/sdk
More information about weblivehub/sdk
Files in weblivehub/sdk
Package sdk
Short Description WebLiveHub PHP SDK v1.0.4 (Composer version)
License MIT
Informations about the package sdk
WebLiveHub PHP SDK
Official PHP SDK for WebLiveHub - A powerful WebRTC live streaming and video-on-demand platform.
📋 Table of Contents
- Features
- Requirements
- Installation
- Quick Start
- Usage Examples
- Immediate Iframe Embed
- Lazy-Loading Iframe
- Custom Attributes & Events
- Security Considerations
- Support
✨ Features
- 🚀 Simple Integration: One-line setup with Composer
- 🔐 Secure Authentication: Built-in credential management and token handling
- ⚡ Multiple Embed Modes: Immediate and lazy-loading iframe support
- 🎨 Customizable: Flexible attributes
- 🌐 CDN Support: Configurable CDN endpoints for optimal performance
- 📱 Responsive: Works seamlessly across devices
- 🔄 Auto-Retry: Built-in error handling and fallback mechanisms
- 🏢 Hosted Backend Support: Automatic slug detection for managed deployments
📦 Requirements
- PHP 7.4 or higher
- cURL extension (recommended) or
allow_url_fopenenabled - Valid WebLiveHub account with Hosted Backend credentials
🔧 Installation
Install via Composer:
Or add to your composer.json:
Then run:
🚀 Quick Start
Step 1: Create a Hosted Backend
- Log in to your WebLiveHub Console
- Navigate to Hosted Backends → Create Backend
- Copy your Hosted Backend Endpoint (e.g.,
https://console.weblivehub.com/WL_HOST/{slug}/wl_api/backend.php)
Step 2: Basic Setup
⚙️ Configuration
Basic Configuration
📚 Usage Examples
1. Immediate Iframe Embed
Fetches a stream token immediately on the server-side and embeds the iframe:
2. Lazy-Loading Iframe
Client-side token fetching for dynamic multi-stream pages:
Benefits of Lazy-Loading:
- Reduces initial server load
- Faster page rendering
- Tokens fetched only when needed
- Ideal for multi-stream galleries
3. Custom Attributes & Events
Add custom HTML attributes and JavaScript event handlers:
WLSDK::setup(array $config): bool
Initialize SDK configuration.
Parameters:
$config(array): Configuration arrayhb_endpoint(string, required): Hosted Backend endpoint URLuser_id(string, required): User ID for authenticationpassword(string, required): User passwordauthToken(string, optional): Pre-fetched auth token
Returns: bool - Always returns true
Example:
WLSDK::script(): string
Generate the <script> tag to load the embed.js library.
Returns: string - HTML script tag
Example:
Note: Call this once per page, typically in the <head> or before any iframe embeds.
WLSDK::iframe(array $opts): string
Generate an immediate iframe embed (server-side token fetch).
Parameters:
$opts(array): Embed optionshostLabel(string, required): Role identifier (e.g.,'live','live-client','connect')streamer(string, required): Streamer's user IDid(string, optional): DOM element ID (auto-generated if not provided)attrs(array, optional): Custom HTML attributes
Returns: string - HTML output (<wl-stream> element + optional event script)
Example:
WLSDK::lazyIframe(array $opts): string
Generate a lazy-loading iframe embed (client-side token fetch).
Parameters:
$opts(array): Embed optionshostLabel(string, required): Role identifierstreamer(string, required): Streamer's user IDauthToken(string, optional): Override auth tokenhb_endpoint(string, optional): Override hosted backend endpointattrs(array, optional): Custom HTML attributes
Returns: string - HTML output (<wl-stream-lazy> element)
Example:
Custom CSS Styling
🔒 Security Considerations
⚠️ Never Expose Credentials in Frontend
🎯 Host Labels Guide
| Label | Role | Description |
|---|---|---|
live |
Streamer | Broadcaster interface with streaming controls |
live-client |
Viewer | Audience view without streaming capabilities |
connect |
Test/Demo | General-purpose testing interface |
Note: Backend configuration determines available roles and permissions for each label.
🤝 Support
- Email: [email protected]
- Issues: GitHub Issues
🔄 Changelog
v1.0.2
- Hosted Backend slug detection
- Versioned asset path support with fallback
- Enhanced error handling
- Improved CDN configuration
v1.0.3
Updated hostLabel links
v1.0.4 (Current)
Added event listeners for WLSDK::iframe and WLSDK::lazyIframe
Made with ❤️ by WebLiveHub