dreamersdesire/laravel-live-streaming
Composer 安装命令:
composer require dreamersdesire/laravel-live-streaming
包简介
A Laravel package for live streaming using WebRTC and Socket.io.
README 文档
README
A robust, one-to-many live streaming application built with Laravel, featuring WebRTC and Socket.io for real-time broadcast streaming to multiple viewers.
Installation
Install Package
composer require dreamersdesire/laravel-live-streaming:dev-main
Publish vendor
php artisan vendor:publish --tag=live-streaming --force
Add Necessary Routes (web.php)
Route::get('/stream', [StreamController::class, 'createStream'])->name('stream.create');
Route::get('/stream/screenshare', [StreamController::class, 'createScreenShareStream'])->name('stream.screenshare.create');
Route::get('/stream/{stream_id}', [StreamController::class, 'watchStream'])->name('stream.watch');
Install npm dependencies
npm install socket.io
npm install webrtc-adapter
npm install wrtc
Usage
Run Laravel Server
Run your laravel server at port 8000 (default)
php artisan serve
Run node server
Run node server (server.js). It will automatically run from 6001 port
node server.js
Additional Config (Optional)
If you'd like to share your local project over your network, then change socket url from .env file.
For LAN, replace with your ip and socket port must be 6001
APP_SOCKET_URL=http://192.168.x.x:6001
That's it. now in browser, open laravel application and see what happens.
Features
-
Streaming:
- Broadcast live video to multiple viewers with low latency, ensuring a smooth and engaging experience for audiences.
-
Screen Sharing:
- Share your screen in real-time during broadcasts, making it ideal for presentations, tutorials, or collaborative work.
-
Stream Record & Download:
- Record live streams as they happen and provide download options, allowing streamers & viewers to access sessions on demand.
- Stream will be automatically record while streamer start broadcast.
-
Video on/off:
- Enable or disable video during the stream, allowing flexibility for streamers who may need to switch between video and audio-only modes.
-
Mic on/off:
- Toggle the microphone on or off as needed during the stream, providing control over audio input for smoother communication.
Author
License
🤓 About Me
I'm a web developer with a focus on Laravel. My expertise lies in developing robust web applications, and I've actively contributed to various PHP-Laravel projects in the past. With a passion for problem-solving and a keen interest in crafting elegant solutions, I enjoy the challenges that web development brings.
If you're interested in connecting, discussing web development, or exploring potential collaborations, feel free to reach out. I'm open to new opportunities and always excited about creating innovative projects.
Let's build something amazing together!
Support
If you have any feedback, please reach out to me at jsjahidmini@gmail.com
Screenshots
Stream page with screen sharing
Viewer page
dreamersdesire/laravel-live-streaming 适用场景与选型建议
dreamersdesire/laravel-live-streaming 是一款 基于 Blade 开发的 Composer 扩展包,目前已累计 21 次下载、GitHub Stars 达 6, 最近一次更新时间为 2024 年 11 月 09 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 dreamersdesire/laravel-live-streaming 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 dreamersdesire/laravel-live-streaming 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 21
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 6
- 点击次数: 15
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-11-09