Got an error -> Get flash player to this this player.

93 views
Skip to first unread message

Julien

unread,
Jan 27, 2011, 8:01:31 AM1/27/11
to Simple Video Flash Player Module
Hello there,

I just installed your Video Player. I tried to link to a .mp4 file but
I got this error in the front end :

Get the Flash Player to see this player.

What can I do with this error ?

Thank you

Regards

Julien

unread,
Jan 27, 2011, 8:42:01 AM1/27/11
to Simple Video Flash Player Module
I must add : here is the the error I get in firebug :

unterminated string literal
s1.addParam("flashvars","file=images/stories/videos/
cisel_golf_web.mp4
index....emid=60 (ligne 163)

And just after this in the source code I get :

s1.addParam("flashvars","file=images/stories/videos/cisel_golf_web.mp4
164Notice: Undefined variable: preview in /srv/www/vhosts/www.cisel.ch/
web/modules/mod_simple_video_flash_player/
mod_simple_video_flash_player.php on line 161
165
166Notice: Undefined variable: logo in /srv/www/vhosts/www.cisel.ch/
web/modules/mod_simple_video_flash_player/
mod_simple_video_flash_player.php on line 161
167
168Notice: Undefined variable: link in /srv/www/vhosts/www.cisel.ch/
web/modules/mod_simple_video_flash_player/
mod_simple_video_flash_player.php on line 161
169
170Notice: Undefined variable: repeat in /srv/www/vhosts/www.cisel.ch/
web/modules/mod_simple_video_flash_player/
mod_simple_video_flash_player.php on line 161
171
172Notice: Undefined variable: shuffle in /srv/www/vhosts/www.cisel.ch/
web/modules/mod_simple_video_flash_player/
mod_simple_video_flash_player.php on line 161
173
174Notice: Undefined variable: autostart in /srv/www/vhosts/
www.cisel.ch/web/modules/mod_simple_video_flash_player/mod_simple_video_flash_player.php
on line 161
175&controlbar=bottom
176Notice: Undefined variable: skin in /srv/www/vhosts/www.cisel.ch/
web/modules/mod_simple_video_flash_player/
mod_simple_video_flash_player.php on line 161
177
178Notice: Undefined variable: plugins in /srv/www/vhosts/www.cisel.ch/
web/modules/mod_simple_video_flash_player/
mod_simple_video_flash_player.php on line 161

Maybe this helps you to fix my install

Thank you

Regards
Message has been deleted

Julien

unread,
Jan 27, 2011, 8:48:51 AM1/27/11
to Simple Video Flash Player Module
Here is the whole <script> tag :

<script type="text/javascript">
window.addEvent('domready', function(){
var s1 = new SWFObject("http://www-test.cisel.ch/web/modules/
mod_simple_video_flash_player/
miniplayer.swf","ply1","500","300","6","#FFFFFF");
s1.addParam("allowfullscreen","true");
s1.addParam("allowscriptaccess","always");
s1.addParam("wmode","opaque");
s1.addVariable("width");
s1.addVariable("height");
s1.addParam("flashvars","file=images/stories/videos/
cisel_golf_web.mp4
Notice: Undefined variable: preview in /srv/www/vhosts/www.cisel.ch/
web/modules/mod_simple_video_flash_player/
mod_simple_video_flash_player.php on line 161

Notice: Undefined variable: logo in /srv/www/vhosts/www.cisel.ch/web/
modules/mod_simple_video_flash_player/
mod_simple_video_flash_player.php on line 161

Notice: Undefined variable: link in /srv/www/vhosts/www.cisel.ch/web/
modules/mod_simple_video_flash_player/
mod_simple_video_flash_player.php on line 161

Notice: Undefined variable: repeat in /srv/www/vhosts/www.cisel.ch/
web/modules/mod_simple_video_flash_player/
mod_simple_video_flash_player.php on line 161

Notice: Undefined variable: shuffle in /srv/www/vhosts/www.cisel.ch/
web/modules/mod_simple_video_flash_player/
mod_simple_video_flash_player.php on line 161

Notice: Undefined variable: autostart in /srv/www/vhosts/www.cisel.ch/
web/modules/mod_simple_video_flash_player/
mod_simple_video_flash_player.php on line 161
&controlbar=bottom
Notice: Undefined variable: skin in /srv/www/vhosts/www.cisel.ch/web/
modules/mod_simple_video_flash_player/
mod_simple_video_flash_player.php on line 161

Notice: Undefined variable: plugins in /srv/www/vhosts/www.cisel.ch/
web/modules/mod_simple_video_flash_player/
mod_simple_video_flash_player.php on line 161
");
s1.write("videoplayer1");
});
</script>

This seems to me that there is undefined variables in the php code, so
that the PHP error messages gets injected and messes up with the
javascript code, hence the "Unterminated string litteral".

Thank you for support

Julien

unread,
Jan 27, 2011, 9:27:52 AM1/27/11
to Simple Video Flash Player Module
Okay I have found a solution for that bug. Here is the edited PHP code
that will work :

<?php
/**
* Joomla
* Author : www.time2online.de
* Email: in...@time2online.de
* Module: Simple Video Flash Player Module
* Version: 1.6.1
*
* JW Player
* Author : Jeroen Wijering
* ULR: http://www.longtailvideo.com/players/jw-flv-player/
* Version: 5.2
*
* # Simple Video Flash Player Module #
* For download and demo and documentation use http://www.time2online.de.
*
* # JW Player License #
* Below you see a simple embedded example of the JW Player!
* Licensing: The player is licensed under a http://creativecommons.org/licenses/by-nc-sa/2.0/
Creative Commons License. It allows you to use, modify and
redistribute the script, but only for noncommercial purposes.
*
* For corporate use, http://www.longtailvideo.com/players/order Order
commercial licenses please apply for a commercial license.
**/

// no direct access
defined( '_JEXEC' ) or die( 'Restricted access' );

/** Embed parameters **/
// source
$player_variant = $params->get('player_variant', '');

if ($params->get('player_variant')){
$player_variant = $params->get('player_variant', '');
$player = $player_variant.'.swf';
}

// height
$height =$params->get('height', '');

// width
$width = $params->get('width', '');

// count
$count = $params->get( 'count', '');

// version
$version = $params->get( 'version', '');

// background color
if ($params->get('background_color')){
$background_color = $params->get( 'background_color');
} else {
$background_color = '#FFFFFF';
}




/** File properties **/
// file
$video_url = $params->get('video_url', '');

// image
if ($params->get('preview_url')){
$preview_url = $params->get('preview_url', '');
$preview = '&image='.$preview_url;
}
else {
$preview = '';
}

// fallback image
if ($params->get('fallbackimage_url')){
$fallbackimage_url = $params->get('fallbackimage_url', '');
$fallback = '<img src="'.$fallbackimage_url.'" alt="" />';
}
else {
$fallback = '<p><a href="http://www.macromedia.com/go/
getflashplayer">Get the Flash Player</a> to see this player.</p>';
}

// link
if ($params->get('link_url')){
$link_url = $params->get('link_url', '');
$link = '&link='.$link_url.'&displayclick=link';
}
else {
$link = '';
}


/** Layout **/
// controlbar
if ($params->get('controlbar_position')){
$controlbar_position = $params->get('controlbar_position', '');
$controlbar = '&controlbar='.$controlbar_position;
}

// logo
if ($params->get('logo_url')){
$logo_url = $params->get('logo_url', '');
$logo = '&logo='.$logo_url;
}
else {
$logo = '';
}

// playlist
$playlist_url = $params->get('playlist_url', '');

if ($params->get('playlist_url')){

$playlist_position = $params->get('playlist_position', '');

// playlistsize
if ($params->get('playlist_size')){
$playlist_size = $params->get('playlist_size', '');
$playlist_size = '&playlistsize='.$playlist_size;
}

$video = $playlist_url.'&playlist='.$playlist_position.
$playlist_size;
}
else {
$video = $video_url;
}

// skin
if ($params->get('skin_url')){
$skin_url = $params->get('skin_url', '');
$skin = '&skin='.$skin_url;
}
else {
$skin = '';
}


/** Behaviour **/
// autostart
if ($params->get('autostart')){
$autostart = "&autostart=true";
}
else {
$autostart = '';
}

// repeat
if ($params->get('playlist_repeat')){
$playlist_repeat = $params->get('playlist_repeat', '');
$repeat = '&'.$playlist_repeat;
}
else {
$repeat = '';
}

// shuffel
if ($params->get('playlist_shuffle')){
$playlist_shuffle = $params->get('playlist_shuffle', '');
$shuffle = '&'.$playlist_shuffle;
}
else {
$shuffle = '';
}


/** External Communication **/
// plugins
if ($params->get('plugin_id')){
$plugin_id = $params->get('plugin_id', '');
$plugins = '&plugins='.$plugin_id;
}
else {
$plugins = '';
}

?>

<script type="text/javascript" src="<?php echo JURI::base();;?>modules/
mod_simple_video_flash_player/swfobject.js"></script>
<div id="videoplayer<?php echo $count ?>"><?php echo $fallback ?></
div>
<script type="text/javascript">
window.addEvent('domready', function(){
var s<?php echo $count ?> = new SWFObject("<?php echo JURI::base();;?
>modules/mod_simple_video_flash_player/<?php echo $player ?>","ply<?
php echo $count ?>","<?php echo $width ?>","<?php echo $height ?>","<?
php echo $version ?>","<?php echo $background_color ?>");
s<?php echo $count ?>.addParam("allowfullscreen","true");
s<?php echo $count ?>.addParam("allowscriptaccess","always");
s<?php echo $count ?>.addParam("wmode","opaque");
s<?php echo $count ?>.addVariable("width");
s<?php echo $count ?>.addVariable("height");
s<?php echo $count ?>.addParam("flashvars","file=<?php echo $video ?
><?php echo $preview ?><?php echo $logo ?><?php echo $link ?><?php
echo $repeat ?><?php echo $shuffle ?><?php echo $autostart ?><?php
echo $controlbar ?><?php echo $skin ?><?php echo $plugins ?>");
s<?php echo $count ?>.write("videoplayer<?php echo $count ?>");
});
</script>
<div style="display:none;">time2online Extensions: <a href="http://
www.time2online.de">Simple Video Flash Player Module</a></div>

The error will happen if you have "display php errors" on your server
and you dont set some variables in the module backend. The code would
return "undefined variable" warnings, messing up with the javascript
code so here is my fix. I have setted blank variables in case they are
not set in the backend module configuration.

Hope it will help.

Regards
Reply all
Reply to author
Forward
0 new messages