latest stable versions: v130513 (changelog)

s2Member® Forums

The Customers Forum is only for paying customers.
~ We also have a free/open Community Forum.

Troubleshooting Tips

Customer support for products by s2Member® is available only through your account at s2Member.com, which grants you access to our Customers Forum. We also have public Community Forum available to all site owners (no purchase required). For further details, please read our Support Policy, which includes a list of things that we will support, and also some things that we will NOT support. Please read this before posting.

We ask that you submit all pre-sale and/or technical support questions through the appropriate support forum at s2Member.com. If you are a paid customer, an s2Member® support representative will gladly address your question/concern within 24-48 hours; excluding all major holidays. Thank you!

For troubleshooting assistance, please read this article.

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 11 months, 1 week ago.

Topic Author Topic
Posted: Tuesday May 15th, 2012 @ 10:59 am #13523
DrByte
s2Member® Pro (Paid Customer)
Paid Customer
HelpfulAdvancedUpgrade

Hi Jason

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

<?php
// Configuration.
$config["jwplayer"] = "/jwplayer/"; // Relative URL path to JW Player files directory.
$config["mp4_video_file_name"] = "video.mp4"; // Name of your MP4 test file.
// Don't edit anything else below unless you know what you're doing.
?>

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 @ 4:34 am #13641
Cristián
Official s2Member® Support Rep
Support Rep
HelpfulExperiencedCertified

Thanks Sam!

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

Posted: Thursday May 17th, 2012 @ 6:56 pm #13819
Jason (Lead Developer)
Official s2Member® Support Rep
Support Rep
HelpfulExperiencedCertified

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 @ 12:55 am #13844
DrByte
s2Member® Pro (Paid Customer)
Paid Customer
HelpfulAdvancedUpgrade

Perfect, thank you Jason

As Always, the BEST

Sam

Posted: Thursday Jun 14th, 2012 @ 4:45 pm #16510
JC
s2Member® Pro (Paid Customer)
Paid Customer

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 @ 8:19 am #16581
DrByte
s2Member® Pro (Paid Customer)
Paid Customer
HelpfulAdvancedUpgrade

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)

You must be logged in to reply to this topic.

If you're a paying customer, please use our Customers Forum. We also have a public Community Forum available to all site owners (no purchase required). You can register here (it's free). For further details, please read through our Support Policy.