Skip to content

Instantly share code, notes, and snippets.

@hunk
Created April 10, 2010 20:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hunk/362293 to your computer and use it in GitHub Desktop.
Save hunk/362293 to your computer and use it in GitHub Desktop.
<?php
add_action('wp_head', 'script_flow_player');
function script_flow_player(){
?>
<script type='text/javascript' src='<?php bloginfo('template_directory'); ?>/flowplayer/flowplayer-3.1.4.min.js'></script>
<script>
jQuery().ready(function() {
jQuery(".mf_video").each( function(element){
flowplayer(jQuery(this).attr('id'), "<?php bloginfo('template_directory'); ?>/flowplayer/flowplayer-3.1.5.swf",{clip : {autoPlay: false}});
});
});
</script>
<?php
}
function get_video($fieldName, $groupIndex=1, $fieldIndex=1, $params = NULL){
global $post;
$size = array('w' => 520, 'h' => 330);
$url_video = get($fieldName,$groupIndex,$fieldIndex);
if($url_video){
$id =sprintf("id_%s",uniqid());
if( isset($params['w']) ) $size['w'] = $params['w'];
if( isset($params['h']) ) $size['h'] = $params['h'];
printf('<a
href="%s"
style="display:block;width:%spx;height:%spx"
id="%s" class="mf_video">
</a>',$url_video,$size['w'],$size['h'],$id);
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment