TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 11-26-2008, 09:38 PM   #1 (permalink)
The Acquainted
 
buildakicker's Avatar
 
Join Date: Jan 2008
Posts: 119
Thanks: 21
buildakicker is on a distinguished road
Default 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!
__________________
SkiLeases.com
buildakicker is offline  
Reply With Quote
Old 11-26-2008, 09:42 PM   #2 (permalink)
The Acquainted
 
buildakicker's Avatar
 
Join Date: Jan 2008
Posts: 119
Thanks: 21
buildakicker is on a distinguished road
Default

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

Thanks!
__________________
SkiLeases.com
buildakicker is offline  
Reply With Quote
Old 11-26-2008, 10:08 PM   #3 (permalink)
Moderateur
RegEx Guru PHP Guru Top Contributor Advanced Programmer 
 
Salathe's Avatar
 
Join Date: Apr 2007
Posts: 1,393
Thanks: 5
Salathe is on a distinguished road
Default

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.
Salathe is offline  
Reply With Quote
Old 11-26-2008, 10:15 PM   #4 (permalink)
The Acquainted
 
buildakicker's Avatar
 
Join Date: Jan 2008
Posts: 119
Thanks: 21
buildakicker is on a distinguished road
Default

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!
__________________
SkiLeases.com
buildakicker is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 03:18 PM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design