Re: [android-developers] MediaPlayer StreamVideo question.

2011-01-09 Thread Mark Murphy
Step #1: Use lowercase http in URLs.

Step #2: Don't use an emulator, use hardware.

Step #3: Make sure the extension matches the actual file format.

Step #4: Use LogCat (via DDMS or adb logcat) to look at any warnings
that might be emitted by the multimedia subsystem.

On Sat, Jan 8, 2011 at 9:25 PM, Scott Deutsch  wrote:
> I did  what you said. Instead of a file for the local path, replaced it with
> HTTP://.../test.3gp   .. =
> URI uri = Uri.parse("HTTP://./test.3gp"); the file format i used was
> .3gp?  Ignore the . I had a real domain name in there.
> mMediaPlayer.setDataSource(this, uri);
>
> And no luck. It does not play it.
> Any ideas? thanks friends.
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en



-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

_The Busy Coder's Guide to *Advanced* Android Development_ Version 1.9
Available!

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] MediaPlayer StreamVideo question.

2011-01-08 Thread Scott Deutsch
I did  what you said. Instead of a file for the local path, replaced it with 
HTTP://.../test.3gp   .. =

URI uri = Uri.parse("HTTP://./test.3gp"); the file format i used was 
.3gp?  Ignore the . I had a real domain name in there.
mMediaPlayer.setDataSource(this, uri);

And no luck. It does not play it.

Any ideas? thanks friends.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] MediaPlayer StreamVideo question.

2011-01-08 Thread Mark Murphy
On Sat, Jan 8, 2011 at 8:24 PM, Scott Deutsch  wrote:
> First question is. is it better to store the apps video as a resource on the
> phone?

I've heard of a lot of people having problems playing videos stored as
resources. I haven't tried it myself, since IMHO shipping videos in
the APK is just plain too big.

> If yes, what format would you recommend.

You don't exactly have a ton of options:

http://developer.android.com/guide/appendix/media-formats.html

> Or, would it be better to
> store the videos on a web server and stream the videos to the app when
> requested.

Well, the third option is you download the videos to external storage
at some point in time. Either that or streaming will be preferable to
storing them as raw resources, IMHO.

> My app is going to have lots of video's eventually.

All the more reason why you can't have them as resources, since
there's a 50MB APK size limit for distribution through the Android
Market, and having APKs that big anyway will be a problem for a lot of
Android users on 1+ year old phones.

> Now, if it is better to store them on the cloud/interwebs, how do you do
> streaming video with the MediaPlayer class.

Hand it an RTSP or HTTP URL instead of a local file path. Make sure
the video is "safe for streaming" (for MP4 files, that means the MOOV
atom appears before the first MDAT atom, which you can accomplish via
MP4Box -hint).

> Either way, where are good tutorials on doing anyone of these solutions. I
> already have the MediaPlayer class in my app and it works for playing local
> stuff. I just have to make it work for streaming vids.

Hand it an RTSP or HTTP URL instead of a local file path, and you're done.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

_The Busy Coder's Guide to Android Development_ Version 3.4 Available!

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] MediaPlayer StreamVideo question.

2011-01-08 Thread Scott Deutsch
Hello Group,

First question is. is it better to store the apps video as a resource on the 
phone? If yes, what format would you recommend. Or, would it be better to 
store the videos on a web server and stream the videos to the app when 
requested.

My app is going to have lots of video's eventually. I am thinking around 
10min each. Let's say for now 5 videos. But, will be more down the road. 
They are intro videos for my application for each objective type thing.

Now, if it is better to store them on the cloud/interwebs, how do you do 
streaming video with the MediaPlayer class. Do you have to store Temp files 
while it buffers or does it just stream? Also, if it does store temp files, 
where should I store them?

Some how my instinct is telling me, put files on a server and cache the 
buffer vids. 


Either way, where are good tutorials on doing anyone of these solutions. I 
already have the MediaPlayer class in my app and it works for playing local 
stuff. I just have to make it work for streaming vids.

Thanks group.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en