1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/* |
4
|
|
|
* This file is part of the XabbuhPandaBundle package. |
5
|
|
|
* |
6
|
|
|
* (c) Christian Flothmann <[email protected]> |
7
|
|
|
* |
8
|
|
|
* For the full copyright and license information, please view the LICENSE |
9
|
|
|
* file that was distributed with this source code. |
10
|
|
|
*/ |
11
|
|
|
|
12
|
|
|
namespace Xabbuh\PandaBundle\Event; |
13
|
|
|
|
14
|
|
|
use Symfony\Contracts\EventDispatcher\Event; |
15
|
|
|
|
16
|
|
|
/** |
17
|
|
|
* Event that is triggered when a video was successfully encoded. |
18
|
|
|
* |
19
|
|
|
* @author Christian Flothmann <[email protected]> |
20
|
|
|
* |
21
|
|
|
* @final since |
22
|
|
|
*/ |
23
|
|
|
class VideoEncodedEvent extends Event |
24
|
|
|
{ |
25
|
|
|
/** |
26
|
|
|
* The VIDEO_ENCODED event occurs when a video was successfully encoded. |
27
|
|
|
* |
28
|
|
|
* The event listener method receives a Xabbuh\PandaBundle\Event\VideoCreatedEvent instance. |
29
|
|
|
*/ |
30
|
|
|
const NAME = 'xabbuh_panda.video_encoded'; |
31
|
|
|
|
32
|
|
|
/** |
33
|
|
|
* The id of the encoded video |
34
|
|
|
* @var string |
35
|
|
|
*/ |
36
|
|
|
private $videoId; |
37
|
|
|
|
38
|
|
|
/** |
39
|
|
|
* List of encoding ids of this video |
40
|
|
|
* @var string[] |
41
|
|
|
*/ |
42
|
|
|
private $encodingIds = array(); |
43
|
|
|
|
44
|
|
|
/** |
45
|
|
|
* Constructs a new VideoEncodedEvent. |
46
|
|
|
* |
47
|
|
|
* @param string $videoId Video id |
48
|
|
|
* @param string[] $encodingIds Ids of the video's encodings |
49
|
|
|
*/ |
50
|
4 |
|
public function __construct($videoId, array $encodingIds) |
51
|
|
|
{ |
52
|
4 |
|
$this->videoId = $videoId; |
53
|
4 |
|
$this->encodingIds = $encodingIds; |
54
|
4 |
|
} |
55
|
|
|
|
56
|
|
|
/** |
57
|
|
|
* Returns the video id. |
58
|
|
|
* |
59
|
|
|
* @return string The video id |
60
|
|
|
*/ |
61
|
3 |
|
public function getVideoId() |
62
|
|
|
{ |
63
|
3 |
|
return $this->videoId; |
64
|
|
|
} |
65
|
|
|
|
66
|
|
|
/** |
67
|
|
|
* Returns the video's encoding ids. |
68
|
|
|
* |
69
|
|
|
* @return string[] The encoding ids |
70
|
|
|
*/ |
71
|
3 |
|
public function getEncodingIds() |
72
|
|
|
{ |
73
|
3 |
|
return $this->encodingIds; |
74
|
|
|
} |
75
|
|
|
} |
76
|
|
|
|