Add Parameter to Control Aspect Ratio
-
Was having sizing issues on a video and tweaked the css force the correct size, but was surprised I couldn’t specify the ratio in the shortcode. The css tweak gets out of hand if you have multiple videos at different aspect ratios. Adding a “ratio” parameter would allow the ratio to be set for each embedded video, and only requires two lines to be changed in evp_embed_video_handler().
function evp_embed_video_handler($atts) { extract(shortcode_atts(array( 'url' => '', 'ratio' => '0.417', ), $atts)); $output = <<<EOT <div data-ratio="$ratio" class="flowplayer"> <video> <source type="video/mp4" src="$url"/> </video> </div> EOT; return $output; }
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
The topic ‘Add Parameter to Control Aspect Ratio’ is closed to new replies.