<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: A Simple Way To Play MP3 Audio Files</title>
	<atom:link href="http://iPhoneIncubator.com/blog/audio-video/simple-way-to-play-mp3-audio-files/feed" rel="self" type="application/rss+xml" />
	<link>http://iPhoneIncubator.com/blog/audio-video/simple-way-to-play-mp3-audio-files</link>
	<description>Tips and Tricks for iPhone, iPod, iPad and iOS Developers</description>
	<lastBuildDate>Sun, 18 Jul 2010 17:17:16 -0700</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Pierre</title>
		<link>http://iPhoneIncubator.com/blog/audio-video/simple-way-to-play-mp3-audio-files/comment-page-1#comment-2768</link>
		<dc:creator>Pierre</dc:creator>
		<pubDate>Mon, 19 Apr 2010 08:16:46 +0000</pubDate>
		<guid isPermaLink="false">http://iPhoneIncubator.com/blog/?p=92#comment-2768</guid>
		<description>Hi,

I use the same technics as you explain but sometimes, when after clicking on the &quot;done&quot; button, view dismiss and automaticaly restart after 1 second.

Does anyone get the same problem?

PS: Sorry for my English, I&#039;m French man :)</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>I use the same technics as you explain but sometimes, when after clicking on the &#8220;done&#8221; button, view dismiss and automaticaly restart after 1 second.</p>
<p>Does anyone get the same problem?</p>
<p>PS: Sorry for my English, I&#8217;m French man <img src='http://iPhoneIncubator.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ted</title>
		<link>http://iPhoneIncubator.com/blog/audio-video/simple-way-to-play-mp3-audio-files/comment-page-1#comment-2408</link>
		<dc:creator>Ted</dc:creator>
		<pubDate>Wed, 10 Mar 2010 21:31:19 +0000</pubDate>
		<guid isPermaLink="false">http://iPhoneIncubator.com/blog/?p=92#comment-2408</guid>
		<description>Alternatively you can:

MPMoviePlayerController *mediaPlayer = [[MPMoviePlayerController alloc] initWithContentURL:[NSURL URLWithString:contentURL]];
[mediaPlayer play];

With this you can register an action with the MPMoviePlayerPlaybackDidFinishNotification by doing:

