<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: Android Tutorial 3: Custom Audio Streaming with MediaPlayer</title>
	<atom:link href="http://blog.pocketjourney.com/2008/04/04/tutorial-custom-media-streaming-for-androids-mediaplayer/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.pocketjourney.com/2008/04/04/tutorial-custom-media-streaming-for-androids-mediaplayer/</link>
	<description>Know Anywhere</description>
	<lastBuildDate>Fri, 03 Feb 2012 07:03:51 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: Biosopher</title>
		<link>http://blog.pocketjourney.com/2008/04/04/tutorial-custom-media-streaming-for-androids-mediaplayer/#comment-958</link>
		<dc:creator><![CDATA[Biosopher]]></dc:creator>
		<pubDate>Fri, 03 Feb 2012 07:03:51 +0000</pubDate>
		<guid isPermaLink="false">http://pocketjourney.wordpress.com/?p=16#comment-958</guid>
		<description><![CDATA[Hi Ketan,

My tutorial is meant only for streaming audio files...and was only tested with .mp3 files.  I wrote that code awhile ago and haven&#039;t updated it since Android v2.0. 

Videos play fine using Android&#039;s built-in streaming video player as you saw using the MediaPlayerDemo.  Just make sure you use a media format supported by Android.  Getting the media files formatted correctly can be rather tricky which is why I recommend starting with the .3gp file I mentioned earlier.

If you&#039;re having problems with .mp4, reformat to .3gp using Quicktime Pro.  I had great success with it...though it does cost about $40.  I think you can try the demo.]]></description>
		<content:encoded><![CDATA[<p>Hi Ketan,</p>
<p>My tutorial is meant only for streaming audio files&#8230;and was only tested with .mp3 files.  I wrote that code awhile ago and haven&#8217;t updated it since Android v2.0. </p>
<p>Videos play fine using Android&#8217;s built-in streaming video player as you saw using the MediaPlayerDemo.  Just make sure you use a media format supported by Android.  Getting the media files formatted correctly can be rather tricky which is why I recommend starting with the .3gp file I mentioned earlier.</p>
<p>If you&#8217;re having problems with .mp4, reformat to .3gp using Quicktime Pro.  I had great success with it&#8230;though it does cost about $40.  I think you can try the demo.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ketan Bhangale</title>
		<link>http://blog.pocketjourney.com/2008/04/04/tutorial-custom-media-streaming-for-androids-mediaplayer/#comment-957</link>
		<dc:creator><![CDATA[Ketan Bhangale]]></dc:creator>
		<pubDate>Fri, 03 Feb 2012 05:54:03 +0000</pubDate>
		<guid isPermaLink="false">http://pocketjourney.wordpress.com/?p=16#comment-957</guid>
		<description><![CDATA[Hi Biosopher,

I have sent my code in the comment yesterday. but it is not get published I guess.
Thanks for your immediate reply.


Ketan B]]></description>
		<content:encoded><![CDATA[<p>Hi Biosopher,</p>
<p>I have sent my code in the comment yesterday. but it is not get published I guess.<br />
Thanks for your immediate reply.</p>
<p>Ketan B</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ketan Bhangale</title>
		<link>http://blog.pocketjourney.com/2008/04/04/tutorial-custom-media-streaming-for-androids-mediaplayer/#comment-956</link>
		<dc:creator><![CDATA[Ketan Bhangale]]></dc:creator>
		<pubDate>Fri, 03 Feb 2012 05:49:33 +0000</pubDate>
		<guid isPermaLink="false">http://pocketjourney.wordpress.com/?p=16#comment-956</guid>
		<description><![CDATA[Hi Biosopher,

Can you please send me your above code modified for video on my e-mail id(ketub4@gmail.com). I am using Your url mentioned above but media player starts and after 1-2 sec is stops playing but downloading completes in the background.

The above mentioned url is working properly in MediaPlayerDemo_video in api demos but it stucks when i am trying to play mp4 file with large size say 13 to 15 MB. I have added header using MP4Box to mp4 file so that it can play as per Tmac&#039;s comment above.

Please help me... its very critical time for me.... 

Thanks in advance.....


Ketan B]]></description>
		<content:encoded><![CDATA[<p>Hi Biosopher,</p>
<p>Can you please send me your above code modified for video on my e-mail id(ketub4@gmail.com). I am using Your url mentioned above but media player starts and after 1-2 sec is stops playing but downloading completes in the background.</p>
<p>The above mentioned url is working properly in MediaPlayerDemo_video in api demos but it stucks when i am trying to play mp4 file with large size say 13 to 15 MB. I have added header using MP4Box to mp4 file so that it can play as per Tmac&#8217;s comment above.</p>
<p>Please help me&#8230; its very critical time for me&#8230;. </p>
<p>Thanks in advance&#8230;..</p>
<p>Ketan B</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Biosopher</title>
		<link>http://blog.pocketjourney.com/2008/04/04/tutorial-custom-media-streaming-for-androids-mediaplayer/#comment-955</link>
		<dc:creator><![CDATA[Biosopher]]></dc:creator>
		<pubDate>Wed, 01 Feb 2012 14:38:36 +0000</pubDate>
		<guid isPermaLink="false">http://pocketjourney.wordpress.com/?p=16#comment-955</guid>
		<description><![CDATA[What file format are you using, Ketan?  I have had great success with .3gp.  Try streaming this file:
http://www.pocketjourney.com/downloads/pj/video/famous.3gp]]></description>
		<content:encoded><![CDATA[<p>What file format are you using, Ketan?  I have had great success with .3gp.  Try streaming this file:<br />
<a href="http://www.pocketjourney.com/downloads/pj/video/famous.3gp" rel="nofollow">http://www.pocketjourney.com/downloads/pj/video/famous.3gp</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ketan Bhangale</title>
		<link>http://blog.pocketjourney.com/2008/04/04/tutorial-custom-media-streaming-for-androids-mediaplayer/#comment-954</link>
		<dc:creator><![CDATA[Ketan Bhangale]]></dc:creator>
		<pubDate>Wed, 01 Feb 2012 06:37:58 +0000</pubDate>
		<guid isPermaLink="false">http://pocketjourney.wordpress.com/?p=16#comment-954</guid>
		<description><![CDATA[Hi,

Nice tutorial and very well explained.

I am new to android development and I have tried your code. it working fine on my device. but i want to stream video. I have made some changes to your code(added surface view) but not able to get it correct.

current output: first file gets fully loaded and then start playing instead of parallel downloading and playing.

Please please help me or if anyone has above code converted for video. please post it or email me(ketub4@gmail.com)

Thanks in advace.

Ketan B]]></description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>Nice tutorial and very well explained.</p>
<p>I am new to android development and I have tried your code. it working fine on my device. but i want to stream video. I have made some changes to your code(added surface view) but not able to get it correct.</p>
<p>current output: first file gets fully loaded and then start playing instead of parallel downloading and playing.</p>
<p>Please please help me or if anyone has above code converted for video. please post it or email me(ketub4@gmail.com)</p>
<p>Thanks in advace.</p>
<p>Ketan B</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: marek</title>
		<link>http://blog.pocketjourney.com/2008/04/04/tutorial-custom-media-streaming-for-androids-mediaplayer/#comment-953</link>
		<dc:creator><![CDATA[marek]]></dc:creator>
		<pubDate>Fri, 20 Jan 2012 19:23:13 +0000</pubDate>
		<guid isPermaLink="false">http://pocketjourney.wordpress.com/?p=16#comment-953</guid>
		<description><![CDATA[Thanke you. I use your tutorial to create my program openwebradio on the site www.openwebradio.mobi]]></description>
		<content:encoded><![CDATA[<p>Thanke you. I use your tutorial to create my program openwebradio on the site <a href="http://www.openwebradio.mobi" rel="nofollow">http://www.openwebradio.mobi</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: aru</title>
		<link>http://blog.pocketjourney.com/2008/04/04/tutorial-custom-media-streaming-for-androids-mediaplayer/#comment-950</link>
		<dc:creator><![CDATA[aru]]></dc:creator>
		<pubDate>Sat, 17 Dec 2011 20:49:38 +0000</pubDate>
		<guid isPermaLink="false">http://pocketjourney.wordpress.com/?p=16#comment-950</guid>
		<description><![CDATA[is it possible to stream voice real time instead of songs???lik a call in pt to pt connection?? pls reply]]></description>
		<content:encoded><![CDATA[<p>is it possible to stream voice real time instead of songs???lik a call in pt to pt connection?? pls reply</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Praveen T</title>
		<link>http://blog.pocketjourney.com/2008/04/04/tutorial-custom-media-streaming-for-androids-mediaplayer/#comment-948</link>
		<dc:creator><![CDATA[Praveen T]]></dc:creator>
		<pubDate>Wed, 23 Nov 2011 05:56:05 +0000</pubDate>
		<guid isPermaLink="false">http://pocketjourney.wordpress.com/?p=16#comment-948</guid>
		<description><![CDATA[Hi, Thanks for this awesome tutorial. Lot of my doubts got cleared and I could learn lots from here.
I&#039;m new to android and currently working to stream a video instead of the audio streaming presented here. I modified the code to show a video but then I couldn&#039;t. The extra code that I have added is:
1)  Add a surface view to the xml page.
2) get a SurfaceHolder for the same in the constructor block of &quot;StreamingMediaPlayer&quot;
3) I modified the method createMediaPlayer(File file) as shown below:

    private MediaPlayer createMediaPlayer(File mediaFile)
    throws IOException {
    	MediaPlayer mPlayer = new MediaPlayer();
    	mPlayer.setOnErrorListener(
				new MediaPlayer.OnErrorListener() {
			        public boolean onError(MediaPlayer mp, int what, int extra) {
			        	Log.e(getClass().getName(), &quot;Error in MediaPlayer: (&quot; + what +&quot;) with extra (&quot; +extra +&quot;)&quot; );
			    		return false;
			        }
			    });

		//  It appears that for security/permission reasons, it is better to pass a FileDescriptor rather than a direct path to the File.
		//  Also I have seen errors such as &quot;PVMFErrNotSupported&quot; and &quot;Prepare failed.: status=0x1&quot; if a file path String is passed to
		//  setDataSource().  So unless otherwise noted, we use a FileDescriptor here.
		FileInputStream fis = new FileInputStream(mediaFile);
		mPlayer.setDataSource(fis.getFD());
		mPlayer.setDisplay(surfaceHolder);
		mPlayer.prepare();
	    surfaceHolder.setFixedSize(400, 300);
		return mPlayer;
    }

4)  In the method &quot;transferBufferToMediaPlayer()&quot; I did not call the method createMediaPlayer(File file) instead I wrote a new method appendNewDownloadData(File file) as shown below:

    private void appendNewDownloadData(File bufferedFile)
    throws IOException {
		FileInputStream fis = new FileInputStream(bufferedFile);
		mediaPlayer.reset();
		mediaPlayer.setDataSource(fis.getFD());
		mediaPlayer.prepare();
	}


Summary of what I have added to the code:
1) Added a SurfaceView to the XML
2) Got a SurfaceHolder from the SurfaceView
3) Used the api&#039;s : 
                MediaPlayer.setDisplay(SurfaceHolder)
                SurfaceHolder.setFixedSize(int, int)
                
Could any help me achieve this video Display. Thanks in advance.



@ Biosopher: Do you have any updated tutorial for video Streaming???


Cheers,
Praveen.]]></description>
		<content:encoded><![CDATA[<p>Hi, Thanks for this awesome tutorial. Lot of my doubts got cleared and I could learn lots from here.<br />
I&#8217;m new to android and currently working to stream a video instead of the audio streaming presented here. I modified the code to show a video but then I couldn&#8217;t. The extra code that I have added is:<br />
1)  Add a surface view to the xml page.<br />
2) get a SurfaceHolder for the same in the constructor block of &#8220;StreamingMediaPlayer&#8221;<br />
3) I modified the method createMediaPlayer(File file) as shown below:</p>
<p>    private MediaPlayer createMediaPlayer(File mediaFile)<br />
    throws IOException {<br />
    	MediaPlayer mPlayer = new MediaPlayer();<br />
    	mPlayer.setOnErrorListener(<br />
				new MediaPlayer.OnErrorListener() {<br />
			        public boolean onError(MediaPlayer mp, int what, int extra) {<br />
			        	Log.e(getClass().getName(), &#8220;Error in MediaPlayer: (&#8221; + what +&#8221;) with extra (&#8221; +extra +&#8221;)&#8221; );<br />
			    		return false;<br />
			        }<br />
			    });</p>
<p>		//  It appears that for security/permission reasons, it is better to pass a FileDescriptor rather than a direct path to the File.<br />
		//  Also I have seen errors such as &#8220;PVMFErrNotSupported&#8221; and &#8220;Prepare failed.: status=0&#215;1&#8243; if a file path String is passed to<br />
		//  setDataSource().  So unless otherwise noted, we use a FileDescriptor here.<br />
		FileInputStream fis = new FileInputStream(mediaFile);<br />
		mPlayer.setDataSource(fis.getFD());<br />
		mPlayer.setDisplay(surfaceHolder);<br />
		mPlayer.prepare();<br />
	    surfaceHolder.setFixedSize(400, 300);<br />
		return mPlayer;<br />
    }</p>
<p>4)  In the method &#8220;transferBufferToMediaPlayer()&#8221; I did not call the method createMediaPlayer(File file) instead I wrote a new method appendNewDownloadData(File file) as shown below:</p>
<p>    private void appendNewDownloadData(File bufferedFile)<br />
    throws IOException {<br />
		FileInputStream fis = new FileInputStream(bufferedFile);<br />
		mediaPlayer.reset();<br />
		mediaPlayer.setDataSource(fis.getFD());<br />
		mediaPlayer.prepare();<br />
	}</p>
<p>Summary of what I have added to the code:<br />
1) Added a SurfaceView to the XML<br />
2) Got a SurfaceHolder from the SurfaceView<br />
3) Used the api&#8217;s :<br />
                MediaPlayer.setDisplay(SurfaceHolder)<br />
                SurfaceHolder.setFixedSize(int, int)</p>
<p>Could any help me achieve this video Display. Thanks in advance.</p>
<p>@ Biosopher: Do you have any updated tutorial for video Streaming???</p>
<p>Cheers,<br />
Praveen.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: 안드로이드 개발 팁 &#171; 가짜해커</title>
		<link>http://blog.pocketjourney.com/2008/04/04/tutorial-custom-media-streaming-for-androids-mediaplayer/#comment-946</link>
		<dc:creator><![CDATA[안드로이드 개발 팁 &#171; 가짜해커]]></dc:creator>
		<pubDate>Sun, 06 Nov 2011 04:18:50 +0000</pubDate>
		<guid isPermaLink="false">http://pocketjourney.wordpress.com/?p=16#comment-946</guid>
		<description><![CDATA[[...] http://blog.pocketjourney.com/2008/04/04/tutorial-custom-media-streaming-for-androids-mediaplayer/ [...]]]></description>
		<content:encoded><![CDATA[<p>[...] <a href="http://blog.pocketjourney.com/2008/04/04/tutorial-custom-media-streaming-for-androids-mediaplayer/" rel="nofollow">http://blog.pocketjourney.com/2008/04/04/tutorial-custom-media-streaming-for-androids-mediaplayer/</a> [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bookmarks &#171; 101</title>
		<link>http://blog.pocketjourney.com/2008/04/04/tutorial-custom-media-streaming-for-androids-mediaplayer/#comment-945</link>
		<dc:creator><![CDATA[Bookmarks &#171; 101]]></dc:creator>
		<pubDate>Sat, 05 Nov 2011 07:18:37 +0000</pubDate>
		<guid isPermaLink="false">http://pocketjourney.wordpress.com/?p=16#comment-945</guid>
		<description><![CDATA[[...] Android Tutorial 3: Custom Audio Streaming with MediaPlayer « Pocket Journey [...]]]></description>
		<content:encoded><![CDATA[<p>[...] Android Tutorial 3: Custom Audio Streaming with MediaPlayer « Pocket Journey [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>

