TemplateLayouts
5 months ago
AirTable.php
1 year ago
Boomplay.php
1 year ago
Calendly.php
2 years ago
Canva.php
1 year ago
FITE.php
1 year ago
GettyImages.php
9 months ago
Giphy.php
2 years ago
GitHub.php
3 years ago
GoogleCalendar.php
8 months ago
GoogleDocs.php
2 years ago
GoogleDrive.php
2 years ago
GoogleMaps.php
2 years ago
GooglePhotos.php
3 months ago
Gumroad.php
2 years ago
InstagramFeed.php
6 months ago
LinkedIn.php
2 years ago
Meetup.php
6 months ago
NRKRadio.php
2 years ago
OneDrive.php
11 months ago
OpenSea.php
9 months ago
SelfHosted.php
2 years ago
Spreaker.php
1 year ago
TikTok.php
2 years ago
Twitch.php
2 years ago
Wistia.php
3 months ago
Wrapper.php
3 years ago
X.php
2 years ago
Youtube.php
3 months ago
index.html
7 years ago
FITE.php
67 lines
| 1 | <?php |
| 2 | |
| 3 | namespace EmbedPress\Providers; |
| 4 | |
| 5 | use Embera\Provider\ProviderAdapter; |
| 6 | use Embera\Provider\ProviderInterface; |
| 7 | use Embera\Url; |
| 8 | |
| 9 | (defined('ABSPATH') && defined('EMBEDPRESS_IS_LOADED')) or die("No direct script access allowed."); |
| 10 | |
| 11 | /** |
| 12 | * Entity responsible to support Canva embeds. |
| 13 | * |
| 14 | * @package EmbedPress |
| 15 | * @subpackage EmbedPress/Providers |
| 16 | * @author EmbedPress <help@embedpress.com> |
| 17 | * @copyright Copyright (C) 2023 WPDeveloper. All rights reserved. |
| 18 | * @license GPLv3 or later |
| 19 | * @since 1.0.0 |
| 20 | */ |
| 21 | class FITE extends ProviderAdapter implements ProviderInterface |
| 22 | { |
| 23 | /** inline {@inheritdoc} */ |
| 24 | protected $endpoint = 'https://www.fite.tv/oembed?format=json'; |
| 25 | |
| 26 | /** inline {@inheritdoc} */ |
| 27 | protected static $hosts = [ |
| 28 | 'fite.tv', |
| 29 | 'triller.tv', |
| 30 | 'trillertv.com' |
| 31 | ]; |
| 32 | |
| 33 | /** inline {@inheritdoc} */ |
| 34 | protected $httpsSupport = true; |
| 35 | |
| 36 | /** inline {@inheritdoc} */ |
| 37 | public function validateUrl(Url $url) |
| 38 | { |
| 39 | return (bool) (preg_match('~(trillertv|triller|fite)\.(tv|com)/watch/(?:[^/]+)/([^/]+)/?~i', (string) $url)); |
| 40 | } |
| 41 | |
| 42 | /** inline {@inheritdoc} */ |
| 43 | public function normalizeUrl(Url $url) |
| 44 | { |
| 45 | $url->convertToHttps(); |
| 46 | $url->removeQueryString(); |
| 47 | |
| 48 | return $url; |
| 49 | } |
| 50 | |
| 51 | /** inline {@inheritdoc} */ |
| 52 | public function getFakeResponse() |
| 53 | { |
| 54 | preg_match('~(trillertv|triller|fite)\.(tv|com)/watch/(?:[^/]+)/([^/]+)/?~i', (string) $this->url, $matches); |
| 55 | |
| 56 | $html = '<div style="height: 270px; width: 480px;" data-id="' . $matches['1'] . '" class="kdv-embed" data-type="v" data-ap="true"></div> <script src="https://www.fite.tv/embed.1.js"></script'; |
| 57 | |
| 58 | return [ |
| 59 | 'type' => 'video', |
| 60 | 'provider_name' => 'FITE', |
| 61 | 'provider_url' => 'https://fite.tv', |
| 62 | 'title' => 'Unknown title', |
| 63 | 'html' => $html, |
| 64 | ]; |
| 65 | } |
| 66 | } |
| 67 |