towoju/one2one-calls 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

towoju/one2one-calls

最新稳定版本:v0.1.0

Composer 安装命令:

composer require towoju/one2one-calls

包简介

One-on-one video/audio call scaffolding for Laravel (WebRTC signaling + permissions + events).

README 文档

README

One-on-one audio/video call scaffolding for Laravel apps. Handles permissions, signaling events, availability, and ships a minimal Blade UI + JS stub using WebRTC and Laravel Echo.

Streams are peer-to-peer via WebRTC. Laravel handles auth, permissions, and event signaling.

Features

  • Toggle who can initiate calls (Super Admin only).
  • All users can receive calls by default.
  • Events: Incoming, Accepted, Declined, Ended, Availability.
  • Private broadcast channels: calls.user.{id}
  • Minimal floating window UI with mic/video/switch camera buttons.
  • Availability status via cache.
  • API endpoints secured with auth:sanctum (adjust as needed).

Install

composer require towoju/one2one-calls
php artisan vendor:publish --tag=one2one-calls-config
php artisan vendor:publish --tag=one2one-calls-migrations
php artisan migrate
php artisan vendor:publish --tag=one2one-calls-assets

Ensure broadcasting is configured (Pusher or laravel-websockets).

Add a meta tag for the authenticated user ID on pages that use the call UI:

<meta name="user-id" content="{{ auth()->id() }}">

Include Echo and the package JS (after configuring Echo):

<script src="https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js"></script>
<script src="{{ mix('js/app.js') }}"></script> {{-- Echo config in your app --}}
<script src="{{ asset('js/vendor/one2one-calls/call.js') }}"></script>

Use the Blade call view somewhere (optional):

@include('one2one-calls::call')

Super Admin permission UI:

GET  /one2one/permissions
PATCH /one2one/permissions/{user}

API (default auth:sanctum):

POST /api/one2one/availability { available: true|false }
GET  /api/one2one/availability/{userId}
POST /api/one2one/calls { receiver_id, metadata? }
POST /api/one2one/calls/{uuid}/accept
POST /api/one2one/calls/{uuid}/decline
POST /api/one2one/calls/{uuid}/end

Notes

  • Replace or extend the JS to exchange SDP/ICE over Echo events for a full WebRTC flow.
  • To lock Super Admin by role, set super_admin_role in config/one2one-calls.php. Fallback boolean column is_super_admin is also supported.
  • Middleware EnsureCanInitiateCall blocks unauthorized call attempts.
  • Presence and push notifications can be added on top of this scaffold.

License

MIT © Emmanuel A Towoju

统计信息

  • 总下载量: 5
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-08-15