Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #foreach($num in [1..3])
- #set($videoEmbed = $blogEntry.get("videoEmbed$!{num}"))
- #if($UtilMethods.isSet($videoEmbed))
- <p>
- #if($videoEmbed.matches(".*vimeo\.com/video/([0-9]*).*")) ## If it's a Vimeo video, use standardized Vimeo embed code for all videos
- #set($vimeoId = $videoEmbed.replaceAll(".*vimeo\.com/video/([0-9]*).*","$1"))
- <iframe src="http://player.vimeo.com/video/$!{vimeoId}?portrait=0&color=a2d5f5" width="100%" height="326" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>
- #elseif($videoEmbed.matches('.*youtube.com/embed/([a-zA-Z0-9]*)".*')) ## If it's a YouTube video, use standardized YouTube embed code for all videos
- #set($youtubeId = $videoEmbed.replaceAll('.*youtube.com/embed/([a-zA-Z0-9]*)".*',"$1"))
- <iframe width="100%" height="326" src="http://www.youtube.com/embed/$!{youtubeId}?rel=0" frameborder="0" allowfullscreen></iframe>
- #else ## Fall back to just using whatever embed code they may have dumped in
- $!videoEmbed
- #end
- </p>
- #end
- #set($videoEmbed = "")
- #end
Advertisement
Add Comment
Please, Sign In to add comment