Skip to content

Instantly share code, notes, and snippets.

@johnny5th
Created September 21, 2016 20:12
Show Gist options
  • Save johnny5th/2190fb6843119a61860787e4c5404721 to your computer and use it in GitHub Desktop.
Save johnny5th/2190fb6843119a61860787e4c5404721 to your computer and use it in GitHub Desktop.
<?php
// Check if actual video data is there
if(isset($video_data['video_id'])) {
# We have to manually define our embed code, as the players and module
# are not consistent enough to access with a single variable set/call
$video_embed = "http://player.vimeo.com/video/" . $video_data['video_id'] . "?html5=1&autoplay=1&badge=0&byline=0&title=0&api=1";
# We are going to use Javascript and CSS to do all of the fancy video
# showing/hiding - CSS contains all of the active styles
print '<a class="video-button" data-video="' . $video_embed . '" data-source="' . $video_data['handler'] . '">Play Video</a>';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment