Created
September 24, 2015 17:20
-
-
Save joeydsmith/655dd54d009b470e8014 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Get Video URL | |
$video_url = get_field( 'video_url' ); | |
// Get video ID | |
$video_data = parseVideoUrl( $video_url ); | |
// If YouTube | |
if ( $video_data['type'] == 'youtube' ) { | |
// Get thumbnail | |
$image = 'http://img.youtube.com/vi/' . $video_data['id'] . '/0.jpg'; | |
} | |
// Get Video embed code | |
$video_embed = getVideoOutput( $video_data ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment