latest stable versions: v150827 (changelog)

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Jw Player New code conflict

Home Forums Community Forum Jw Player New code conflict

This topic contains 5 replies, has 4 voices. Last updated by  DrByte 4 years, 6 months ago.

Topic Author Topic
Posted: Tuesday May 15th, 2012 at 10:59 am #13523
DrByte
Username: DrByte

Hi Jason

Thank you for the Updates. There is an issue with the new JW Code and W3 (W3 Total Cache)

I tried couple of things but came empty. I am sure it’s w3 issue but i can’t find it. It may be in the w3 config file since the error is being generate in there.

Fatal error: Cannot use object of type W3_Config as array

Thanks

Sam

List Of Topic Replies

Viewing 5 replies - 1 through 5 (of 5 total)
Author Replies
Author Replies
Posted: Wednesday May 16th, 2012 at 4:34 am #13641

Thanks Sam!

I’m emailing Jason about it now so he looks at it.

Posted: Thursday May 17th, 2012 at 6:56 pm #13819
Staff Member

Thanks for reporting this important issue Sam.

It sounds like a conflict in the global namespace. You can try changing references to $config, in the JW Player code sample, to something like $s2_jw_config, just to keep things separated better. I’ll have this updated in the next maintenance release, in an effort to avoid issues like this.

Posted: Friday May 18th, 2012 at 12:55 am #13844
DrByte
Username: DrByte

Perfect, thank you Jason

As Always, the BEST

Sam

Posted: Thursday Jun 14th, 2012 at 4:45 pm #16510
webierweb
Username: joec

I have been looking all over to find a solution for adding a thumbnail to the beginning of videos that are hosted through s2 and jw player….

I imagine that it would be something related to

$s2_jw_config[“jwplayer”]

…maybe a line that is entered after this part of the code…..no idea though.

Please help me to figure this out….thanks again guys!

Posted: Friday Jun 15th, 2012 at 8:19 am #16581
DrByte
Username: DrByte

If your host allows you to run PHP scripts and if your host will allow you to install ffmpeg, you can use this script to request any frame of the video file to use as the preview image.

s1.addVariable('image', 'http://my.domain.com/path-to-file/ffmpeg_image.php?file=video.flv&time=00:00:00&browser=false');

ffmpeg_image.php

<?php

// generate a preview image from an FLV file on-the-fly, or to save
// Will - 10-16-07
// call with: ffmpeg_image.php?file=video.flv&time=00:00:05&browser=true
// call with: ffmpeg_image.php?file=video.flv&percent=75.3&browser=true
// no time defaults to "00:00:00" (first frame), no browser defaults to "true"

$videofile = (isset($_GET['file'])) ? strval($_GET['file']) : 'video.flv';
$image = substr($videofile, 0, strlen($videofile) - 4);

// debug ("    File: ", $videofile);
// debug ("   Image: ", $image);

$time = (isset($_GET['time'])) ? strval($_GET['time']) : '00:00:00';

// check time format
if (!preg_match('/\d\d:\d\d:\d\d/', $time))
{
  $time = "00:00:00";
}

// debug ("    Time: ", $time);

if (isset($_GET['percent']))
{
  $percent = $_GET['percent'];

 
// debug (" Percent: ", $percent);

 
ob_start();
  passthru("ffmpeg.exe -i \"". $videofile . "\" 2>&1");
  $duration = ob_get_contents();
  ob_end_clean();

 
// debug ("Duration: ", $duration);

 
preg_match('/Duration: (.*?),/', $duration, $matches);
  $duration = $matches[1];

 
// debug ("Duration: ", $duration);

 
$duration_array = split(':', $duration);
  $duration = $duration_array[0] * 3600 + $duration_array[1] * 60 + $duration_array[2];
  $time = $duration * $percent / 100;

 
// debug ("    Time: ", $time);

 
$time = intval($time/3600) . ":" . intval(($time-(intval($time/3600)*3600))/60) . ":" . sprintf("%01.3f", ($time-(intval($time/60)*60)));

 
// debug ("    Time: ", $time);

}

$browser = (isset($_GET['browser'])) ? strval($_GET['browser']) : 'true';

// debug (" Browser: ", $browser);

if ($browser == "true")
{
  header('Content-Type: image/png');
  passthru("ffmpeg.exe -vcodec png -i \"" . $videofile . "\" -ss " . $time . " -vframes 1 -f image2 -");
}
else
{
  passthru("ffmpeg.exe -vcodec png -i \"" . $videofile . "\" -ss " . $time . " -vframes 1 -f image2 \"" . $image . "\"%d.png");
}

function
debug($text1, $text2)
{
  print "<pre>\n";
  print $text1 . $text2 . "\n";
  print "</pre>\n";
}

?>
Viewing 5 replies - 1 through 5 (of 5 total)

This topic is closed to new replies. Topics with no replies for 2 weeks are closed automatically.

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Contacting s2Member: Please use our Support Center for bug reports, pre-sale questions & technical assistance.