Hi all,

is it possible to use the swftools cck formatter with text field insted of filefield so that we can reference the path of the file (which is on another streaming server - like http://domainname.co/foo.mp3) in the text field and its get picked up by the swftools and played, if there is a work around for this - to also see the said file in the views also, please tell me, i need to implement this in a project urgentley.

any kind of quick help will be appreciated

Thank You.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Stuart Greenfield’s picture

Priority: Critical » Normal

In theory, yes it could be done.

In practice, when I (or someone) has time to write it! The filefield formatter is relatively new.

I'm changing the status to normal so it can be tracked with other feature requests. It makes sense to incorporate this, but I'm not sure when I'll be able to do it.

soulston’s picture

Hi,

I am after exactly the same thing. I am currently having to either use embedded media field, custom_url with flowplayer which doesn't look very good or use swftools and create a node-mycontenttype.tpl.php and then use:

swf($node->field_emb_audio[$i]['value']);

to force the mp3 to use the 1 pixel out player.

Maybe there is a way to override the output of the page in template.php when using emfield, so that instead of the path being output with the embed tag it is passed through the swf() function and therefore output using whatever player is specified in swftools. This is slightly beyond me and I am not sure when these functions are called.

Or maybe you can specify a textfield in cck and then run this through the swf() function?

Any ideas?

sdk’s picture

subscribing

Stuart Greenfield’s picture

As part of the work to improve overall playlist support I've been revisiting the CCK formatters. It's not quite ready to commit yet, but what I've done is added support for the SWF Tools formatter for a text field (only single fields at the moment - playlists are more tricky).

Basically you create a text field and assign it the SWF Tools formatter. Type the url for the file you want (it only supports media types as auto-detection fails for swf files) and it will be rendered in the player of your choice.

So http://some.server.com/media/music.mp3 in the text field produces a player.

It also supports streaming servers by separating the server and the stream name with a space (so you can't use spaces in the url, but they're not valid urls in any case)

So rtmp://some.stream.com/vod my_movie will stream my_movie from the appropriate rtmp source.

I don't want to commit the code just yet as there are some glitches in the branch I need to fix, but does the approach above sound useful / match your needs?

I'm not sure if I need to bring support for playlists, nor support for remote thumbnails. It wouldn't be too hard to do. Playlists of remote files are doable, but when the code's ready I'll commit as is with the initial stab at supporting single files.

drewpalmajor’s picture

I think this is a important needed feature. Support for playlists is reasonable as well. We must take into account that some applications require usage of external content. Is there are work around to accomplish this now?

coupet’s picture

Solution proposed in #4 should be perfect; Playlists could be added later as needed.

macho’s picture

FileSize
2.87 KB

I've modified the module to do this, only instead of specifying the URL in a text box I set it to work with the Link CCK type, since that seemed to make more sense. I've attached a simple patch below in case the maintainers or anyone else wants to make use of it.

macho

neek’s picture

wow great patch. work fine for me
its working with single mp3s...
what about attaching external xml-playlist in this filed? is it hard to do?

neek’s picture

Im just tried to add multiple links fileds and it adding players for each link.. may be is it real to generate one playlist from this fields ?

jastraat’s picture

did you get this to work with an rtmp URL though? It doesn't look like the link module recognizes 'rtmp' as an allowed protocol.

jastraat’s picture

FileSize
162.66 KB

I wrote a cck formatter module for myself to format a text field as a streaming video or audio file. It's kind of specific to my situation, but perhaps it will be useful to someone else

lyricnz’s picture

Title: using cck formatters with text field with reference to external files on another streaming server » Add support for CCK Link fields to external files
Status: Active » Reviewed & tested by the community

I had already written some custom code in my module to provide a CCK formatter for CCK Link fields, and found this issue rather late. Tested patch in #7, works great against 6.x-2.5

Stuart Greenfield’s picture

@macho - thanks for the patch in #7.

I'm working up DRUPAL-6--3 at the moment and have used your patch as a start point for adding link field support to the SWF Tools formatters. It's saved a lot of time getting basic support in for this CCK type!

Will commit to CVS on the next update so this will be in the 6.x-3.x release.

@neek - the default behaviour is to output separate players, but now we have a start point for single player code it should be fairly easy to extend it to turn multiple values in to a playlist. Filefield already has this, I just need to adapt the code to bring text and link fields through the same formatter. I'll try to work on this tonight as I think developing ever better CCK integration is key feature for SWF Tools. Code on branch DRUPAL-6--3 supports single players or playlists from filefields, text and links. Single text fields can be streamed, multiple text fields can't, but that is more because I need to work on the playlisting capabilities more generally so it will come.

@jastraat - AFAIK rtmp can't be used through the link field because rtmp isn't an "allowable" protocol. To support rtmp at the moment relies on text field (something I already started adding to branch DRUPAL-6--3). I'm not sure how critical this is since in both cases you have to manually type the link address, and in the case of streams I'm kind of assuming you don't want the end user to download it (and in a lot of cases the "download" address might have nothing at all to do with the stream address). In the short term I think I'll plan for link support and text support as they are kind of complementary, but different!

jastraat’s picture

Alrighty - thank you for the reply!

lyricnz’s picture

FileSize
822 bytes

For the simple case - wanting to use multi-value Link fields as a playlist - the attached patch works fine (for . This is against 6.x-2.5.

Stuart Greenfield’s picture

Thanks for the patch!

6.x-3.x is nearly ready and this is built in!

Drupoid’s picture

How do I enter an RTMP link into a CCK field and have SWF Tools use it without having Drupal reject it? I tried swftools-465708.patch with a link and it was rejected.

lyricnz’s picture

Drupoid: suggest you raise a separate ticket for that, otherwise will fill this issue with noise.

Stuart Greenfield’s picture

This works in 6.x-3.x, but using textfields, not linkfields.

Linkfields are validated by the CCK linkfield validator and are NOT valid so it rejects them, so you have to do it via a CCK text field.

If you want to try it you need the beta, or the snapshot for DRUPAL-6--3.

In the textfield you type the name of the server, a space, then then name of the stream.

You have to do it this way as SWF Tools needs to know both and cannot work it out for itself if you ran it all together.

Drupoid’s picture

Ok Stuart, this is very good. But I get an error when I update your module:

Fatal error: Call to undefined function swftools_get_player_path() in C:\Program Files\BitNami Drupal 6 Stack\apps\drupal\htdocs\modules\swftools\wijering4\wijering4.module on line 30

Do I need to de-install first?

Also, is this correct for the rtmp syntax?

rtmp://test.com:8080/videoplayer/walkaround/ test.flv

Stuart Greenfield’s picture

It sounds like something has gone wrong in your installation. swftools_get_player_path() is a deprecated function. This sometimes happens if you accidentally mix "old" and "new" bits of SWF Tools.

There's an awful lot of change going on inside SWF Tools at the moment, although none of it should ultimately break any existing content. To make sure everything is ok clear your swftools directory and then re-install from BETA3 or DRUPAL-6--3 as you prefer and the error should go.

I'm running DRUPAL-6--3 here and it's running well (and I'm enjoying the new features myself!). The code in there is pretty stable now...

In terms of the rtmp string, it's one slash if its local (running on the same machine as Flash media server), two if its remote. See http://www.peachpit.com/articles/article.aspx?p=665127&seqNum=7

Edit!

Just noticed your error message refers to wijering4.module. All SWF Tools modules are now swftools_[something].module to avoid namespace issues. Make sure you did a full upgrade as per http://drupal.org/node/748232.

Drupoid’s picture

Thank-you very much Stuart. I am now to this point:

1. I see a black screen with a play arrow in the middle inside the node. The rtmp video does not play.
2. The bottom of the browser says "Transferring data from plugins.longtailvideo.com".
3. SWFs still work OK.
4. I enabled JW Media Player 4, SWF Tools and SWFObjects2.
5. sites/all/libraries has mediaplayer4/player.swf and swfobject/swfobject.js. player.swf is the latest JW Player 5.1.
6. Running in Firefox 3.6.3.
7. Tried the following in the Text - Textfield field:

rtmp://XXX.com:8080/videoplayer/walkaround/XXX.flv
rtmp://XXX.com:8080/videoplayer/walkaround/XXX
rtmp://XXX.com:8080/videoplayer/walkaround/ XXX.flv
rtmp://XXX.com:8080/videoplayer/walkaround/ XXX

8. Display for field is "SWF Tools - no download link"

Any thoughts on this situation?

Stuart Greenfield’s picture

Setting up streams can be tricky. Are you sure the server is running? I had to re-install FMS for no obvious reason last week because it just gave up! If you're also using Flash Media Server then does its start page work? That will at least tell you if you are able to establish a connection.

Not sure, but you are giving a port number of 8080 in the url. RTMP normally listens on 1935. When I try using a port number on my setup to see what happens I never manage to connect!

I just tested on my local machine with FMS and for me to stream and flv to JW all I need is

rtmp:/vod sample.flv

Note single slash in my case as FMS is running on the local machine.

I'm not sure from your combination of paths where the video is being streamed from. If the application is at rtmp://XXX.com/videoplayer, and the file is in a subdirectory of walkaround, then the proper text string would be

rtmp://XXX.com/videoplayer walkaround/XXX.flv

The important thing is that you break the path with a space so SWF Tools knows which bit describes the server, and which bit describes the file you actually want to stream.

You could also try your server adminstration console (if using FMS) - that would confirm that the server is up and running, and then it will show you if your webpage is trying to connect.

I'm still getting to grips with FMS and it can be a little bit tricky, so hope the above helps!

I noticed you said you are using JW5 player. The SWF Tools module was written for JW4, but from informal testing JW5 seems to work as the variables it uses are mostly the same :-)

Drupoid’s picture

Nice Stuart! Here's what works for our servers:

rtmp://XXX.com:8080/videoplayer/walkaround XXX.flv

We use 8080 because our clients have firewall issues and only allow rtmp on 8080.

You really created a fantastic module here with its excellent integration with the core Drupal architecture.

Where can I go to ask you some unrelated questions, like how to show a thumbnail when using a nodereference? Your new thumbnail concept is new to us.

Stuart Greenfield’s picture

Glad you got it working! And glad you like SWF Tools :-)

Where can I go to ask you some unrelated questions, like how to show a thumbnail when using a nodereference?

Jump right in and open a support request on the issue queue.

With respect to the new thumbnail system, that works via CCK. In your content you create a field to hold the thumbnail, and a field to hold the movie/swf. SWF Tools then automatically picks up the thumbnail if it is formatted with the thumbnail formatter.

Not sure how that works opposite nodereference, so that description doesn't help raise a new request!!

ccshannon’s picture

subscribe

friedman’s picture

Has anyone tried to use this functionality against an aggregator view link? I'm still using 6.x-2.5 with the patch from #7 and I don't see an swf option for an aggregator link.