Hi,
Thanks as always for the great work on this complex module! I am trying to use the swf() function to embed the JW Media Player with an rtmp stream. To do this outside of drupal context, still using swfobject, the code is as follows:
swfobject.embedSWF("player.swf", "container", "328", "200", "9.0.0", "", {file: "foo.flv", streamer: "rtmp://someserver.com/somefolder"});
which yields a rendered embed like this:
<object id="container" height="200" width="328" type="application/x-shockwave-flash" data="player.swf" style="visibility: visible;">
<param name="flashvars" value="file=foo.flv&streamer=rtmp://someserver.com/somefolder"/>
</object>
Using SWFTools swf() function, the equivalent would be something like this:
print swf('foo.flv', array('width' => '328', 'height' => '200'), array('streamer' => 'rtmp://someserver.com/somefolder'));
which renders:
<object id="swf12241797882" height="200" width="328" type="application/x-shockwave-flash" data="http://localhost:8080/drupal5twb/sites/all/modules/swftools/shared/flash_media_player/mediaplayer.swf">
(...multiple params omitted for brevity...)
<param name="base" value="http://localhost:8080/drupal5twb/files/"/>
<param name="src" value="http://localhost:8080/drupal5twb/sites/all/modules/swftools/shared/flash_media_player/mediaplayer.swf"/>
<param name="flashvars" value="streamer=rtmp://someserver.com/somefolder&width=328&height=200&file=http://localhost:8080/drupal5twb/files/foo.flv"/>
</object>
I have found that this always tries to embed foo.flv from the local system with the site's base url, although the "streamer" var is added to flashvars ok. I can override the base param or even set the swftools_media_url variable in settings.php but these will not change foo.flv from turning into http://wherever/foo.flv. I have also tried sending the file value through flashvars and leaving it blank, but this doesn't work either. Is there a piece of syntax I am missing?
Thanks so much!
Kurt
Comments
Comment #1
robertjwhitney commentedI am hoping that someone knows how to resolve this also...
Comment #2
Stuart Greenfield commentedThe issue here is that SWF Tools "expands" the unqualified filename, and then assigns it to the media player.
To get round this in a way that would let you use the same 'simple' syntax means some quite big changes to SWF Tools (but maybe something that can go on the development plan).
The work around is to point SWF Tools to the player file, and then send it a properly formed flashvars string. It's not very elegant, but it should work. The downside is that when you move your site you'd need to update the filters. However, as you have to pass the streamer variable you'd need to do that anyway.
The code would look like:
I've not used the rtmp streaming mechanism with SWF Tools so please can you post if this does (or doesn't!) work.
Comment #3
perandre commentedIs there any news on this in the version for D6? I'm very interested in using Drupal with a rtmp-server. SWF-tools has served me well so far, great job!
Comment #4
swellbow commentedSorry, when I submitted this bug I had the version wrong -- I'm working with 6.x-1.3, so I updated that, if it makes a difference. Also sorry it took me forever to get back about testing this further. Good news though!
With your clues above, Stuart, I was able to get things working pretty quickly. The main thing missing for me was the location of the media player. Once that's resolved, the rtmp kicks in no problem. Either of the following two will work for version 6.
or
You can't point relatively to the sites/all/modules... file though, even with tweaking the conf array. So I opted to put it in the files dir so that it's more portable (as you pointed out, Stuart).
It's beyond me to say if this should be addressed in a roadmap. The above certainly works and is pretty simple. It of course would be nice if:
output perfect code with the flashvars and all...but it might just be a little bit out of scope, since the Wijering player itself requires them as separate flashvars anyhow. I'm fine with solution 2 above.
I hope this helps! And thanks for the followup Stuart!
Kurt
Comment #5
Stuart Greenfield commentedStreaming support is now in place for Wijering 4 and FlowPlayer 3. Refer to this documentation page for details about how to use it.