1 | <?php |
||
15 | abstract class AbstractServiceAdapter implements VideoAdapterInterface |
||
16 | { |
||
17 | /** |
||
18 | * @var string |
||
19 | */ |
||
20 | public $rawUrl; |
||
21 | |||
22 | /** |
||
23 | * @var string |
||
24 | */ |
||
25 | public $videoId; |
||
26 | |||
27 | /** |
||
28 | * @var string |
||
29 | */ |
||
30 | public $pattern; |
||
31 | |||
32 | /** |
||
33 | * @var EmbedRendererInterface |
||
34 | */ |
||
35 | public $renderer; |
||
36 | |||
37 | /** |
||
38 | * AbstractVideoAdapter constructor. |
||
39 | * |
||
40 | * @param string $url |
||
41 | * @param string $pattern |
||
42 | * @param EmbedRendererInterface $renderer |
||
43 | */ |
||
44 | public function __construct($url, $pattern, EmbedRendererInterface $renderer) |
||
50 | |||
51 | /** |
||
52 | * Returns the input URL. |
||
53 | * |
||
54 | * @return string |
||
55 | */ |
||
56 | public function getRawUrl() |
||
60 | |||
61 | /** |
||
62 | * @param string $rawUrl |
||
63 | */ |
||
64 | public function setRawUrl($rawUrl) |
||
68 | |||
69 | /** |
||
70 | * @return string |
||
71 | */ |
||
72 | public function getVideoId() |
||
76 | |||
77 | /** |
||
78 | * @param string $videoId |
||
79 | */ |
||
80 | public function setVideoId($videoId) |
||
84 | |||
85 | /** |
||
86 | * @return string |
||
87 | */ |
||
88 | public function getPattern() |
||
92 | |||
93 | /** |
||
94 | * @param string $pattern |
||
95 | */ |
||
96 | public function setPattern($pattern) |
||
100 | |||
101 | /** |
||
102 | * @return EmbedRendererInterface |
||
103 | */ |
||
104 | public function getRenderer() |
||
108 | |||
109 | /** |
||
110 | * @param EmbedRendererInterface $renderer |
||
111 | */ |
||
112 | public function setRenderer($renderer) |
||
116 | |||
117 | /** |
||
118 | * @param int $width |
||
119 | * @param int $height |
||
120 | * @param bool $forceAutoplay |
||
121 | * @param bool $forceSecure |
||
122 | * |
||
123 | * @return string |
||
124 | * @throws NotEmbeddableException |
||
125 | */ |
||
126 | public function getEmbedCode($width, $height, $forceAutoplay = false, $forceSecure = false) |
||
140 | |||
141 | /** |
||
142 | * Switches the protocol scheme between http and https in case you want to force https |
||
143 | * |
||
144 | * @param bool|false $forceSecure |
||
145 | * @return string |
||
146 | * @throws InvalidUrlException |
||
147 | */ |
||
148 | public function getScheme($forceSecure = false) |
||
162 | |||
163 | public function isThumbnailSizeAvailable($intendedSize) |
||
167 | } |
||
168 |