Hi there,

I already have been in contact with Stuart about this issue, but I'm puting it up here so everyone can see.

First my setup:

views 6.x-3.0-alpha3
cck 6.x-2.x-dev (2010-Jan-26)
filefield 6.x-3.x-dev (2010-Apr-25)
swftools 6.x-3.0-beta4

So I created a content type for movie uploads, with 2 file fields. 1 for the thumbnail, and 1 for the movie.

I then setup the view as displayed in the attached 2 screenshots.

As you can see in the screenshots I keep getting the "No modules have registered the action _list. Check any required supporting modules are enabled." error, and flash gives the "no flash player" error. (See top left block.)

Basically I would love to know what I'm doing wrong, and how I can fix this.

Cheers,

Patrick

CommentFileSizeAuthor
screenshot 2.jpg146.32 KBpatmarkus
screenshot 1.jpg146.91 KBpatmarkus

Comments

Stuart Greenfield’s picture

You don't have the right formatters for the fields (screenshot1, Fields section).

The fields should be configured with "Path to file" as the SWF Tools plugin needs the raw file path.

You have selected the SWF Tools formatters, so these try to process the field first and then it fails.

The SWF Tools formatters are designed for use in a node where you want to render the content directly in the node - they process the file and turn it in to markup. You need the raw file path as the plugin needs to do its stuff.

Documentation isn't in place as the feature is still under development, so the closest I have is in http://drupal.org/node/581470#comment-2834126 and http://drupal.org/node/581470#comment-2838694

The first link describes setting up a basic playlist, and the second how to use thumbnails.

The key though is stressed in both those posts - use the "Path to file formatter", and make sure you unchecked Group multiple values.

patmarkus’s picture

Hi Stuart. I changed both the movie and thumb field to "path to file", and the error is gone now

However, flash is not playing. The JW player shows up where it should, but without a thumb and I cannot start the movie. The play button does not work.

Any other suggestions? Ps, in the swf report page everything is ok.

You can still see what I mean on this site: http://patrickmarkus.com/deepnpure

An example is the player in the left top block.

patmarkus’s picture

Ok, sorry for the hassle, but it works now!

Only in flowplayer though, I cannot use jwplayer.

I wanted to redownload jw player 4, but its not possible anymore I think, I can only find version 5.

One last question.

Since I have to choose swf as the style, it seems no loner possible to use the node title and use it on top op the player on a movies page. Is that correct? I told swf tools in the title field to use it as title, but I still dont get it on top of the movie.

Maybe im the only one who wants to set it up this way. but for a page with multiple movies listed, its nice to get the titles on top or below the movies.

Anyhow, awesome job Stuart!

I'm very happy with this! It simply brilliant :-0 you are truly amazing!

Stuart Greenfield’s picture

I'll look at JW tonight - I'm sure it is (or at least, was!) working locally for me, but I'll check. To re-create your set up, you were adding a single file to the JW player from views? With a splash image?

JW5 player will work happily with JW4 module - most of the configuration is the same, so it pretty much just works with the existing SWF Tools module.

nyleve101’s picture

@patmarkus

Hi, not sure if you still want to use jw player but below is the code i used for my views and node templates to get the preview images to work. You'll need to change the fields and of course change the image cache preset so that it matches your own.

Resource: http://drupal.org/node/678630

Node.tpl.php

    // Displays the media player with an Imagefield preview and the Play icon turned off
      print swf($node-> field_video_advert [0]['filepath'],
        array(
        'params' => array('width' => '300', 'height' =>'300'),
        'flashvars' => array(
          'image' => 'activity_event_images/' . ($node-> field_image_product [0]['filename']),
          'icons' => 'false')
       ));
  

Views template, in my case: views-view-field--field-video-advert-fid.tpl.php

