UpecPod.php
| 1 | <?php |
| 2 | /** |
| 3 | * UpecPod.php |
| 4 | * |
| 5 | * @package Embera |
| 6 | * @author Michael Pratt <yo@michael-pratt.com> |
| 7 | * @link http://www.michael-pratt.com/ |
| 8 | * |
| 9 | * For the full copyright and license information, please view the LICENSE |
| 10 | * file that was distributed with this source code. |
| 11 | */ |
| 12 | |
| 13 | namespace Embera\Provider; |
| 14 | |
| 15 | use Embera\Url; |
| 16 | |
| 17 | /** |
| 18 | * UpecPod Provider |
| 19 | * No Description |
| 20 | * |
| 21 | * @link https://pod.u-pec.fr |
| 22 | * |
| 23 | */ |
| 24 | class UpecPod extends ProviderAdapter implements ProviderInterface |
| 25 | { |
| 26 | /** inline {@inheritdoc} */ |
| 27 | protected $endpoint = 'https://pod.u-pec.fr/video/oembed?format=json'; |
| 28 | |
| 29 | /** inline {@inheritdoc} */ |
| 30 | protected static $hosts = [ |
| 31 | 'pod.u-pec.fr' |
| 32 | ]; |
| 33 | |
| 34 | /** inline {@inheritdoc} */ |
| 35 | protected $allowedParams = [ 'maxwidth', 'maxheight' ]; |
| 36 | |
| 37 | /** inline {@inheritdoc} */ |
| 38 | protected $httpsSupport = true; |
| 39 | |
| 40 | /** inline {@inheritdoc} */ |
| 41 | protected $responsiveSupport = false; |
| 42 | |
| 43 | /** inline {@inheritdoc} */ |
| 44 | public function validateUrl(Url $url) |
| 45 | { |
| 46 | return (bool) (preg_match('~pod\.u\-pec\.fr/video/([^/]+)~i', (string) $url)); |
| 47 | } |
| 48 | |
| 49 | /** inline {@inheritdoc} */ |
| 50 | public function normalizeUrl(Url $url) |
| 51 | { |
| 52 | $url->convertToHttps(); |
| 53 | $url->removeQueryString(); |
| 54 | |
| 55 | return $url; |
| 56 | } |
| 57 | |
| 58 | } |
| 59 |