// Register to receive a notification when the movie has finished playing. 
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(mediaPlayerPlaybackDidFinish:) 
name:MPMoviePlayerPlaybackDidFinishNotification 
object:mediaPlayer];</description>
		<content:encoded><![CDATA[<p>Alternatively you can:</p>
<p>MPMoviePlayerController *mediaPlayer = [[MPMoviePlayerController alloc] initWithContentURL:[NSURL URLWithString:contentURL]];<br />
[mediaPlayer play];</p>
<p>With this you can register an action with the MPMoviePlayerPlaybackDidFinishNotification by doing:</p>
<p>// Register to receive a notification when the movie has finished playing.<br />
[[NSNotificationCenter defaultCenter] addObserver:self<br />
selector:@selector(mediaPlayerPlaybackDidFinish:)<br />
name:MPMoviePlayerPlaybackDidFinishNotification<br />
object:mediaPlayer];</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ted</title>
		<link>http://iPhoneIncubator.com/blog/audio-video/simple-way-to-play-mp3-audio-files/comment-page-1#comment-2406</link>
		<dc:creator>Ted</dc:creator>
		<pubDate>Wed, 10 Mar 2010 17:50:32 +0000</pubDate>
		<guid isPermaLink="false">http://iPhoneIncubator.com/blog/?p=92#comment-2406</guid>
		<description>Kind of digging up old discussion here but I found a solution to the &quot;playing twice&quot; issue. Just keep a reference to the web view around. Each time you need to play a new MP3, deallocate it (remove it from the superview, release, etc.) and then create a new one. This ensures the web view is new and doesn&#039;t play the previously played MP3 for some reason.

I tried a bunch of stuff using UIWebViewDelegate and you just can&#039;t jack into the order of events in any way to prevent previous playing, so this seems to be the only way. If you do it right you won&#039;t have any memory leaks - run Instruments just to double check your logic.</description>
		<content:encoded><![CDATA[<p>Kind of digging up old discussion here but I found a solution to the &#8220;playing twice&#8221; issue. Just keep a reference to the web view around. Each time you need to play a new MP3, deallocate it (remove it from the superview, release, etc.) and then create a new one. This ensures the web view is new and doesn&#8217;t play the previously played MP3 for some reason.</p>
<p>I tried a bunch of stuff using UIWebViewDelegate and you just can&#8217;t jack into the order of events in any way to prevent previous playing, so this seems to be the only way. If you do it right you won&#8217;t have any memory leaks &#8211; run Instruments just to double check your logic.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: brad</title>
		<link>http://iPhoneIncubator.com/blog/audio-video/simple-way-to-play-mp3-audio-files/comment-page-1#comment-2333</link>
		<dc:creator>brad</dc:creator>
		<pubDate>Wed, 03 Mar 2010 20:35:56 +0000</pubDate>
		<guid isPermaLink="false">http://iPhoneIncubator.com/blog/?p=92#comment-2333</guid>
		<description>dumb question? how about playing an audio mp3 inside flash ?</description>
		<content:encoded><![CDATA[<p>dumb question? how about playing an audio mp3 inside flash ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nick</title>
		<link>http://iPhoneIncubator.com/blog/audio-video/simple-way-to-play-mp3-audio-files/comment-page-1#comment-1499</link>
		<dc:creator>Nick</dc:creator>
		<pubDate>Sat, 14 Nov 2009 21:01:17 +0000</pubDate>
		<guid isPermaLink="false">http://iPhoneIncubator.com/blog/?p=92#comment-1499</guid>
		<description>@stinki: The UIWebView cannot load and parse and XML for your MP3 URLs. You could load and parse the XML in your own code and then send the URLs to the UIWebView.</description>
		<content:encoded><![CDATA[<p>@stinki: The UIWebView cannot load and parse and XML for your MP3 URLs. You could load and parse the XML in your own code and then send the URLs to the UIWebView.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: James A. Brannan</title>
		<link>http://iPhoneIncubator.com/blog/audio-video/simple-way-to-play-mp3-audio-files/comment-page-1#comment-1493</link>
		<dc:creator>James A. Brannan</dc:creator>
		<pubDate>Thu, 12 Nov 2009 17:59:32 +0000</pubDate>
		<guid isPermaLink="false">http://iPhoneIncubator.com/blog/?p=92#comment-1493</guid>
		<description>It is working with a .pls also, only I have one bug I can&#039;t seem to figure out. The playlist keeps reloading until I quit the app.  Here&#039;s my viewDidUnload code, anybody see something I&#039;m forgetting?

		
[UIApplication sharedApplication].networkActivityIndicatorVisible = NO;
[self.myWebView stopLoading];
self.myWebView.delegate = nil;
[self.navigationController popViewControllerAnimated:YES];</description>
		<content:encoded><![CDATA[<p>It is working with a .pls also, only I have one bug I can&#8217;t seem to figure out. The playlist keeps reloading until I quit the app.  Here&#8217;s my viewDidUnload code, anybody see something I&#8217;m forgetting?</p>
<p>[UIApplication sharedApplication].networkActivityIndicatorVisible = NO;<br />
[self.myWebView stopLoading];<br />
self.myWebView.delegate = nil;<br />
[self.navigationController popViewControllerAnimated:YES];</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: stinki</title>
		<link>http://iPhoneIncubator.com/blog/audio-video/simple-way-to-play-mp3-audio-files/comment-page-1#comment-1492</link>
		<dc:creator>stinki</dc:creator>
		<pubDate>Thu, 12 Nov 2009 17:07:43 +0000</pubDate>
		<guid isPermaLink="false">http://iPhoneIncubator.com/blog/?p=92#comment-1492</guid>
		<description>hi, thanks for that post. is it possible to load a xml file with some urls to the mp3-files and than play one a nother? 

thanks,
stinki</description>
		<content:encoded><![CDATA[<p>hi, thanks for that post. is it possible to load a xml file with some urls to the mp3-files and than play one a nother? </p>
<p>thanks,<br />
stinki</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: James A. Brannan</title>
		<link>http://iPhoneIncubator.com/blog/audio-video/simple-way-to-play-mp3-audio-files/comment-page-1#comment-1491</link>
		<dc:creator>James A. Brannan</dc:creator>
		<pubDate>Thu, 12 Nov 2009 16:35:10 +0000</pubDate>
		<guid isPermaLink="false">http://iPhoneIncubator.com/blog/?p=92#comment-1491</guid>
		<description>This was exactly what I was looking for....I was about to embark on coding the streaming, having not even thought about just letting Safari handle it.  Much easier.  Thanks.</description>
		<content:encoded><![CDATA[<p>This was exactly what I was looking for&#8230;.I was about to embark on coding the streaming, having not even thought about just letting Safari handle it.  Much easier.  Thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anthony</title>
		<link>http://iPhoneIncubator.com/blog/audio-video/simple-way-to-play-mp3-audio-files/comment-page-1#comment-1333</link>
		<dc:creator>Anthony</dc:creator>
		<pubDate>Sat, 24 Oct 2009 10:02:32 +0000</pubDate>
		<guid isPermaLink="false">http://iPhoneIncubator.com/blog/?p=92#comment-1333</guid>
		<description>Would really like to see the source code of this if it&#039;s possible mate?</description>
		<content:encoded><![CDATA[<p>Would really like to see the source code of this if it&#8217;s possible mate?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tim</title>
		<link>http://iPhoneIncubator.com/blog/audio-video/simple-way-to-play-mp3-audio-files/comment-page-1#comment-1026</link>
		<dc:creator>Tim</dc:creator>
		<pubDate>Fri, 14 Aug 2009 14:58:56 +0000</pubDate>
		<guid isPermaLink="false">http://iPhoneIncubator.com/blog/?p=92#comment-1026</guid>
		<description>I&#039;m able to get this to work when I run the second block of code by itself, but when I run both blocks together it causes a EXC_BAD_ACCESS error.  Things work great without that first block of code except for one thing: it plays the mp3 twice (when you click &quot;done&quot; the first time it goes to play it a second time).  I&#039;m hoping the first block of code will fix my problem if I can get it to work.  Any ideas please?

Do you have the source code that I can download as a complete project?</description>
		<content:encoded><![CDATA[<p>I&#8217;m able to get this to work when I run the second block of code by itself, but when I run both blocks together it causes a EXC_BAD_ACCESS error.  Things work great without that first block of code except for one thing: it plays the mp3 twice (when you click &#8220;done&#8221; the first time it goes to play it a second time).  I&#8217;m hoping the first block of code will fix my problem if I can get it to work.  Any ideas please?</p>
<p>Do you have the source code that I can download as a complete project?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
