Posted by ju.ri on June 26, 2009 at 4:19pm
Jump to:
| Project: | SWF Tools |
| Version: | 6.x-2.5 |
| Component: | Documentation |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (duplicate) |
Issue Summary
I've been trying for hours to display a cck filefield in a view with a player other than the selected swf default. After trying all sorts of embedding, rewriting, customfield (php), and things like that, nothing worked out. Does anyone have an idea?
Otherwise this could become a feature suggestion for directly selecting different players in cck and views display options. I display everything on my site through CKK or Views, so at the moment it is impossible for me to have more than one player per filetype.
thanks for any ideas
Comments
#1
I now found a way to do this by using the "views-customfield" module to be able to insert the php code for a certain player into a view.
So first I added a relationship to the view, adding the filefield of the node as the relation. That way I can pull in the path of the filefield-file, not only the fid. Then I add the path of the file as a field to the view, and choose not to display it.
THe "customfield" has the great feature that it can use any other field (sorted before the custom field) as a variable. So I can put this in the php-code-area:
<?phpprint swf($data->files_node_data_field_MY_FILEFIELD_filepath,
array(
'methods' => array('player' => 'generic_mp3'),
)
);
?>
Maybe someone finds this information useful. Thanks for listening anyway :)
#2
Automatically closed -- issue fixed for 2 weeks with no activity.
#3
May be the following sample PHP code for views-customfield will help someone to save a lot of time:
<?php$result = db_query("SELECT filename, filepath FROM `files`WHERE fid ='%s'",$data->node_data_field_video_field_video_fid);
$file=db_fetch_object($result);
if ($file->filepath) {
$url = file_create_url($file->filepath);
print swf($url,
array(
'methods' => array('player' => 'wijering4_mediaplayer'),
)
);
}
?>
File path is retrieved and displayed in wijering4 mediaplayer. The player string I found defined in the module of the player:
<?phpdefine('WIJERING4_MEDIAPLAYER', 'wijering4_mediaplayer'); // 'player', can display mixed files
define('WIJERING4_IMAGEROTATOR', 'wijering4_imagerotator'); // 'player', can display images.
define('WIJERING4_DOWNLOAD', 'http://www.jeroenwijering.com/?item=JW_FLV_Media_Player');
?>
I guess you can find similar ID string for the other players defined in their modules.
Would be nicer though when SWFtools by itself would enable the player in the view and therefore I change this thread into a feature request
#4
I think this might be addressed by #483524: Create SWF Tools "profiles"?
That will let you create any number of player configurations, and then you can use them in CCK, and it should also work in Views. I've only done limited testing, but the formatters seemed to show up ok.
We don't yet have clever stuff like assembling data from views in to a playlist. That is requested somewhere else on the queue (can't find the link right now).
But in terms of over-riding defaults that will be in the next release.
Development code for this feature is on HEAD.
Can I set this as a duplicate of the "profiles" thread?
#5
Setting as duplicate as this does seem to describe what we can now do via profiles.
Note - profiles are now included on branch DRUPAL-6--3, and in the BETA3 release, so don't use HEAD!