FlickrSlideshows.php in Video Filter 8
File
src/Plugin/VideoFilter/FlickrSlideshows.php
View source
<?php
namespace Drupal\video_filter\Plugin\VideoFilter;
use Drupal\video_filter\VideoFilterBase;
class FlickrSlideshows extends VideoFilterBase {
public function flash($video) {
$user_name = $video['codec']['matches'][1];
$set_id = $video['codec']['matches'][2];
return [
'src' => "//www.flickr.com/apps/slideshow/show.swf?v=67348" . ($video['autoplay'] ? '&autoplay=1' : ''),
'params' => [
'flashvars' => "&offsite=true&lang=en-us&page_show_url=%2Fphotos%2F{$user_name}%2Fsets%2F{$set_id}%2Fshow%2F&page_show_back_url=%2Fphotos%2F{$user_name}%2Fsets%2F{$set_id}%2F&set_id={$set_id}&jump_to=",
],
];
}
public function options() {
$form = parent::options();
$form['autoplay'] = [
'#title' => $this
->t('Autoplay (optional)'),
'#type' => 'checkbox',
];
return $form;
}
}