Skip to content

Instantly share code, notes, and snippets.

@jasonglisson
Last active September 14, 2017 12:39
Show Gist options
  • Save jasonglisson/268fd5d1c0bace312ca4 to your computer and use it in GitHub Desktop.
Save jasonglisson/268fd5d1c0bace312ca4 to your computer and use it in GitHub Desktop.
Video Modal WIndow
<div class="featured-video-wrap" style="display:none;">
<div class="close-video">Close</div>
<?php if (strpos($video_url, 'vimeo') !== FALSE) {
$id = substr($video_url, strrpos($video_url, '/') + 1);?>
<iframe src="https://player.vimeo.com/video/<?php print $id; ?>" width="560" height="315" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>
<?php } elseif(strpos($video_url, 'watch') !== FALSE) {
$id = substr($video_url, strrpos($video_url, '=') + 1);?>
<iframe width="560" height="315" src="https://www.youtube.com/embed/<?php print $id; ?>" frameborder="0" allowfullscreen></iframe>
<?php } elseif(strpos($video_url, 'youtu.be') !== FALSE) {
$id = substr($video_url, strrpos($video_url, '/') + 1);?>
<iframe width="560" height="315" src="https://www.youtube.com/embed/<?php print $id; ?>" frameborder="0" allowfullscreen></iframe>
<?php } ?>
</div>
<div class="video-lightbox" style="display:none;"></div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment