Closed (fixed)
Project:
Vimeo
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
19 May 2010 at 14:37 UTC
Updated:
21 Dec 2010 at 23:20 UTC
This code fixes the sub-issue i described in this post.
http://drupal.org/node/802412#comment-2983678
If no vimeo video had been selected , the default 'vimeo loading' moving would appear in the node. I would never want this in my page, so i've tweaked this function in vimeo.module to not output the field if a value hasn't been set for it.
It's the first time i've tweaked a module, so i'm not sure if this is the correct way to do it, but it works for me.
Cheers
M
/**
* Theme function for 'default' vimeo field formatter.
*/
function theme_vimeo_formatter_default($element) {
$data = vimeo_cache_video_get($element['#item']['value']);
$video_id = $data['id'];
if ($video_id)
{
return '<object width="'. variable_get('vimeo_width', 640) .'" height="'. variable_get('vimeo_height', 360) .'" class="vimeo-video">
<param name="allowfullscreen" value="true" />
<param name="allowscriptaccess" value="always" />
<param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id='.$data['id'].'&server=vimeo.com&show_title='. variable_get('vimeo_title', 1) .'&show_byline='. variable_get('vimeo_byline', 1) .'&show_portrait='. variable_get('vimeo_portrait', 1) .'&color='. variable_get('vimeo_colour', '00ADEF') .'&fullscreen='. variable_get('vimeo_fullscreen', 1) .'&autoplay='. variable_get('vimeo_autoplay', 0) .'" />
<embed src="http://vimeo.com/moogaloop.swf?clip_id='.$data['id'].'&server=vimeo.com&show_title='. variable_get('vimeo_title', 1) .'&show_byline='. variable_get('vimeo_byline', 1) .'&show_portrait='. variable_get('vimeo_portrait', 1) .'&color='. variable_get('vimeo_colour', '00ADEF') .'&fullscreen='. variable_get('vimeo_fullscreen', 1) .'&autoplay='. variable_get('vimeo_autoplay', 0) .'" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="'. variable_get('vimeo_width', 640) .'" height="'. variable_get('vimeo_height', 360) .'"></embed>
</object>';
}
}
Comments
Comment #1
jdwfly commentedI'm not quite sure what you are fixing, but this section is going to be changing soon since the embed code has changed.
Comment #2
hixster commentedThe embed code was being written out into the node even if you hadn't added a video to the field.
Comment #3
jdwfly commentedok, there were a few other posts about this as well, but it will be fixed soon.
Comment #4
jdwfly commentedfix committed