Hiya,
I'm trying to setup SWF Tools to work correctly, but is seems no matter what I do, it doesn't want to cooperate. I'm new to drupal and this site, so if someone has already raised this, please forgive me.
If I enable the javascript replacement for embedding, when looking at the page source I notice (in the head of the page):
(This is using a php node)
<?php print swf('remotetv_VP6_384K.flv'); ?>
------------------------
<script type="text/javascript" src="/modules/swftools/shared/"></script>
<script type="text/javascript">
$(document).ready(function(){
$('.swfobject').each(function(i){
params = Drupal.parseJson($(this).attr('swftools'));
var so = new SWFObject(params['src'], '', params['width'], params['height'], params['version'], params['bgcolor']);
so.addParam('quality', params['quality']);
so.addParam('wmode', params['wmode']);
so.addParam('align', params['align']);
so.addParam('salign', params['salign']);
so.addParam('play', params['play']);
so.addParam('loop', params['loop']);
so.addParam('menu', params['menu']);
so.addParam('salign', params['salign']);
so.addParam('base', params['base']);
so.addVariable('flashvars', '&'+ params['flashvars']);
so.addParam('allowfullscreen','true');
so.write(this.id);
});
});
</script>
---------
<div class="wijering-mediaplayer "><div id="swfobject-id-11800494771" class="swftools swfobject" swftools='{ "wmode": "opaque", "bgcolor": "#FFFFFF", "menu": 0, "play": 1, "loop": 0, "quality": "autohigh", "align": "l", "salign": "tl", "scale": "showall", "swliveconnect": "default", "version": "7", "base": "http://mcnubblet.net/media/", "src": "http://mcnubblet.net/modules/swftools/shared/flash_media_player/mediaplayer.swf", "flashvars": "file=http%3A//mcnubblet.net/media//remotetv_VP6_384K.flv" }' >
</div>
The bit that has me concerned is that is doesn't actually have the script filename included, just the 'shared' path, and also the double slash in the 'file' flashvar.
If I use direct embed (without the javascript), the flash will work, but the 'file' flashvar still has the double slash in it.
If I use the filter, as opposed to the php code, the actual filename of the flv i'm trying to embed is truncated out of the 'file' flashvar, so just the path appears. The same thing occurs with/without the javascript replace when using the Flash filter.
If you need to have a look at my site/config,, let me know and i'll set you up.
Thanks for your time,
Nub.
Comments
Comment #1
simeDon't use filters just yet, I'll be fixing them last before the release.
Hmm, that double slash... I assume you have the media url set?
Comment #2
simeMake sure the media url doesn't have a trailing slash.
Otherwise, the actual swfobject js looks normal... is swfobject showing any errors in the javascript embedding section of /admin/media/swf/embed ?
Comment #3
McNubblet commentedHeya,
Thanks for the quick response.
Yes, i have the media URL set, but it doesn't have a trailing slash at all. It's: http://mcnubblet.net/media
No errors are showing anywhere in the javascript embed config stuff.
My question about the JS was, shouldn't this line:
<script type="text/javascript" src="/modules/swftools/shared/"></script>be
<script type="text/javascript" src="/modules/swftools/shared/swfobject1-5/swfobject.js"></script>If you need any more info, let me know :)
Thanks again,
Nub.
Comment #4
simeOh I see.
I did just fix that line in the last day, can you make sure your version of swfobject.module has this at the top?:
// $Id: swfobject.module,v 1.1.2.2.2.9 2007/05/25 00:53:37 sime Exp $If not, then you need to download again when the packaging script runs again (I just checked and it hasn't updated yet.) Here is a link to the new file directly in CVS if you can't wait:
http://cvs.drupal.org/viewcvs/drupal/contributions/modules/swftools/swfo...
Comment #5
McNubblet commentedOK, downloaded the lastest version of that module, same thing happened :(
Had a look inside and did the following:
Function: swfobject_swftools_embed
Added:
below:
Changed:
to:
Now the file is appearing in the 'Script' tag properly.
However, the player is still not showing up. It's made room for the player, and you can right click in the blank spot and get the flash player menu showing up, however, nothing is showing there.
I did take out the media directive from the setting.php, and am now using default paths and the double-slash problem has gone away.
This is the code showing up in the html now:
The "base" var change from an actual path to 'null' now. Don't know if that has anything to do with it though.
To check out what i mean by "blank space": http://mcnubblet.net/
Cheers,
Nub.
Comment #6
Stuart Greenfield commentedThis error occurs if you set the option to embed js on every page.
If using swfobject then when
swfobject_swftools_embedis called for embedding on every page$methods->embed['shared_file']isn't set, so the broken script line is created.If line 43 of swfobject is replaced with
then it works.
I'm not sure that within swfobject the script string needs to be a parameter - if the embedding method is swfobject then this is always the script?
Comment #7
simeThere is no harm in this fix. I have applied it to all three js embedding modules.
http://drupal.org/cvs?commit=68696
http://drupal.org/cvs?commit=68697
Note that IE7 is not working for js replacement. Any other problems here please reopen.
Also note that I've changed the standard path for swfobject to swfobject/swfobject.js, because the "1.5" reference was not very long-term. Note that swfobject1.5 is how the zip file unpacks which is why I had it like that.
Comment #8
(not verified) commented