TalkPHP

TalkPHP (http://www.talkphp.com/forums.php)
-   Javascript, AJAX, E4X (http://www.talkphp.com/javascript-ajax-e4x/)
-   -   Change MP3 Link into Player? (http://www.talkphp.com/javascript-ajax-e4x/3656-change-mp3-link-into-player.html)

buildakicker 11-26-2008 09:38 PM

Change MP3 Link into Player?
 
Hello all you JS masters. ^^

I know it's possible, but how would one go about changing all .mp3 links into a flash player? Like:

Code:

if(link = *.mp3){
insert player where link is at
}

Thanks!

buildakicker 11-26-2008 09:42 PM

oh, and I am using an RSS feed with the MP3 link in it... Could I do something with the Enclosure Tag?

Thanks!

Salathe 11-26-2008 10:08 PM

You post isn't very clear (to me). Give us the code you're working on, or a more clear idea of what precisely you're looking to achieve.

buildakicker 11-26-2008 10:15 PM

sorry for the bad communication.

I would like to understand if Javascript would be the best thing to use in order to scan a loaded page for .mp3 files and then convert the .mp3 file into the 1px player.

I have been using Magpie parser and have this so far:

Code:

$items = array_slice($rss->items, 0, 500);
                        // Cycle through each item and echo 
                        $i=1;
                        foreach ($items as $item ){ 
                                echo '<li><strong><a href="'.$item['link'].'">'.$item['title'].'</a></strong>' .$item['pubDate']. '<br />' .$item['description']. '
                                <object type="application/x-shockwave-flash" data="'.$item['link'].'" id="audioplayer'.$i.'" height="24" width="290">
<param name="movie" value="http://wwwtest.fs.fed.us/r5/lassen/podcasts/player.swf">
<param name="FlashVars" value="playerID='.$i.'&amp;soundFile='.$item['link'].'">
<param name="quality" value="high">
<param name="menu" value="false">
<param name="wmode" value="transparent">
</object>       
                                </li>';
                                $i++;
                        }

It doesn't like that so far though. Won't load the player for some reason. That is a PHP solution, but I was thinking about JS.

Thanks!^^


All times are GMT. The time now is 09:18 AM.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0