1 | <?php |
||
5 | class YouTubeProvider extends AbstractOembedProvider implements ProviderInterface |
||
6 | { |
||
7 | const URL_OEMBED = 'http://www.youtube.com/oembed?url=http://www.youtube.com/watch?v=%s&format=json'; |
||
8 | const URL_IMAGE_MAX_RES = 'https://i.ytimg.com/vi/%s/maxresdefault.jpg'; |
||
9 | const URL_IMAGE_HQ = 'https://i.ytimg.com/vi/%s/hqdefault.jpg'; |
||
10 | |||
11 | /** |
||
12 | * @param string $id |
||
13 | * @return string |
||
14 | */ |
||
15 | public function getOembedUrl($id) |
||
19 | |||
20 | /** |
||
21 | * @param string $id |
||
22 | * @return string |
||
23 | */ |
||
24 | public function getImageUrl($id) |
||
34 | |||
35 | /** |
||
36 | * @param $value |
||
37 | * @return string |
||
38 | * @throws \Exception |
||
39 | */ |
||
40 | public function parseProviderReference($value) |
||
64 | |||
65 | /** |
||
66 | * @return string |
||
67 | */ |
||
68 | public function getIcon() |
||
72 | |||
73 | /** |
||
74 | * @return string |
||
75 | */ |
||
76 | public function getName() |
||
80 | |||
81 | /** |
||
82 | * @return string |
||
83 | */ |
||
84 | public function getType() |
||
88 | |||
89 | /** |
||
90 | * @return string |
||
91 | */ |
||
92 | public function getEmbedTemplate() |
||
96 | } |
||
97 |