Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Assigning individual flashplayer to each article
Hello,
i`m still pretty new to textpattern and i have a basic question,
i hope someone can point out some advice:
Is it possible to have an individual flash audioplayer assigned to each single article in a certain category?
I`m just building a site for a recordlabel and in the “releases” section every article (=release) needs
an individual audioplayer assigned that contains the songs from that very release.
I planned to go for custom fields here but the limitation of characters to put into a custom field
doesn`t allow me to do as intended. Am i missing something or is there no way to accomplish this with textpattern?
Thanks in advance!
Offline
Re: Assigning individual flashplayer to each article
Just finished a kind of such plugin – local swf player, located on site, plays .flv video file, which name is entered in custom_field. the base to develope on was the_video
plugin and some swf player found in google :)
Last edited by the_ghost (2008-05-20 06:03:40)
Providing help in hacking ATM! Come to courses and don’t forget to bring us notebook and hammer! What for notebook? What a kind of hacker you are without notebok?
Offline
#3 2008-05-20 06:03:55
- nardo
- Member
- From: tuvalahiti
- Registered: 2004-04-22
- Posts: 743
Re: Assigning individual flashplayer to each article
http://www.jeroenwijering.com/?item=JW_FLV_Player
You could use a custom field to list the file ID of each song in the release, then use Txp in the background to create a XML file to feed the playlist… Or there are other ways.
Explore the player above!
Offline
Re: Assigning individual flashplayer to each article
Thank you for the quick answers ghost & nardo.
I will look into the FLV Player and see if i get somewhere with that one,
right now i am not really sure what you mean nardo.
Especially “then use Txp in the background to create a XML file to feed the playlist” is what I don`t understand.
As I said I`m pretty new to Textpattern, this is actually just the second site I am setting up with it,
and the first one to use custom fields on.
Any chance you elaborate on the abovementioned quote?
Would be greatly appreciated!
Offline
Re: Assigning individual flashplayer to each article
In JW_FLV_Player video file is set in javascript’s variable. You can place tag <txp:custom field name="video_flv" />
where video file location is set – thats all :)
Providing help in hacking ATM! Come to courses and don’t forget to bring us notebook and hammer! What for notebook? What a kind of hacker you are without notebok?
Offline
Re: Assigning individual flashplayer to each article
One way I’ve used is to set up the playlist using a 3rd party site such as myflashfetish.com and then simply take their embedded code, strip out the unnecessary crud and extract the key param info that is used to index that playlist (e.g. id=5fbac67394e454abde81). I pasted the embedded code they supplied in a form but left out the ID reference. I then replaced that ID reference in the form with a call to <txp:custom_field name="track_ref" />
and put the relevant ID number in a custom field for that article.
For each subsequent album playlist, all you have to do is save it on their server, grab the ID each time from the code they supply and stick it in the custom field for that album. Job done.
Alternatively — and I’ve not read up on the ins and outs of that player Nardo mentioned (though it’s not free for commercial purposes) but if you can find a player that supports a simple list of file URLs as a playlist — you could also proceed as follows to “roll your own playlist”. It’s perhaps a bit convoluted and there’s probably a much easier way… if you can figure out what Nardo meant with an XML playlist (I haven’t a clue!) :
1) Create a file category to hold each album (e.g. “Thriller”, “DarkSideOfTheMoon”, etc)
2) Upload your tracks to the Files tab (see later if the files are stored on another server) and assign the tracks to the relevant album category. If they’re stored with the Track number in the filename it’s easier for sorting purposes (e.g. Thriller-01-WannaBeStartinSomethin.mp3)
3) In your article, use a custom field to store the category name that holds the album tracks
4) In your releases
form have something like:
<txp:if_custom_field name="tracks">
<txp:output_form form="music_player" />
</txp:if_custom_field>
5) In form music_player
:
<object blah blah options for the embedded music player of your choice>
<param name="some_param" value="some_value">
<param name="playlist" value="<txp:file_download_list category="<txp:custom_field name="tracks" />" form="raw_track" />">
</object>
That simply calls file_download_list and passes it the category from your article’s custom field. [ You may need the asy_wondertag plugin round the file_download_list unless you’re using an up-to-date SVN copy of TextPattern with the new parser in it ]. Each file in that category is then passed to the raw_track
form which simply outputs the track’s filename to make up the playlist…
6) For example:
/files/<txp:file_download_name />&
So the output would be:
<param name="playlist" value="/files/Thriller-01-WannaBeStartinSomethin.mp3&/files/Thriller-02-BabyBeMine&...">
There are other ways, such as using a custom field to hold a comma-separated list of IDs of your album tracks and iterating over the values to get the file names for the playlist (you might need PHP for that, or the sed_pcf plugin).
Oh, and if your files are stored on a 3rd party site somewhere you can use the smd_remote_file plugin to tell TXP where they are and employ the procedure as above but use <txp:smd_file_download_link />
in Step 6, without the reference to /files/
.
That’s just an example of how you could do it (perhaps if you were mad!). As others have said, there are quite a few ways to do it and it’ll ultimately depend on how flexible your flash player is and how devious you are with TXP tags.
Hopefully this thread will give you some ideas and you can invent a really neat way of doing it and share it with us :-)
Last edited by Bloke (2008-05-20 11:02:52)
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Txp Builders – finely-crafted code, design and Txp
Offline
Re: Assigning individual flashplayer to each article
That was fast!
ghost: my question was aimed at audiofiles and not video, but thanks anyway.
bloke: wow. thanks a lot, i will play around a bit now as you opened my eyes on what`s possible,
will let you all know once i accomplished something nice.
Guess i am way too low level to “invent” something but i will get the job done, at least i think so now.
Thanks!
Offline
Re: Assigning individual flashplayer to each article
This player can play audio to – may be it’s not very beauty, but music is played :)
Providing help in hacking ATM! Come to courses and don’t forget to bring us notebook and hammer! What for notebook? What a kind of hacker you are without notebok?
Offline
#9 2008-05-21 01:13:57
- nardo
- Member
- From: tuvalahiti
- Registered: 2004-04-22
- Posts: 743
Re: Assigning individual flashplayer to each article
You can create a page template in Textpattern that creates a XML feed. You need this plugin – and I think you will benefit from reading Podcasting With Textpattern – A Tutorial – even tho it is not specific to your scenario.
But that is just one possible approach, not necessarily the best!
Also depends on how much info (titles, thumbnails) you want for each audio file and for the album. I think you will have to experiment to find a good workflow!
freischwimmen wrote:
Especially “then use Txp in the background to create a XML file to feed the playlist” is what I don`t understand.
As I said I`m pretty new to Textpattern, this is actually just the second site I am setting up with it,
and the first one to use custom fields on.
Any chance you elaborate on the abovementioned quote?
Would be greatly appreciated!
Offline
Re: Assigning individual flashplayer to each article
nardo wrote:
You can create a page template in Textpattern that creates a XML feed.
Oh nice, Nardo. The mystery is revealed. Thanks for posting that; I think I can see a way of twisting that method to do something I’ve wanted to try for ages. Sweeeet.
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Txp Builders – finely-crafted code, design and Txp
Offline
Re: Assigning individual flashplayer to each article
Interesting approach Nardo, will look into it when i have a minute. Thanks!
I managed to assign individual last.fm widgets now incorporating two custom fields,
one for the title and one for the id of the widget.
Nevertheless, my customer now has to look into the embed code generated by last.fm and
snatch out the ID, not the most comfortable way for him. will look further into all this now.
Offline
#12 2008-05-21 23:17:10
- nardo
- Member
- From: tuvalahiti
- Registered: 2004-04-22
- Posts: 743
Re: Assigning individual flashplayer to each article
there’s never an ‘easy’ way for a client! – just find a method that’s reasonably bomb proof, give them documentation (screenshots), and once they’ve done it 20 times, they’ll never want to do it any other way again
Offline