// $Id: views-view-field.tpl.php,v 1.1 2008/05/16 22:22:32 merlinofchaos Exp $
/**
  * This template is used to print a single field in a view. It is not
  * actually used in default Views, as this is registered as a theme
  * function which has better performance. For single overrides, the
  * template is perfectly okay.
  *
  * Variables available:
  * - $view: The view object
  * - $field: The field handler object that can process the input
  * - $row: The raw SQL result that can be used
  * - $output: The processed output that will normally be used.
  *
  * When fetching output from the $row, this construct should be used:
  * $data = $row->{$field->field_alias}
  *
  * The above will guarantee that you'll always get the correct data,
  * regardless of any changes in the aliasing that might happen if
  * the view is modified.
  */

// Get file ids

$fid_video = $row->{$field->field_alias};

// Find real field alias for image field

$fid_image = false;

$suffix = "field_image_product_fid";

foreach($row as $key => $val)
    if (substr($key, -1*strlen($suffix)) == $suffix)
        $fid_image = $val;

// If we got some data, display it.

if (!empty($fid_video) || !empty($fid_image))
{
    $node = (object)array();

    $node->field_video_advert[0] = field_file_load($fid_video);
    $node->field_image_product[0] = field_file_load($fid_image);

    // Check if we got an image

    if ($node-> field_video_advert[0]['filepath']!='')
    {
    
     // Displays the media player with an Imagefield preview and the Play icon turned off
     print swf($node-> field_video_advert [0]['filepath'],
        array(
        'params' => array('width' => '210', 'height' =>'180'),
        'flashvars' => array(
          'image' => 'activity_event_images/' . ($node-> field_image_product [0]['filename']),
          'icons' => 'false')
       ));
    }
    else
      print theme('imagecache', 'product_image', $node->field_image_product[0]['filepath']);
}   

Hope all is well!

Evelyn

patmarkus’s picture

hi Evelyn,

Thanks for that.

For now I am not going to screw around with the code.

I'll just wait a bit and see if stuart resolves this is the final version.

Thanks for the suggestion though!

simon_s’s picture

@Evelyn
Thanks a lot for your code snippets!

nodiac’s picture

I couldn't get the above code to work with views. I needed to create a featured video for the front page of the site, to be used with a flag.

Here's the problem with the above code, exerpted below:

<?php
// Displays the media player with an Imagefield preview and the Play icon turned off
     print swf($node-> field_video_advert [0]['filepath'],   // <------- won't work in views!
        array(
        'params' => array('width' => '210', 'height' =>'180'),
        'flashvars' => array(
          'image' => 'activity_event_images/' . ($node-> field_image_product [0]['filename']),  // <----- Here there be drrrrragons!!
          'icons' => 'false')
       ));
    }
?>

This works on the full node view, but not on a views view because views doesn't have access to $node unless you do a node_load() in the template, which might have been expedient but felt dumb.

You could set the field display format to 'path to file' but that starts at 'sites/default' and not at 'files' where SWFTools is looking for it. What you want is just the filename, with no silly html business around it.

It turns out that you CAN get just the filename in views, but it isn't obvious.

When you're configuring the 'thumbnail' field, check 'strip html tags', then under format, choose 'generic files' from the dropdown. It's the very first choice, and it doesn't always show, depending on where the bottom of your browser window is.

Then in your template file:

<?php
    <div class="embedded-video">
      <?php print swf($fields['field_video_file_fid'] -> content,       // <----- This is how the video file is addressed in polite company
        array(
          'params' => array('width' => '510', 'height' =>'383'),
          'flashvars' => array(
          'image' =>  'thumbnails/' . $fields['field_thumbnail_fid'] -> content,       // <----- Here be the magic!
          'icons' => 'false')
          )
        ); ?>
    </div> <!-- /embedded-video -->
?>

...where 'thumbnails/' is the directory within the 'files' folder. 'field_thumbnail' is the field within the content type. $fields['field_thumbnail_fid'] -> content is how you can call this field from a template file.

The video field - the field representing the actual video file, is set to 'Path to file' in the field format for views. The field name in this case is 'field_video_file'.

I really hope that this saves someone some time.