Hi,

I have the following in mind:

In the node, i have filefields and imagefields and settings that define the content and looks of the jwplayer.

now, i create a computedfield that creates a [jwplayer] tag, where the values of the other node fields are used to compose the optional fields for the player.

however, when i view the node, the [jwplayer] tag is rendered as text, and it's not converted into the actual player.
when i copy/paste the same [jwplayer] tag into the node body text, the jwplayer is created.

is there a way to use computedfield to create the jwplayer.
or is there another way to create the jwplayer and have the node fields as file and image tags for the [jwplayer]?

thanks a lot!
Gerbrand

Comments

JW Player’s picture

Hi gerbrand,

That sounds like a cool way of using the player. At this time I'm not sure of how that would be done, but I'll definitely research the possibility for the next release.

Thanks,
Cameron

gerbrand’s picture

Hi Cameron,

ok thanks for your enthousiasm. I will keep checking this issue list and if I find the way to accomplish what I described, I'll share it here.

Best,
Gerbrand

xurizaemon’s picture

I suspect you want to theme the output of your computed field so that it runs the code from jwplayer_nodeapi().

I probably wouldn't even bother with computed field myself - instead I'd just create a template for that field, and use theme('jwplayermodule_render_player', $config, $flashVars); in your node or field template -

Eg this minimal code works (you'll need to change $config to match your JWPlayer config name) -

$config='Default' ;
$flashVars=array( 'file' => 'http://www.mediacollege.com/video-gallery/testclips/barsandtone.flv' );
print theme('jwplayermodule_render_player', $config, $flashVars);
 

So from there you can set additional values in $flashVars to provide the various settings you've added via CCK.

btopro’s picture

Works like a charm as embedded in my content type specific theme. thank you so much for this snippet, I was having trouble getting this worked out. This should be in documentation somewhere

JW Player’s picture

Yeah, he could definitely use the theme function in this case. However, I believe the OP was interested in having the tag itself be replaced with the Player which the module currently doesn't do in computed fields.

JW Player’s picture

Status: Active » Closed (fixed)
hanno’s picture

Title: embed jwplayer not from node body content, but from completed field » embed jwplayer not from node body content, but from computed field

changed title slightly

hanno’s picture

@grobot pro for using computed field and not the theme itself is that the configuration sticks when changing your template. Even better would be to be able to use cck media file field or a variant.

caponey’s picture

I would like to use this in CCK as well, mostly just so we could use the code as a default value and not have to enter it in every time.

We need to use php to check if user is logged in or not, and display the agegate plugin if they are not. I just get the JPlayer tags as text, same as gerbrand.