Hi,

I'm currently using JW Media Player via the SWF Tools module and would like to switch to this module. At present i'm creating the player in my nodes by using the code below and referencing my file field. Would it be possible to do this with the JW Player Module?

    // 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')
       ));
  

Any advice is appreciated!

Thanks,

Evelyn

CommentFileSizeAuthor
#2 video not working.png103.46 KBnyleve101

Comments

JW Player’s picture

Hi Evelyn,

There are two ways I can think of off the top of my head to do this. The first is to use the theme function the module provides. The function theme_jwplayermodule_render_player takes in the config (the name of your custom player) and an array of flashvars. So in your case you would pass in an array something like this:

<?php
  $flash_vars = array(
    'file' => $node->field_video_advert [0]['filepath'], 
    'image' => 'activity_event_images/' . ($node-> field_image_product [0]['filename']), 
    'icons' => 'false'
  );
  print theme("jwplayermodule_render_player", "custom_player", $flash_vars);
?>

The other way is to dynamically create the jwplayer embed tag. So something like the following:

<?php
  $output = "[jwplayer|config=custom_player|file=" . $node->field_video_advert [0]['filepath'] . "|image=" . 'activity_event_images/' . ($node-> field_image_product [0]['filename']) . "|icons=false]";
  print $output;
?>

If you have any problems just let me know.

Hope this helps!

nyleve101’s picture

StatusFileSize
new103.46 KB

Hi,

Thanks for getting back to me- it's much appreciated!

At the moment the I keep getting the error in the screenshot where the video is supposed but hopefully we'll be able to get to the bottom of this soon.

Thanks again!

Evelyn

nyleve101’s picture

Hi Longtail,

thanks for the code unfortunately it doesn't seem to be working. The only thing that happens is that the player loads the 'video not found or access denied' message shown in the screenshot attached above. To test the issue I switched back to using jwplayer using swftools and everything worked again.

Could you provide any further help please? I like swftools but I'd really like to use this module so i can purchase some extra plugins.

Hope all is well.

Thanks,

Evelyn

nyleve101’s picture

Hi,

in case anyone else needs it the code below did the trick:

global $base_path;
     $flash_vars['file'] = $base_path . $node->field_video_advert [0]['filepath'];
     $flash_vars['image'] = imagecache_create_url('product_pic', $node->field_image_product[0]['filepath']);
     print theme("jwplayermodule_render_player", 'ILivedToday', $flash_vars);  

just put in your own fields and imagecache presets.

hope you're well and taking care of yourselves,

Evelyn

JW Player’s picture

Hi Evelyn,

Sorry for the delay in responding. Glad to see you got it working!

Looks like using imagecache_create_url('product_pic', $node->field_image_product[0]['filepath']); instead got it to work.

If you have any more issues just let me know.

Thanks.

nyleve101’s picture

Hi,

I just purchased a commercial player with the facebook and twitter plugins but I can't seem to get it to work.

1. I've changed player-licenced.swf to player.swf and put this along with the yt.swf in the module folder.

2. I've enabled the dock and also the respective plugins on the jw configuration page.

However, the player still appear as an unlicenced player without the plugins. Could you provide any guidance? I am using the code below to print the player from my node tpl.

global $base_path;
if (isset($node))
{

    // Displays the media player with an Imagefield preview

    if ($node-> field_video_advert[0]['filepath']!='')
    {
     $flash_vars['file'] = $base_path . $node->field_video_advert [0]['filepath'];
     $flash_vars['image'] = imagecache_create_url('utube_product_pic', $node->field_image_product[0]['filepath']);
     print theme("jwplayermodule_render_player", 'ILivedToday', $flash_vars);
    }
    else
      print theme('imagecache', 'product_pic', $node->field_image_product[0]['filepath']);
}

Any help is appreciated!

Evelyn

JW Player’s picture

Hi Evelyn,

Do you have a test page I could look at? Seeing the code and the page in action should help me to debug your issue.

Thanks.

nyleve101’s picture

Hi,

thanks for getting back to me. You can see an example on this page http://ilivedtoday.com/content/hampton-court-kayaking-tour

Thanks again!!

Evelyn

nyleve101’s picture

Hi Longtail,

