Ejemplo n.º 1
0
 /**
  * {@inheritdoc}
  */
 public function getCode()
 {
     if ($url = $this->providers['twittercards']->bag->get('player')) {
         $url = str_replace('/twitter/iframe', '?html5=true', $url);
         return Utils::iframe($url, $this->width . 'px', $this->height . 'px');
     }
 }
Ejemplo n.º 2
0
 /**
  * {@inheritdoc}
  */
 public function getCode()
 {
     $this->width = null;
     $this->height = null;
     $embed_url = 'http://pastebin.com/embed_iframe.php?i=' . ($this->request->getQueryParameter('i') ?: $this->request->getDirectoryPosition(0));
     return Utils::iframe($embed_url);
 }
Ejemplo n.º 3
0
 /**
  * {@inheritdoc}
  */
 public function getCode()
 {
     $url = clone $this->request->url;
     $url->setDirectory(0, 'embed');
     $url->setDirectory(2, 'vertical');
     return Utils::iframe($url->getUrl(), $this->width, $this->height);
 }
Ejemplo n.º 4
0
 /**
  * {@inheritdoc}
  */
 public function getCode()
 {
     $url = new Url($this->request->url->getUrl());
     $url->setParameter('output', 'embed');
     $url->setParameter('s', '');
     return Utils::iframe($url->getUrl());
 }
Ejemplo n.º 5
0
 /**
  * {@inheritdoc}
  */
 public function getCode()
 {
     $url = $this->request->createUrl()->withDirectoryPosition(3, 'preview')->withQueryParameters([]);
     return Utils::iframe($url);
     //this code of google maps no longer works
     //return Utils::iframe($url->withQueryParameter('output', 'embed')->withQueryParameter('s', ''));
 }
Ejemplo n.º 6
0
 /**
  * {@inheritdoc}
  */
 public function getCode()
 {
     $this->width = null;
     $this->height = null;
     $url = $this->url;
     $embed_url = $url . (substr($url, -1) === '/' ? 'embedded/' : '/embedded/');
     return Utils::iframe($embed_url);
 }
Ejemplo n.º 7
0
 /**
  * {@inheritdoc}
  */
 public function getCode()
 {
     $code = parent::getCode();
     if (empty($code)) {
         $code = Utils::iframe($this->request->createUrl()->withAddedPath('player'), $this->width, $this->height);
     }
     return $code;
 }
Ejemplo n.º 8
0
 /**
  * {@inheritdoc}
  */
 public function getCode()
 {
     $url = $this->request->createUrl();
     if ($this->request->getHost() === 'drive.google.com') {
         return Utils::iframe($url->withDirectoryPosition(3, 'preview'));
     }
     return Utils::iframe($url->withQueryParameter('output', 'embed')->withQueryParameter('s', ''));
 }
Ejemplo n.º 9
0
 /**
  * {@inheritdoc}
  */
 public function getCode()
 {
     $this->width = null;
     $this->height = null;
     if ($google = $this->getProvider('google')) {
         return $google->getCode();
     }
     $url = $this->request->createUrl()->withDirectoryPosition(3, 'preview')->withQueryParameters([]);
     return Utils::iframe($url);
 }
Ejemplo n.º 10
0
 /**
  * {@inheritdoc}
  */
 public function getCode()
 {
     $dom = $this->request->getHtmlContent();
     foreach ($dom->getElementsByTagName('a') as $a) {
         if ($a->hasAttribute('data-episode_id')) {
             $id = (int) $a->getAttribute('data-episode_id');
             if ($id) {
                 return Utils::iframe('http://www.spreaker.com/embed/player/standard?autoplay=false&episode_id=' . $id, '100%', 131, 'min-width:400px;');
             }
             break;
         }
     }
 }
Ejemplo n.º 11
0
 /**
  * {@inheritdoc}
  */
 public function getCode()
 {
     if (empty($this->config['key'])) {
         return;
     }
     switch ($this->mode) {
         case 'place':
         case 'search':
             return Utils::iframe($this->request->createUrl()->withPath('maps/embed/v1/' . $this->mode)->withQueryParameters(['q' => $this->request->getDirectoryPosition(2), 'key' => $this->config['key']]));
         case 'dir':
             return Utils::iframe($this->request->createUrl()->withPath('maps/embed/v1/directions')->withQueryParameters(['origin' => $this->request->getDirectoryPosition(2), 'destination' => $this->request->getDirectoryPosition(3), 'key' => $this->config['key']]));
     }
 }
