1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace SquareetLabs\LaravelOpenVidu\Events; |
4
|
|
|
|
5
|
|
|
use Illuminate\Queue\SerializesModels; |
6
|
|
|
|
7
|
|
|
/** |
8
|
|
|
* Class WebRTCConnectionCreated |
9
|
|
|
* @package SquareetLabs\LaravelOpenVidu\Events |
10
|
|
|
*/ |
11
|
|
|
class WebRTCConnectionCreated |
12
|
|
|
{ |
13
|
|
|
use SerializesModels; |
|
|
|
|
14
|
|
|
/** |
15
|
|
|
* @var string $sessionId |
16
|
|
|
* Session for which the event was triggered |
17
|
|
|
* A string with the session unique identifier |
18
|
|
|
*/ |
19
|
|
|
public $sessionId; |
20
|
|
|
|
21
|
|
|
/** |
22
|
|
|
* @var int $timestamp |
23
|
|
|
* Time when the event was triggered |
24
|
|
|
* UTC milliseconds |
25
|
|
|
*/ |
26
|
|
|
public $timestamp; |
27
|
|
|
|
28
|
|
|
/** |
29
|
|
|
* @var string $participantId |
30
|
|
|
* Identifier of the participant |
31
|
|
|
* A string with the participant unique identifier |
32
|
|
|
*/ |
33
|
|
|
public $participantId; |
34
|
|
|
|
35
|
|
|
/** |
36
|
|
|
* @var string $connection |
37
|
|
|
* Whether the media connection is an inbound connection (the participant is receiving media from OpenVidu) or an outbound connection (the participant is sending media to OpenVidu) |
38
|
|
|
* ["INBOUND","OUTBOUND"] |
39
|
|
|
*/ |
40
|
|
|
public $connection; |
41
|
|
|
|
42
|
|
|
|
43
|
|
|
/** |
44
|
|
|
* @var string $receivingFrom |
45
|
|
|
* If connection is "INBOUND", the participant from whom the media stream is being received |
46
|
|
|
* A string with the participant (sender) unique identifier |
47
|
|
|
*/ |
48
|
|
|
public $receivingFrom; |
49
|
|
|
|
50
|
|
|
/** |
51
|
|
|
* @var bool $audioEnabled |
52
|
|
|
* Whether the media connection has negotiated audio or not |
53
|
|
|
* [true,false] |
54
|
|
|
*/ |
55
|
|
|
public $audioEnabled; |
56
|
|
|
|
57
|
|
|
/** |
58
|
|
|
* @var bool $videoEnabled |
59
|
|
|
* Whether the media connection has negotiated video or not |
60
|
|
|
* [true,false] |
61
|
|
|
*/ |
62
|
|
|
public $videoEnabled; |
63
|
|
|
|
64
|
|
|
/** |
65
|
|
|
* @var string $videoSource |
66
|
|
|
* If videoEnabled is true, the type of video that is being transmitted |
67
|
|
|
* ["CAMERA","SCREEN"] |
68
|
|
|
*/ |
69
|
|
|
public $videoSource; |
70
|
|
|
|
71
|
|
|
/** |
72
|
|
|
* @var int $videoFramerate |
73
|
|
|
* If videoEnabled is true, the framerate of the transmitted video |
74
|
|
|
* Number of fps |
75
|
|
|
*/ |
76
|
|
|
public $videoFramerate; |
77
|
|
|
|
78
|
|
|
/** |
79
|
|
|
* @var int $videoDimensions |
80
|
|
|
* If videoEnabled is true, the dimensions transmitted video |
81
|
|
|
* String with the dimensions (e.g. "1920x1080") |
82
|
|
|
*/ |
83
|
|
|
public $videoDimensions; |
84
|
|
|
|
85
|
|
|
/** |
86
|
|
|
* @var string $event |
87
|
|
|
* Openvidu server webhook event |
88
|
|
|
*/ |
89
|
|
|
public $event; |
90
|
|
|
|
91
|
|
|
|
92
|
|
|
/** |
93
|
|
|
* Create a new SessionCreated event instance. |
94
|
|
|
* @param array $data |
95
|
|
|
*/ |
96
|
|
|
public function __construct(array $data) |
97
|
|
|
{ |
98
|
|
|
$this->sessionId = $data['sessionId']; |
99
|
|
|
$this->timestamp = $data['timestamp']; |
100
|
|
|
$this->participantId = $data['participantId']; |
101
|
|
|
$this->receivingFrom = $data['receivingFrom']; |
102
|
|
|
$this->audioEnabled = $data['audioEnabled']; |
103
|
|
|
$this->videoEnabled = $data['videoEnabled']; |
104
|
|
|
$this->videoSource = $data['videoSource']; |
105
|
|
|
$this->videoFramerate = $data['videoFramerate']; |
106
|
|
|
$this->videoDimensions = $data['videoDimensions']; |
107
|
|
|
$this->event = $data['event']; |
108
|
|
|
} |
109
|
|
|
} |
110
|
|
|
|