Android :: Instances Of MediaPlayer To Play Sounds/video
Jan 18, 2010
Is it possible to have two instances of MediaPlayer to play sounds/ video? How many instances are actually allowed? I can see from the Javadocs that there is a limited amount of instances of MediaPlayer allowed.
View 3 Replies
Oct 3, 2010
I have an app that worked fine on Android 2.1 (Eclair) but is no longer working in 2.2.1 (Froyo). I think this may have to do with the shift from OpenCore to StageFright for video encoding and decoding, but am unsure.
The debug logs show two things I'm not sure about:
Does this mean H.264 baseline is not supported? WARN/QCvdec(59): Parsing Error unsupported profile or level No idea about: ERROR/PVOMXVidDecNode(59): Ln 1373 OMX_EventError nData1 -2147479542 nData2 0
Play the following url (it works fine in VLC, for example): rtsp://nexus3.dropcam.com/6821ec44e37846428850ec195d69969a
The code:.........
The debug result:
CODE:................
View 3 Replies
View Related
Dec 3, 2009
Can anyone tell me if the Android MediaPlayer class is able to play a video stored in a remoted URL? Just for testing purposes, can I use the URL http://localhost/video-name.3gp. Another question is if the MediaPlayer works well on the emulator?
View 2 Replies
View Related
Jul 22, 2009
I need to correctly be able to differentiate between emulator instances. I know it's easily done with real devices. With real devices, you can use getDeviceId or getLine1Number from TelephonyManager. With emulators, all the instances have the same device id, same subscriber id, and same line1 number. Is there a way to differentiate them? Using NetworkInfo, I can call the toString method and I get my ip and the port on the computer. The problem with that is that the port is always different. I would like something more stable. Like when you use "adb devices" in command line. Emulator #1 is almost always "emulator-5556" and emulator#2 is almost always "emulator-5554". Is there a way to get the same info I get from "adb devices" in my code? If not, is it possible to use a command line parameter to force the emulator to use a certain phone number?
View 3 Replies
View Related
Aug 7, 2011
Im using Eclipse created new android project.First thing i added to the menifest xml file two lines:
Code:
uses-permissionandroid:name="android.permission.INTERNET"></uses-permission>
<uses-permissionandroid:name="android.permission.STORAGE"></uses-permission>
And this is the complete menifest file code:
Code:
xmlversion="1.0"encoding="utf-8"?>
manifestxmlns:android="http://schemas.android.com/apk/res/android"
package="com.AllFormatsVideoPlay"
android:versionCode="1"
android:versionName="1.0">
[code]....
Now i tried to play a video file .3gp from the internet youtube link via my android device ! not emulator. And it worked! But when i tried to play a video file .3gp or .mp4( i converted the mp4 from 3gp ) its not working. Im getting error "Cannot play video Sorry, this video cannot be played"
Tried to play with the link to my device wich is: I:DCIM100MEDIAVIDEO0030.3gp or .mp4 or tried this: I:/DCIM/100MEDIA/VIDEO0030.3gp with "" like: "I:/DCIM/100MEDIA/VIDEO0030.3gp ";
I tried to remove the I: but it didn't change anything.This is the main code im using to play the video files on my device. And there some lines i marked with // wich i used to play from the internet and im not using now.
Code:
com.AllFormatsVideoPlay;
import
android.app.Activity;
import
android.graphics.PixelFormat;
import
[code]....
View 7 Replies
View Related
Oct 12, 2010
There is an online stream that is 512Kb MPEG4 and total size of 312mb online and if I'm correct after looking over docs in order to play the movie I just simply put:
CODE:..................
It is triggered to play after a button press which after a few seconds after pressing the button it plays the audio BUT doesn't show the video, why not? Do I have to use a surface view or something for visual playback of the stream.
View 2 Replies
View Related
Apr 28, 2009
Could I somehow trick the player on playing something of this format? I know that there is support for AAC encoded files but just how?
View 2 Replies
View Related
Jul 3, 2009
Recent news say that flash porting is finished for android and HTC Hero has support for flash. Can I use MediaPlayer API to play flv media file? Is there such documents?
View 3 Replies
View Related
Jan 20, 2010
Attached is my code, I cannot see the video while playing a MPG file.
CODE:................
View 6 Replies
View Related
Jul 22, 2010
I am able play a media using MediaPlayer. The media played via the ear piece. But how can I play the media with speaker phone? e)But that does not work. And I have added this to my Manifest file.
View 7 Replies
View Related
Nov 8, 2010
In my music app, i would like to play live streaming like radio broadcasting with mediaplayer as Mediaplayer mp = new Mediaplayer(); mp.setDataSource(LiveStreamingURL); mp.prepare(); mp.start(); but after playing for few seconds it is stopped. I dont know how to overcome it. Give me your suggestions for this.
View 3 Replies
View Related
Apr 23, 2009
I have this task: Need to play short (0.3-0.4 sec) sounds all the time. When sound is played, it should start again, etc. User can press button to reset sound - it should stop and lunch.
I did many tests. I tried to create 1 MediaPlayer, then do this: MediaPlayer.OnCompletionListener complListener = new MediaPlayer.OnCompletionListener; code...
It works great on emulator and on device if I have eclipse+debugger on. When I disconnect debugger, I have very strange errors - sound can stop at all (till program restart), sound can start "repeating" (play 0.1-0.2 sec, then restart). Can someone please provide me some info about problem?
View 5 Replies
View Related
Sep 29, 2010
I try to play video, but all I get is sound and black screen. I don't understand what's wrong with the code. That video is 3gp, it works on my phone if I run it using standard phone player (without my program). I tryed VideoView, but no result...
Here's code:
CODE:...................
View 3 Replies
View Related
Jun 16, 2009
I have the following native source code that is supposed to display video. It plays 3gp file ok and I can hear the audio, but the video is not shown.
CODE:..............
View 4 Replies
View Related
Feb 14, 2009
I'm just trying to play a local video that is a resource with the MediaPlayer class in the most simple way possible. I have confirmed that the video works with players that I download from the marketplace, so I'm assuming that's not the issue.
The problem is that I just get a black screen with no video. There is audio from the file playing though, so I know that the file resource is being accessed correctly, it's just not showing anything on the screen in the emulator.
The one other note is that at any time whenever I try to access getVideoWidth() or getVideoHeight() I get this (non-blocking) error:
ERROR/MediaPlayerService(24): getVideoSize returned -1
Any ideas as to what I could be doing wrong?
import android.app.Activity; import android.os.Bundle; import android.view.SurfaceView; import android.view.SurfaceHolder; import android.media.MediaPlayer;
Code...
View 9 Replies
View Related
Oct 21, 2010
I am trying to play the same 10 sounds very quickly and wondering what is the best way?
1. Make 10 media players
2. Make 1 media player and set the sound each time
3. Use a soundpool?
View 3 Replies
View Related
Jun 3, 2010
Is it possible to play audio via an app like slacker.com or pandora.com or your personal audio files and simultaneously play another audio track over the top of it with a second app? My question is whether the sound hardware gets locked by the first app that accesses the audio hardware or whether a second app can access the hardware simultaneously, too.
View 2 Replies
View Related
Nov 24, 2009
I am using soundpool to use sounds in my app. One of the sounds i need to play continuously in background. any example how to do this ?
soundPool.play(soundPoolMap.get(sound), streamVolume, streamVolume, 1, 0, 1f).
View 3 Replies
View Related
Apr 27, 2009
I have a requirement to play several sounds many times in my game so instead of creating the MediaPlayer again and again I have called mp.seekTo(0) in onCompletion(mp) so that it will restart. Sometimes the sound is not audible from the device when I call mp.start () after setting mp.seekTo(0); but the player calls onCompletion() without playing any sound, this is observed randomly on most of the sounds
My sounds are of short duration mostly less than a second.
I am using a separate MediaPlayer for each sound (as I need this) -
There are almost 28 sounds in my game so i will be creating 28 MediaPlayers.
Below is the attached code for player
Also If I try to play many sounds one after the other in a short period of time i get an error saying "no more track names available". can u tell Why this is happening...?
check the below code:
CODE:........
View 9 Replies
View Related
Mar 31, 2009
I have an Activity that plays a brief OGG "pop" sound effect when bubbles pop. To keep it fast and to ensure I can play several pops, I create four MediaPlayer instances. I synchronize access to a pool of instances, so I can play up to four pops at once. Once a sound completes, I call seekTo(0) and return the MediaPlayer instance to my pool.
Here is a rough sketch of the code:
// when the activity resumes... for (int i=0; i<4; i++) {
MediaPlayer mp = MediaPlayer.create(context, R.raw.pop);
mp.setOnCompletionListener(this);
mp.setVolume(1f, 1f); players.add(mp); // put into a pool of available players }
View 4 Replies
View Related
Oct 9, 2010
I wrote an iPhone app some time ago that creates sound programatically. It uses an AudioQueue to generate sound. With the AudioQueue, I can register for a callback whenever the system needs sound, and respond by filling a buffer with raw audio data. The buffers are small, so the sound can respond to user inputs with reasonably low latency.
I'd like to do a similar app on Android, but I'm not sure how. The MediaPlayer and SoundPool classes seems to be for playing canned media from files, which is not what I need. The JetPlayer appears to be some sort of MIDI playback engine. Is there an equivalent to AudioQueue in the Android Java API? Do I have to use native code to accomplish what I want?
View 1 Replies
View Related
Feb 15, 2010
I am fiddling around with a dialog that pops up and displays an alarm information. (I know, it has been documented that in Android it's "better" style to use notifications instead, but just like the alarm clock I want it to display a dialog on top of whatever you do to really get the users immediate attention - as the user expects this behavior I don't think it's bad style!) Now - the only easy way I found is using the RingtoneManager.getRingtone() function to get a Ringtone object for the type "alarm". Well, I can play that sound now using Ringtone.play() - but it plays the sound only once and I cannot figure out how to let it play endlessly until the user reacts, e.g. by touching the dialog anywhere or dismissing it using Cancel button provided. Does anyone know how this can be accomplished easily?
View 1 Replies
View Related
Apr 14, 2012
My first coding project is a soundboard type thing on andriod using eclipse (on 2.3.3)whats wrong with my code, I dont get any errors but the button doesnt play the sounds.
Code:
package com.mkyong.android;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;[code]......
View 1 Replies
View Related
Feb 1, 2010
When I get a gtalk or text I hear the notification sound and it vibrates just fine. When I open gtalk and answer the text, then I put the phone down for a second and I don't hear any more notifications. This drives me nuts because then I pick it up and I see the person replied a long time ago.
On my old blackberry curve. Every time I get a message it would make a sound. With the droid, if you are in gtalk. It wont make a sound so other then checking the phone or looking at the notification light. I don't know a message came in.
View 4 Replies
View Related
Nov 28, 2009
My phone just decided to randomly play a mp3 at 3 am. I'm sound asleep, it woke me up, and I couldn't figure out how to stop it, or why it did it in the first place.
View 2 Replies
View Related
Dec 10, 2009
If this is a repeat of another thread then i apologize .i need a video player that will play mp4 video in full resolution for the droid.m coming from bb.can you help me with this.i don't care if it is free or not.
View 8 Replies
View Related
Jul 18, 2010
The sound on my video plays find on the HTC handset but after I download it to my PC from the USB cord there is no Audio. Only Video plays.
View 1 Replies
View Related
Mar 1, 2013
i have the golf channel app installed, on telus network. I cant get the videos to play, keep getting message "cant play video at this time:
View 4 Replies
View Related
Apr 6, 2010
The Eternal Speaker plays forever. I never noticed it before today, but my Eris is definitely not disabling music playback through the eternal speaker when I plug headphones (or an adapter, or anything) into the headphone jack. Sound still comes through the earbuds or headphones nice and crisp, just the speaker is ALSO playing the same sound, at the same volume.
This sort of defeats the purpose of one of the main reasons I use headphones- to mute sound for everyone but me. I tried different music players, different headphones, made sure the phone knew they were non-mic headphones, everything. I can't find a setting to tell the speaker to disable when headphones are in- isn't it supposed to be automatic?
View 9 Replies
View Related
Jun 24, 2010
Is there an option to auto disable my sounds while recording video? I forget sometime and it sucks during one of my life capturing episodes to hear my R2D2 ringtone to go off.
View 2 Replies
View Related