AmCharts.php
8 years ago
Animatron.php
8 years ago
Animoto.php
8 years ago
AolOn.php
8 years ago
AppNet.php
8 years ago
AudioSnaps.php
8 years ago
Bambuser.php
8 years ago
BlipTV.php
8 years ago
Cacoo.php
8 years ago
Chartblocks.php
8 years ago
Chirbit.php
8 years ago
CircuitLab.php
8 years ago
Clipland.php
8 years ago
Clyp.php
8 years ago
Codepoints.php
8 years ago
CollegeHumor.php
8 years ago
Coub.php
8 years ago
CrowdRanking.php
8 years ago
DailyMile.php
8 years ago
DailyMotion.php
8 years ago
Deviantart.php
8 years ago
Didacte.php
8 years ago
Dipity.php
8 years ago
DotSub.php
8 years ago
Edocr.php
8 years ago
EgliseInfo.php
8 years ago
Facebook.php
8 years ago
Flickr.php
8 years ago
FunnyOrDie.php
8 years ago
GeographCI.php
8 years ago
GeographDe.php
8 years ago
GeographUk.php
8 years ago
GettyImages.php
8 years ago
Gfycat.php
8 years ago
GithubGist.php
8 years ago
Gmep.php
8 years ago
Hq23.php
8 years ago
Huffduffer.php
8 years ago
Hulu.php
8 years ago
IFTTT.php
8 years ago
IFixIt.php
8 years ago
Infogram.php
8 years ago
Instagram.php
8 years ago
Issuu.php
8 years ago
Kickstarter.php
8 years ago
LearningApps.php
8 years ago
Meetup.php
8 years ago
MixCloud.php
8 years ago
MobyPicture.php
8 years ago
NFB.php
8 years ago
Officemix.php
8 years ago
OfficialFM.php
8 years ago
Oumy.php
8 years ago
Pastery.php
8 years ago
PollDaddy.php
8 years ago
PollEveryWhere.php
8 years ago
Portfolium.php
8 years ago
Rapidengage.php
8 years ago
Rdio.php
8 years ago
ReleaseWire.php
8 years ago
RepubHub.php
8 years ago
Reverbnation.php
8 years ago
Revision3.php
8 years ago
Roomshare.php
8 years ago
Rutube.php
8 years ago
Sapo.php
8 years ago
Screenr.php
8 years ago
Scribd.php
8 years ago
ShortNote.php
8 years ago
Shoudio.php
8 years ago
Showtheway.php
8 years ago
Silk.php
8 years ago
Sketchfab.php
8 years ago
SlideShare.php
8 years ago
SoundCloud.php
8 years ago
Speakerdeck.php
8 years ago
Spotify.php
8 years ago
StreamOneCloud.php
8 years ago
Streamable.php
8 years ago
Sway.php
8 years ago
Ted.php
8 years ago
TheySaidSo.php
8 years ago
Twitter.php
8 years ago
Ustream.php
8 years ago
Verse.php
8 years ago
Vevo.php
8 years ago
Viddler.php
8 years ago
VideoFork.php
8 years ago
VideoJug.php
8 years ago
Vimeo.php
8 years ago
Vine.php
8 years ago
WordpressTV.php
8 years ago
YFrog.php
8 years ago
Yandex.php
8 years ago
Youtube.php
8 years ago
Bambuser.php
79 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Bambuser.php |
| 4 | * |
| 5 | * @package Providers |
| 6 | * @author Michael Pratt <pratt@hablarmierda.net> |
| 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\Providers; |
| 14 | |
| 15 | /** |
| 16 | * The bambuser.com Provider |
| 17 | * @link http://bambuser.com |
| 18 | * @link http://bambuser.com/api/embed_oembed |
| 19 | */ |
| 20 | class Bambuser extends \Embera\Adapters\Service |
| 21 | { |
| 22 | /** inline {@inheritdoc} */ |
| 23 | protected $apiUrl = 'http://api.bambuser.com/oembed.json'; |
| 24 | |
| 25 | /** inline {@inheritdoc} */ |
| 26 | protected function validateUrl() |
| 27 | { |
| 28 | $this->url->stripLastSlash(); |
| 29 | $this->url->stripWWW(); |
| 30 | |
| 31 | return ( |
| 32 | preg_match('~bambuser\.com/v/(?:[0-9]+)$~i', $this->url) || preg_match('~bambuser\.com/channel/(?:[^/]+)$~i', $this->url) |
| 33 | ); |
| 34 | } |
| 35 | |
| 36 | /** inline {@inheritdoc} */ |
| 37 | public function normalizeUrl() |
| 38 | { |
| 39 | if (preg_match('~bambuser\.com/channel/(?:[^/]+)/broadcast/([0-9]+)~i', $this->url, $matches)) { |
| 40 | $this->url = new \Embera\Url('http://bambuser.com/v/' . $matches['1']); |
| 41 | } |
| 42 | } |
| 43 | |
| 44 | /** inline {@inheritdoc} */ |
| 45 | public function fakeResponse() |
| 46 | { |
| 47 | $defaults = array( |
| 48 | 'type' => 'video', |
| 49 | 'provider_name' => 'Bambuser.com', |
| 50 | 'provider_url' => 'http://bambuser.com', |
| 51 | ); |
| 52 | |
| 53 | $html = '<object id="bplayer" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="{width}" height="{height}">'; |
| 54 | $html .= '<embed allowfullscreen="true" allowscriptaccess="always" wmode="transparent" type="application/x-shockwave-flash" name="bplayer" src="https://static.bambuser.com/r/player.swf?{query}&context=oembed" width="{width}" height="{height}" />'; |
| 55 | $html .= '<param name="movie" value="https://static.bambuser.com/r/player.swf?context=oembed&{query}" />'; |
| 56 | $html .= '<param name="allowfullscreen" value="true" />'; |
| 57 | $html .= '<param name="allowscriptaccess" value="always" />'; |
| 58 | $html .= '<param name="wmode" value="transparent" />'; |
| 59 | $html .= '</object>'; |
| 60 | |
| 61 | if (preg_match('~/v/([0-9]+)$~i', $this->url, $matches)) { |
| 62 | return array_merge( |
| 63 | $defaults, |
| 64 | array('html' => str_replace('{query}', 'vid=' . $matches['1'], $html)) |
| 65 | ); |
| 66 | } |
| 67 | else if (preg_match('~/channel/([^/]+)~i', $this->url, $matches)) |
| 68 | { |
| 69 | return array_merge( |
| 70 | $defaults, |
| 71 | array('html' => str_replace('{query}', 'username=' . urlencode($matches['1']), $html)) |
| 72 | ); |
| 73 | } |
| 74 | |
| 75 | return array(); |
| 76 | } |
| 77 | |
| 78 | } |
| 79 |