Hello,
I would like my app to simply start the build in media player and play a video. I've seen lots of information about creating a VideoView or creating a SurfaceView and using the android.media.MediaPlayer class but this is not what I want. I'm looking for something simple like
Code:
intent video Intent = new Intent(SOME_ACTION, PATH_TO_VIDEO);
startActivity(videoIntent);
is this possible?
Thanks,
Sam
Edit: I don't know what I was doing before but it does seem to work exactly like that
I just did
Code:
Uri uri = Uri.parse("path_to_video");
Intent videoIntent = new Intent(Intent.ACTION_VIEW, uri);
startActivity(videoIntent);
I feel kind of stupid now haha. this thread can be deleted
Related
I've written a small app to parse some rss feeds from YouTube and launch videos selected by the user. To play the video, I'm using an intent:
Intent i = new Intent(Intent.ACTION_VIEW, Uri.parse(videoAddress);
in order to call the YouTube app, if installed on the device.
The problem I'm having is that, of the population of videos I am using in my app, about 90% of them display a 'Cannot play video' error message: "Sorry, this video cannot be played.". A few of them work just fine from my app. The videos that do not work will play fine in the YouTube app if searched for and launched entirely from within the YouTube app.
Has anybody seen this behavior, or does anybody have any ideas for things to try? Obviously the YouTube app launches videos in a slightly different way internally than it does from an Intent request, but I haven't a clue how to get to the bottom of it.
Hi,
I am also facing the same problem ... " Not able to play the videos in YouTube"
When i analysed the log, i could note that youtube is not calling the my movieplayer(this is app written to support all kind of playback). Instead it is directly calling the "MediaPlayer" service and PVPlayer service.
I would be thankful if i someone explains as how the youtube launches the video
Thank you
Which are the ENERGY EFFICIENT APPS but still SERVES the PURPOSE perfectly for basic needs like
music = ?
web browsing = ?
im = ?
launcher = ?
notes = ?
documents = ?
Videos = ?
Maps = ?
Recording = ?
(You can mention other categories also)
Let your observations be HELPFUL (VERY MUCH) to others also....
So, lets list them out now....
Here is mine!
music = default
web browsing =opera
im =trillian
launcher =launcher pro
notes =don't use
documents =kingsoft office
Videos =default
Maps =google maps/iGo
Recording =don't use
i know these are not the best but i find it usefull. let's see other users got.
urm...
music = default
web browsing = Opera Mini
im = imo beta for me
launcher = Zeam launcher
notes = Any one will do
documents = thinkfree
Videos = stock
Maps = GET RID OF THAT GOOGLE MAPS ****
Recording = defaukt
My List
I'm not sure if they are energy efficient, but these are the one's that i use
Music = TTPod
Web browsing = Opera mini / Dolphin mini
IM = Nimbuzz / Office Talk
Launcher = Zeam Launcher
Notes = My Notes
documents = Picsel Smart Office
Videos = Mobo Player
Maps = Google Maps ( Frozen by Titanium backup)
Recording = Default
music = MIUI music
web browsing = Default/opera mini
im = NA
launcher = Zeam
notes = NA
documents = NA
Videos = default/QuicPic
Maps = Google Maps (no Problems Anymore. Dont wanna use it End Process and All is Fine)
Recording = hertz( records wave in 41k Samples)
music = stock
web browsing = stock/opera
im = Skype
launcher = Laucher 7 Donate
notes = Astrid Tasks
documents = Thinkfree Office (come from tock rom )
Videos = Moboplayer
Maps = Google!
Recording = what? voice - stock
Camera = lgCamera Pro
music = MIUI music
web browsing = Default/opera mini
im = doesn't use
launcher = launcher pro
notes = extensive notes pro
documents = thinkfree office
Videos = mx video player/real player
Maps = Google Maps
Recording = default
If my information help you than hit thanks button.
I'm in the process of creating an app, coding it in java of course, and I need to analyze and compare some audio. Some sounds and changes in pitch/frequency. I can code the comparisons, I just need to know how to get the data. I found a few random libraries that say they decode audio, but I honestly have never worked with this type of data. I imagine it will be in wave form and I'll just use some trig equations with the sample input as the variables? If anyone has any information or documentation it would be greatly appreciated.
Thanks in advance.
Phlip00ws6 said:
I'm in the process of creating an app, coding it in java of course, and I need to analyze and compare some audio. Some sounds and changes in pitch/frequency. I can code the comparisons, I just need to know how to get the data. I found a few random libraries that say they decode audio, but I honestly have never worked with this type of data. I imagine it will be in wave form and I'll just use some trig equations with the sample input as the variables? If anyone has any information or documentation it would be greatly appreciated.
Thanks in advance.
Click to expand...
Click to collapse
What file types are you going to process? The easiest are WAV file -- they have very simple format that you can parse youself. Types as MP3 have really complex structure, so you'll definitly will need some libs to handle them.
SergeyPo said:
What file types are you going to process? The easiest are WAV file -- they have very simple format that you can parse youself. Types as MP3 have really complex structure, so you'll definitly will need some libs to handle them.
Click to expand...
Click to collapse
Yes wavs would be ideal.. from what I've seen there's no direct way to record in .wav. From the android documentation, using the MediaRecorder, the following are the output formats:
int AAC_ADTS AAC ADTS file format
int AMR_NB AMR NB file format
int AMR_WB AMR WB file format
int DEFAULT
int MPEG_4 MPEG4 media file format
int RAW_AMR This constant was deprecated in API level 16. Deprecated in favor of MediaRecorder.OutputFormat.AMR_NB
int THREE_GPP 3GPP media file format
I noticed that the AudioRecord class can store straight to PCM, but then again I'm not 100% on how to parse it to "comparable data".
If you need to work with the fequencies and that kind of sound processing stuff, maybe the DSPManager repo can provide you with a good place to look for snippets
Phlip00ws6 said:
Yes wavs would be ideal.. from what I've seen there's no direct way to record in .wav. From the android documentation, using the MediaRecorder, the following are the output formats:
int AAC_ADTS AAC ADTS file format
int AMR_NB AMR NB file format
int AMR_WB AMR WB file format
int DEFAULT
int MPEG_4 MPEG4 media file format
int RAW_AMR This constant was deprecated in API level 16. Deprecated in favor of MediaRecorder.OutputFormat.AMR_NB
int THREE_GPP 3GPP media file format
I noticed that the AudioRecord class can store straight to PCM, but then again I'm not 100% on how to parse it to "comparable data".
Click to expand...
Click to collapse
Try this -- i-liger.com/article/android-wav-audio-recording
I'll try using the wav guide from SergeyPo, and then see if I can get some useful data from the DSPManager code. Thanks!
Did you check this? http://forum.xda-developers.com/showthread.php?t=2246034
Hello
I'm currently making an app and i want to spruce up the login screen with a video like Spotify currently has.
It plays a small video in the background, behind the login buttons/logo etc and simply loops the video over and over again.
I've tried to mess around with a VideoView and a MediaPlayer to control it, but i can't seem to get a proper grip on it. And especially not with setting the correct size of the video dependent on different screen sizes or looping the video.
If anyone got an idea/link/knows how Spotify does it, i'd love to get some inputs
- Moon
Moonbloom said:
Hello
I'm currently making an app and i want to spruce up the login screen with a video like Spotify currently has.
It plays a small video in the background, behind the login buttons/logo etc and simply loops the video over and over again.
I've tried to mess around with a VideoView and a MediaPlayer to control it, but i can't seem to get a proper grip on it. And especially not with setting the correct size of the video dependent on different screen sizes or looping the video.
If anyone got an idea/link/knows how Spotify does it, i'd love to get some inputs
- Moon
Click to expand...
Click to collapse
For the loop part you could try alarm manager. Now I know this is not the ideal solution for your case, but it works well if you want to loop a function
PHP:
PendingIntent pi;
BroadcastReceiver br;
AlarmManager am;
private void replay() {
br = new BroadcastReceiver() {
@Override
public void onReceive(Context c, Intent i) {
//The method which runs video
}
};
registerReceiver(br, new IntentFilter("com.your.packagename") );
pi = PendingIntent.getBroadcast( this, 0, new Intent("com.your.packagename"),0 );
int video_length =exact length of your video in seconds;
am = (AlarmManager)(this.getSystemService( Context.ALARM_SERVICE ));
am.setRepeating(AlarmManager.RTC, System.currentTimeMillis(), 1000 * video_length, pi);
}
call this replay method at the place where you are calling the method to play the video.
Worth a try, might work
Moonbloom said:
Hello
I'm currently making an app and i want to spruce up the login screen with a video like Spotify currently has.
It plays a small video in the background, behind the login buttons/logo etc and simply loops the video over and over again.
I've tried to mess around with a VideoView and a MediaPlayer to control it, but i can't seem to get a proper grip on it. And especially not with setting the correct size of the video dependent on different screen sizes or looping the video.
If anyone got an idea/link/knows how Spotify does it, i'd love to get some inputs
- Moon
Click to expand...
Click to collapse
Did you tried to use MediaPlayer.OnCompletionListener to restart a video? To be honest I'm not sure, that this way will provide smooth restart.
I can't download Spotify, because it's not available in my country, but maybe Spotify uses something like looped AnimationDrawable?
AnimationDrawable works great with short animations.
Hi,
I wonder if there is an easy imlementation of video conferencing on Android.
I have one android public use device and many private use devices.
Using scenario :
User will select a private device to connect and public device will connect to that private device.
Server will send cam video and mic audio to connected private device and play only audio stream from connected private device.
Private device needs to send only mic audio to public device and play received streams.
Options tried are below :
- Streaming to devices from java. I cant find an easy way to implement it.
- Streaming using ffmpeg etc. It is still too low level for our system and high latency. I think I need to configure my ffserver.
- WebRTC, I only tried it on browsers level. It is slow sometimes and needs a server. I cant find any serverless implementation.
Any suggetions appreciated. Thanks.
turgutbasar said:
Hi,
I wonder if there is an easy imlementation of video conferencing on Android.
I have one android public use device and many private use devices.
Using scenario :
User will select a private device to connect and public device will connect to that private device.
Server will send cam video and mic audio to connected private device and play only audio stream from connected private device.
Private device needs to send only mic audio to public device and play received streams.
Options tried are below :
- Streaming to devices from java. I cant find an easy way to implement it.
- Streaming using ffmpeg etc. It is still too low level for our system and high latency. I think I need to configure my ffserver.
- WebRTC, I only tried it on browsers level. It is slow sometimes and needs a server. I cant find any serverless implementation.
Any suggetions appreciated. Thanks.
Click to expand...
Click to collapse
I've already seen this type of thing with Skype and Google Hangouts. Not sure if that's what you mean or if what your talking about is completely different.