Playing mp4 and avi files in android - android

I have mp4 and avi, two types of files on sdcard. Should I need to give full name with extension in code to play this file?
Please help me regarding this.

You will get IOException.
You are setting the path in setDataSource.
For example,
You want to play sdcard/yourMP4file.mp4,if you are not giving full path,then it will take sdcard/yourMP4file as filepath.....
Actually sdcard/yourMP4file does not exists,what exists is sdcard/yourMP4file.mp4. So you will get IOException

Without the extension, the file can not be found correctly. SetDatasource will throw out exception.
http://developer.android.com/reference/android/media/MediaPlayer.html#setDataSource(java.lang.String)

Related

Android_Can't play the mp4 file generated by MediaMuxer

I am trying to use MediaCodec and MediaMux to generate mp4 file. The code I am using is here.
I get some mp4 file. However, I can't play it with my player, which is just a normal software.
Does anyone has any idea? What should I do next?
I had a similar issue - in my case I simply wasn't calling muxer.stop() and ended up with a large unplayable file.

Android mp4 videos in raw do not work after widevine signing

My problem is that before the signing with widevine the video is displayed as it should.
The video is located in resources/raw
Errors I get are :
I/MediaPlayer(23023): path is null
D/MediaPlayer(23023): Couldn't open file on client side, trying server side
Does anyone have a idea of the root of this error or even a workaround ?
I tried to put the videos in assets but there was no difference
Thanks in advance and I hope there is someone out there that can help me
Assuming widewine is a drm, you need to decrypt before you can play. Either widewine will give you a player or a decrypting library which you must use to decrypt the content before you can play it.

(Android) Downloading MP3 file with app (Content not support)

When I download MP3 files with my app they go to the download folder and when I navigate there and try to play them I get content not supported. I have looked around a little bit, but can't figure out why. Anyone know how I can fix this, is it something with the MIME types? What does this do:
connection.setRequestProperty("Content-Type", "audio/*");
MP3 • Mono/Stereo 8-320Kbps constant (CBR) or variable bit-rate
(VBR) MP3 (.mp3)
Android Supports MP3 in the above format. Incorrect encoding makes this type of error. Also check to see if the extension and file names are proper. Because some downloaders may name the file like mywebsite.com-mysong.mp3. The android OS may wrongly interpret the file as a .com file rather than a .mp3 file.
Reference:
http://developer.android.com/guide/appendix/media-formats.html#core
Please ensure you save with the .mp3 extension. sometimes it can get lost along the way.

Upload 3gpp file to a web server

My question is I have used many examples of http uploads of files for the android. They all seem to work except for video files that are .3gpp. I use the same code for .mov video files and it works OK. On the web side is just a PHP script. Does any know or have successfully uploaded a video (.3gpp) to a server? I don't get any error that I can see. The code I use also works for image files (jpg). It's just the .3gpp file type.
Thanks for any help you can give me..
isnt it 3gp
is it possible u are giving it the wrong extension?
i would say that the method u are using to upload should be pretty dumb to what files its uploading so it should work (as u said). the only other thing is i would try to match file size. so do a 5mb picture then a 5min video to ensure it is the file type causing the error
i would also say that maybe the 3 in the extension could cause problems (depending on how or what is reading it)

Problem with Audio/Video

In my code i am using VideoView and MediaController for playing my audio/video files. The problem is that I need to place my audio/video files in assets folder but i am not able to play the audio/video files when placed in assets folder and give path as "file:///android_asset/audio.mp3". I get this error "Command PLAYER_SET_DATA_SOURCE completed with an error or info PVMFErrNotSupported". But the same code runs when i place my audio/video files in sdcard and give its path(/sdcard/audio.mp3). Does this mean that i cannot play audio/video files when placed in assets folder? Thanks in advance.
Your path is wrong.
For playing audiofiles from the assets directory, you have to follow the advice in the similar question here.

Categories

Resources