Hi,
I dont understand how the jwplayermodule works with Views?

In a single node the video is correctly shown with the JW Player.

But if I'm using Views to represent the same video only the playercode is shown in the field
i.E. [jwplayer|config=myplayer|file= path-to-my-film.mov|image= path-to-my-image.jpg]
but not the player with the clip.

I'm using fields.
Do I need another special setting to get jwplayermodule working with Views?

Comments

JW Player’s picture

Hi quixxel,

The tag only works with nodes at the moment. However, the module does make available a theme function which will generate the javascript you would need to insert into your view.

An example looks like the following:

<?php
  $flash_vars = array(
    'file' => 'your/video.mp4', 
    'image' => 'your/preview.jpg'
  );
  print theme("jwplayermodule_render_player", "your_custom_player", $flash_vars);
?>

If you need anymore help setting it up, just let me know.

Thanks.

verta’s picture

Assigned: quixxel » Unassigned

How about using a view that creates an XML feed of your video nodes and use that as a playlist. If you have Views Bonus you have XML as a view format. Found this online: https://elearning.psu.edu/elearning/using-drupal-generate-jwplayer-frien...

verta’s picture

Issue tags: +views support

(adding a tag)

verta’s picture

So, here is my plan, set up a video content type with an emfield, and create a view on it that has an RSS feed (need Views Bonus to enable that kind of display on the view).

Create a new node of an article/page/story type and put the JWPlayer tag in it, with the path to the RSS feed coming out of the view as the playlist.

Feasible?

JW Player’s picture

@verta,

That should work. It actually sounds reminiscent of http://drupal.org/project/xspf_playlist which I believe works with the JW Player Module. Although in his case, he's using a new content type to represent the playlist.

JW Player’s picture

Status: Active » Needs work
artatum’s picture

Hi
1)
If i use your code 'print theme... from above,
print theme("jwplayermodule_render_player", "player.swf", $flash_vars);
where I replaced "your_custom_player" by "player.swf"
I got :

warning: simplexml_load_file() [function.simplexml-load-file]: I/O warning : failed to load external entity "modules/jwplayermodule/configs/player.swf.xml" in C:\wamp\www\t3

...whatever I use for replacement!
This place "your_custom_player" is not supposed to wait for an xml feed !!!
dont copy...
2)Secondly, as I'm in Views, how to pass over in $flash_vars the xspf feed I built in the same view ?
file =' ???
thx

alex72rm’s picture

Version: 6.x-1.1 » 6.x-1.4
Status: Needs work » Closed (works as designed)

It works great!

Add a phpcode field:

$static = $this->view->display_handler->get_handlers('field');
$flash_vars = array(
    'file' => $static['field_video2_fid']->last_render, 
    'image' => $static['field_video2_thumbnail_1']->last_render,
  );
print theme("jwplayermodule_render_player", "sample", $flash_vars);  
dilipvertical’s picture

where to add jwplayermodule_render_player