Ejemplo n.º 12
0
 /**
  * {@inheritdoc}
  */
 public function getCode()
 {
     $dom = $this->request->getHtmlContent();
     foreach ($dom->getElementsByTagName('a') as $a) {
         if ($a->hasAttribute('data-episode_id')) {
             $id = (int) $a->getAttribute('data-episode_id');
             if ($id) {
                 return Utils::iframe($this->request->createUrl()->withPath('embed/player/standard')->withQueryParameters(['autoplay' => 'false', 'episode_id' => $id]), $this->width, $this->height, 'min-width:400px;border:none;overflow:hidden;');
             }
             break;
         }
     }
 }
Ejemplo n.º 13
0
 /**
  * {@inheritdoc}
  */
 public function getCode()
 {
     $embed_url = 'http://pastebin.com/embed_iframe.php?i=' . ($this->request->url->getParameter('i') ?: $this->request->url->getDirectory(0));
     return Utils::iframe($embed_url);
 }
Ejemplo n.º 14
0
 /**
  * {@inheritdoc}
  */
 public function getCode()
 {
     if ($this->bag->has('player')) {
         return Utils::iframe($this->bag->get('player'), $this->getWidth(), $this->getHeight());
     }
 }
Ejemplo n.º 15
0
 /**
  * {@inheritdoc}
  */
 public function getCode()
 {
     return Utils::iframe(str_replace('/details/', '/embed/', $this->getUrl()), $this->getWidth(), $this->getHeight());
 }
Ejemplo n.º 16
0
 /**
  * {@inheritdoc}
  */
 public function getCode()
 {
     $url = new Url($this->request->url->getUrl());
     $url->setDirectory(null, 'player');
     return Utils::iframe($url->getUrl(), $this->width, $this->height);
 }
Ejemplo n.º 17
0
 /**
  * {@inheritdoc}
  */
 public function getCode()
 {
     $id = $this->request->getDirectoryPosition(2);
     return Utils::iframe($this->request->createUrl()->withPath("embed/{$id}/vertical"), $this->width, $this->height, 'border:1px solid #e7e7e7;');
 }
Ejemplo n.º 18
0
 /**
  * {@inheritdoc}
  */
 public function getCode()
 {
     $uri = 'spotify' . str_replace('/', ':', $this->request->url->getPath(true));
     return Utils::iframe('https://embed.spotify.com/?uri=' . $uri, 300, 380);
 }
Ejemplo n.º 19
0
 /**
  * {@inheritdoc}
  */
 public function getCode()
 {
     if (is_numeric($this->request->getDirectoryPosition(1))) {
         return Utils::iframe($this->request->createUrl()->withDirectoryPosition(2, 'embed.html'), $this->width, $this->height);
     }
 }
Ejemplo n.º 20
0
 /**
  * {@inheritdoc}
  */
 public function getCode()
 {
     $url = $this->request->createUrl()->withDirectoryPosition(3, 'preview')->withQueryParameters([]);
     return Utils::iframe($url);
 }
Ejemplo n.º 21
0
 /**
  * {@inheritdoc}
  */
 public function getCode()
 {
     $url = $this->getUrl();
     $url = preg_replace('|(/watch/[\\w-]+)-([\\d]+)|', '/embed/$2', $url);
     return Utils::iframe($url, $this->width, $this->height);
 }
Ejemplo n.º 22
0
 /**
  * {@inheritdoc}
  */
 public function getCode()
 {
     $url = $this->getUrl();
     $embed_url = $url . (substr($url, -1) === '/' ? 'embedded/' : '/embedded/');
     return Utils::iframe($embed_url);
 }
Ejemplo n.º 23
0
 /**
  * {@inheritdoc}
  */
 public function getCode()
 {
     return Utils::iframe($this->request->getUrl() . '/embed', $this->width, $this->height);
 }
Ejemplo n.º 24
0
 /**
  * {@inheritdoc}
  */
 public function getCode()
 {
     if ($this->bag->has('video')) {
         $video = $this->bag->get('video');
         if (!($videoPath = parse_url($video, PHP_URL_PATH)) || !($type = pathinfo($videoPath, PATHINFO_EXTENSION))) {
             $type = $this->bag->get('video:type');
         }
         switch ($type) {
             case 'swf':
             case 'application/x-shockwave-flash':
                 return Utils::flash($video, $this->getWidth(), $this->getHeight());
             case 'mp4':
             case 'ogg':
             case 'ogv':
             case 'webm':
             case 'application/mp4':
             case 'video/mp4':
             case 'video/ogg':
             case 'video/ogv':
             case 'video/webm':
                 $images = $this->getImagesUrls();
                 return Utils::videoHtml(current($images), $video, $this->getWidth(), $this->getHeight());
             case 'text/html':
                 return Utils::iframe($video, $this->getWidth(), $this->getHeight());
         }
     }
 }