<?php

namespace App\Events;

use Illuminate\Broadcasting\Channel;
use Illuminate\Queue\SerializesModels;
use Illuminate\Broadcasting\PresenceChannel;
use Illuminate\Foundation\Events\Dispatchable;
use Illuminate\Broadcasting\InteractsWithSockets;
use Illuminate\Broadcasting\PrivateChannel;
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;

class DeviceCurrentStatus implements ShouldBroadcast
{
    use Dispatchable, InteractsWithSockets, SerializesModels;


    public $micStatus;
    public $camStatus;

    public function __construct($micStatus, $camStatus)
    {
        $this->micStatus = $micStatus;
        $this->camStatus = $camStatus;
    }

    public function broadcastOn()
    {
        return new PrivateChannel('agent-queue');
    }

    public function broadcastWith()
    {
        return [
            'mic' => $this->micStatus,
            'cam' => $this->camStatus,
        ];
    }
}