any luck? I'm very eager to get the plugins working!

Thanks,

evelyn

JW Player’s picture

Hi Evelyn,

I just took a look at your test page. I'm seeing the Licensed Player with twitter and facebook in the dock. Did you change anything?

If you're still not seeing the plugins try clearing your browser cache. Your browser may have cached the config XML file with your old settings in it.

Thanks.

nyleve101’s picture

Problem solved! Thanks again for your help!

Evelyn

JW Player’s picture

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

Priority: Normal » Major
Status: Closed (fixed) » Active

hi!
ok, i have used the code from nyleve101 and it works! thank you!
but now, same problem, it seems that plugins are not working.
i have tried with facebook plugin and hd plugin. i don't see them, i have tried cleaning my web cache but nothing.
for hd plugin than i was triyng to use filefield for that also, so my code was:

<?php
global $base_path;
$flash_vars['file'] = $base_path . $node->field_videojw [0]['filepath'];
$flash_vars['image'] = imagecache_create_url('videoj', $node->field_immjw[0]['filepath']);
$flash_vars['hd.file'] = $base_path . $node->field_hdjw [0]['filepath'];
print theme("jwplayermodule_render_player", 'plaier', $flash_vars);  
?>

it's that possibly corect?

third: strange thing but there isn't the watermak in my videos!!

to se a trial: http://sanbanet.it/drupal/prova

save me! thank you!

michel3’s picture

Priority: Major » Normal
JW Player’s picture

@michel3,

It appears that you're using the JW 4.0 player. This module was actually designed to use the version 5.0 and higher JW Player. That is likely why a lot of your configuration options aren't working.

Thanks.

michel3’s picture

thank you longtail,
well i tried using jw5 but with same result (maybe for caching problem, i don't know), but if i put the player.swf on the main directory of my site and not under the modules/jwplayermodule (changing the path in the framework.php) it works!

it works also the code for the hd.file with filefield! Yep!

thank you for the help and for this preciuos module, can't wait for the html5 support!

michel3’s picture

uh, i was thinking, can i put a plugin on my own server? i need a translation for the caption plugin (change the image for the dock icon), so i was thinking to translate it and put on my server, but how i direct the player to "see" it on my server? it is that possible?

michel3’s picture

well, i answer myself: it is possible in skinning option,
this is a incredible and usable tool!

amazing!

JW Player’s picture

@michel3,

Glad to hear that it's working for you.

Thanks.

michel3’s picture

well, hi everyone,

how can i get html5 support with the code in node.php.tpl?
re-copy the code i'm using:

<?php
global $base_path;
$flash_vars['file'] = $base_path . $node->field_videojw [0]['filepath'];
$flash_vars['image'] = imagecache_create_url('videoj', $node->field_immjw[0]['filepath']);
$flash_vars['hd.file'] = $base_path . $node->field_hdjw [0]['filepath'];
print theme("jwplayermodule_render_player", 'plaier', $flash_vars);  
?>

so, what var for the html5 player?

JW Player’s picture

You shouldn't really need to do anything special. If HTML5 is necessary the player should switch to it automatically.

Are you seeing any errors?

Thanks.

michel3’s picture

mmm well,
so it simply doesn't work.
video works just fine with flash player, but it doesn't go to html5 in iPad o iPhone. videos are in mp4

so i haven't to tell jwplayer where is the html5 file?

JW Player’s picture

@michel3

Can you provide a link to where it is failing?

Thanks.

michel3’s picture

Thank you,

Http://www.webtv-trento.it

JW Player’s picture

@michel3,

The issue seems to be the result of jwplayer.js being present. This is required for the HTML5 fallback. You'll need to get this file from the JW Player download .zip.

The flash player works since the plugin uses swfobject.js loaded from google if jwplayer.js isn't present.

Thanks.

michel3’s picture

ok, i'm an idiot.

it works!!!!!!

thank you!! great job!

nyleve101’s picture

Hi,

which version of jw player would be required for HTML 5 support?

Thanks for your help!

Evelyn

JW Player’s picture

Hi Evelyn,

5.3 would be the absolute minimum version, however I would recommend 5.5 or higher.

Thanks.

nyleve101’s picture

Thank you!