pass a dynamic Flashvar to JW Media player ?

upupax - July 27, 2008 - 18:23
Project:jQuery Media
Version:6.x-1.4-beta1
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:active
Description

I was creating a block with most recent media uploaded, so I guess it would be great to be able to view the first image of every movie in teaser linked to node!
I don't know if it can be possible..

#1

com2 - October 15, 2008 - 15:31

subscribe

#2

com2 - October 16, 2008 - 08:27
Version:6.x-1.3» 6.x-1.4-beta1
Category:feature request» support request

I discovered this post and I was wondering if anybody implemented this one using jQuery Media and could show us how he/she did it. Or someone could may be give me a hint how to do it. May be put the code in the default.js file? How would a sample default.js file look like?

#3

artscientific - November 19, 2008 - 06:20

would be interested in this as well
-Peter

#4

guix - June 24, 2009 - 18:52
Title:Preview» pass a dynamic Flashvar to JW Media player ?
Category:support request» feature request

For those using JW Media player, at the moment it does not do it. There are two things that need to be done :
- render the picture of the preview from the .flv
- make jQuery Media pass that picture to the player as a Flashvar

For the first issue, I'm not so interested since I anyway have an Imagefield which is a chosen snapshot of the .flv (not the first frame). Also, it depends on the flash player. So if you're using another flash player, and that it provides the option, everything should work for you ? Anyway this does not depend on Drupal. The only way Drupal could do it would be with access to ffmpeg I guess, which is not an issue in jQuery Media.

For the second issue, let's say we have the image URL, but it changes for every video of course, so passing a static "image" Flashvar would not work. Any way to pass a dynamic variable like $node->field_imagefield[0]['filepath'] ?

#5

danieldembach - July 22, 2009 - 13:38

I am using JW player currently with an imagefield like this:

drupal_add_js("$(document).ready(function() {
          $('a.video').media( {
            width: ". $node->field_video_width[0]['value'] .",
            height: ". $node->field_video_height[0]['value'] .",
            flashvars: { image: '" . base_path() . $node->field_video_still[0]['filepath'] ."' }
          } );
        });", 'inline');

This way, I can set video width and height and upload a still image for my videos.

YMMV and please remember: The above code is pasted straight from a q&d prototype.

#6

guix - July 22, 2009 - 16:21

How could I miss that ? Thanks a lot Daniel !!!

If someone else wants to use this, in the jQuery Media settings you must NOT have the .video class in Classes > Media > Media class , this code does it. Or fully disable Auto-invoke Media class.

#7

jlevis - July 30, 2009 - 16:13

Hey Daniel, where do you put that code?

#8

Stickee - August 1, 2009 - 15:19

Subscribed as well. Would love to see this feature.

#9

tekyTris - September 18, 2009 - 14:44

I've been looking for a fix for just adding a preview image in for videos.

Code should look like

<swf file="productvideos/superscan11-short_VP6_CDwide.flv" flashvars="image=decpreview.jpg">

rather than

<swf file="productvideos/superscan11-short_VP6_CDwide.flv" image="decpreview.jpg">

and we're done ;)

Creating the equivilant for a node type should be nice and easy too.

Just have new content type, with 2 cck fields. File src & image. Use contemplate for ease of use and add the script into the template for that node type. Something along the lines of..

<swf file="<?php print $node->field_video[0]['filepath']; ?>"  flashvars="image=<?php print $node->field_video_still[0]['filepath']; ?>">

..for your content type and bobs your aunts husband.

That should work fine for you.

 
 

Drupal is a registered trademark of Dries Buytaert.