android-mediaplayer

Android Mediaplayer doesnt throw IO exception If file not available at the link

旧巷老猫 提交于 2019-12-08 06:57:04
问题 I am starting mediaplayer with a URL. The URL suppose to link to a video/Audio . But i have deleted the video/audio file from the location, hence i would like to expect a IOException id there is nothing available at that link. But i am not getting the IO exception. Instead mediaplayer itself try to go to the linkl 10 times and finally throw the error on onErrorListner. follwings are the logs printed while mediaPlayer is preparing. Note: - my url is not for local storaged file!! its for server

Youtube Player API android crashes on playback on some devices

空扰寡人 提交于 2019-12-08 05:13:32
问题 This is the stack trace I get from the device (Sony Xperia Miro), when I try to play a video using the Player API. This is the stack trace for the error. Any assistance is welcome. The code seems to work fine on some other devices like Galaxy Nexus, Nexus 7 etc. FATAL EXCEPTION: main java.lang.NullPointerException at com.google.android.apps.youtube.core.player.AdStatsMacros.a(SourceFile:185) at com.google.android.apps.youtube.core.client.DefaultAdStatsClient.a(SourceFile:481) at com.google

Using Media Button Broadcasts with Samsung's default media player

时光总嘲笑我的痴心妄想 提交于 2019-12-08 04:21:54
问题 I built an app using Intent.ACTION_MEDIA_BUTTON to control the current media play, but a customer reported it wasn't working with their Samsung music player. Does anyone know if the Samsung media player doesn't support media buttons, and if so how to fix it? 回答1: I don't have a solution for you, but I can confirm that the stock media player on my Samsung Galaxy S / Android 2.1 testing unit does not respond to either 'toggle play/pause' (KEYCODE_MEDIA_PLAY_PAUSE) or 'next track' (KEYCODE_MEDIA

How to set volume in decibels using my android mobile application?

♀尐吖头ヾ 提交于 2019-12-08 04:00:30
问题 I am working on a mobile app, where i need to play the sound file. On volume button press, i need to increase/decrease the volume through my app. I am using Media player to play and using SetVolume(left, right) function to set the volume. MediaPlayer mp; float left = 0.0f; float right = 0.6f; public void OnPlay(View v){ mp = MediaPlayer.create(this, R.raw.twofiftybeep); audioManager = (AudioManager) getSystemService(Context.AUDIO_SERVICE); mp.start(); mp.setOnCompletionListener(new

Android AudioFlinger server died | media server died

假如想象 提交于 2019-12-08 01:56:48
问题 I am trying to develop a hls player on android devices, and i have some test-streams i can play with. A problem i have is that the HLS stream just "stops", freezes at some random locations, it could be after 1 minute, or after 20. The error i get is: 11-20 14:14:10.484: W/AudioSystem(18531): AudioFlinger server died! 11-20 14:14:10.484: W/IMediaDeathNotifier(18531): media server died and 11-20 14:14:10.484: E/MediaPlayer(18531): Error (100,0) I've got basically no idea on how to prevent or

m3u8 file not playing in Android Emulator

半世苍凉 提交于 2019-12-08 00:44:23
问题 I am trying to playback a m3u8 file in Android Emulator. http://devimages.apple.com/iphone/samples/bipbop/bipbopall.m3u8 It's not able to playback the video but audio is heard. I get the following error E/OMXNodeInstance( 39): OMX_GetExtensionIndex failed . I traced the calls and I see that the video decoder is not instantiated properly, I find that OMXNodeInstance::enableGraphicBuffers is getting called and that calls, OMX_ERRORTYPE err = OMX_GetExtensionIndex(...,const_cast<OMX_STRING>("OMX

Handling Incoming calls in android application

无人久伴 提交于 2019-12-07 20:46:44
问题 I have developed a music related android application. I have a problem in handling the mediaplayer on incoming call. I want to pause the audio during the phonecall and resume it back after the call gets ended. I need suggestions whether to use TelephonyManager with onstatechanged to pause and resume the audio (OR ) any other methods to pause and resume the application itself during Incoming calls. 回答1: use onPause() and onResume() methods in your activity. When an incoming call comes, onPause

File that I recorded with MediaRecorder can't be played

☆樱花仙子☆ 提交于 2019-12-07 19:07:49
问题 I'm using MediaRecoder to record sound, but after I'm done recording it can't be played. I tried with Google Play Music, ES Media Player, even uploaded it to pc and tried opening it with Winamp. Nothing plays it! //AUDIO RECORDER recorder = new MediaRecorder(); recorder.reset(); recorder.setAudioSource(MediaRecorder.AudioSource.MIC); recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP); recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB); if (Environment

Closing MediaPlayer properly

强颜欢笑 提交于 2019-12-07 18:23:17
问题 I've got a MediaPlayer activity that I thought I was finished with until I noticed the verbose LogCat output and saw this constantly repeating. 01-17 17:03:50.466: D/StatusBarPolicy(209): iconIndex=1 01-17 17:03:50.476: V/StatusBarPolicy(209): cdmaLevel:1;max:4 01-17 17:03:50.476: D/StatusBarPolicy(209): iconLevel:1 01-17 17:03:50.476: D/StatusBarService(209): updateIcon slot=phone_signal index=20 viewIndex=14 old=StatusBarIcon(pkg=com.android.systemui id=0x7f020007 level=0 visible=true num=0

MediaPlayer.getDuration() returning wrong duration

跟風遠走 提交于 2019-12-07 16:52:12
问题 The MediaPlayer's getDuration() method is giving me an incorrect value for some audio files. I think the common trait for all these files is that they were manipulated using Audacity or some other audio editing tool. This is a problem when trying to tie MediaPlayer progress to a Progress Bar. I went ahead and logged it: while(mPlayer.isPlaying()) Log.i("progress/total", mPlayer.getCurrentPosition() + "/" + mPlayer.getDuration()); and found this: I/progress/total(643): 14615/14620 I/progress