media-player

Android MediaPlayer not returning from prepareAsync

[亡魂溺海] 提交于 2019-12-11 05:14:42
问题 I'm getting the following back in Logcat starting MediaPlayer with a SPECIFIC URI. Normally every Uri, good or bad, will either play or come back with an error except this particular one. I/MPS﹕ PrepAsync started V/MediaPlayer﹕ message received msg=8, ext1=0, ext2=0 V/MediaPlayer﹕ unrecognized message: (8, 0, 0) V/MediaPlayer﹕ callback application V/MediaPlayer﹕ back from callback ... and hangs there. I'm really just looking at how do I capture this conversation in an error handler but if

JavaFX audio doesn't seem to be playing

删除回忆录丶 提交于 2019-12-11 04:35:39
问题 I am fairly new to JavaFX and recently wanted to play audio with an MP3 file rather than WAV. From what I can tell, I am doing things correctly and I don't get any errors, but I also don't hear any sound. I will post the parts of my code that matter below. If I'm missing something please let me know. Thanks. try { URL sound = getClass().getResource("/resources/origin.mp3"); Media hit = new Media(sound.toExternalForm()); musicPlayer = new MediaPlayer(hit); musicPlayer.setVolume(1.0); } catch

MediaPlayer not playing live stream for some audio file

折月煮酒 提交于 2019-12-11 04:32:21
问题 some audio file url not playing in mediaplayer here my code mediaPlayer = new MediaPlayer(); if (mediaPlayer != null) { try { String audioUrl = Constants.AudioLink.toString().replace(" ", "%20"); mediaPlayer.setDataSource(audioUrl); mediaPlayer.prepareAsync(); mediaPlayer.setOnErrorListener(new MediaPlayer.OnErrorListener() { @Override public boolean onError(MediaPlayer mediaPlayer, int i, int i1) { Progressdialogs.getInstance().closeDialog(); Toast.makeText(AudioPlayActivity.this, "Failed to

Getting song image very slow (MediaMetadataRetriever)

痴心易碎 提交于 2019-12-11 04:29:09
问题 I am working on media player application i am getting song image using MediaMetadataRetriever and i am getting image and and i set using Glide but image takes about 7-9 sec to load that is very very slow. i also try using BitmapFactory but that also same time. so there is any faster way that can i get song image. Thanks in advance Here is my code that i getting image using MediaMetadataRetriever. MediaMetadataRetriever retriever = new MediaMetadataRetriever(); retriever.setDataSource(songpath

MediaPlayer.OnCompletionListener and View.OnClickListener?

北战南征 提交于 2019-12-11 03:31:13
问题 I am currently trying: extends Activity implements MediaPlayer.OnCompletionListener extends Activity implements View.OnClickListener at the same time and its not working or rather im not sure how to implement it...how would I go about doing this? edit: maybe it will help if I show you guys what I have now and its not working: package com.vamp6x6x6x.rusty; import java.io.IOException; import com.vamp6x6x6x.rusty.R; import android.app.Activity; import android.graphics.Bitmap; import android

Android Media player seekbar play from stopped position

五迷三道 提交于 2019-12-11 03:01:56
问题 I am trying to play a song by using seek bar listener. But when I try to drag the progress bar then it is playing from beginning of the song. It need to play from that dragged position. Here is my code: public class MainActivity extends Activity { private TextView prairText; private AssetFileDescriptor descriptor; private SeekBar seekBar; private MediaPlayer mp = new MediaPlayer(); @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState);

Why android mediaPlayer “onBufferingUpdate” is not work well

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-11 02:56:53
问题 mPlayer.setOnPreparedListener(new OnPreparedListener() { @Override public void onPrepared(MediaPlayer mp) { hideBgAndLoadProcess(); if (mPlayer.isPlaying()) { mPlayer.stop(); } Log.e("TAG", "onPrepared is called"); mPlayer.start(); } }); mPlayer.setOnBufferingUpdateListener(new OnBufferingUpdateListener() { @Override public void onBufferingUpdate(MediaPlayer mp, int percent) { Log.e("TAG", "percent is :" + percent); sbProgress.setSecondaryProgress(percent); int currentProgress = sbProgress

Unable to play media with vlc ocx

亡梦爱人 提交于 2019-12-11 02:39:26
问题 I want to embed the vlc media player in a .NET application I've found a lot of solutions VLC .Net interface <- didn't work with me wrappers for dll functions <> http://vlcdotnet.codeplex.com this is nice the activex of VLC - i really liked to use it it must be less bugs and errors but errors found I found 2 controls "VLC ActiveX plugin and IE web plugin v1" , "VLC ActiveX plugin and IE web plugin v2" What is the difference between them?? i dragged and dropped the fist one and used the

using android mediaPlayer object for multiple dataSources, use of release();

谁都会走 提交于 2019-12-11 02:26:40
问题 I have several raw sound files that I want to play using the MediaPlayer class in the android API, before I change the data source to a different file do I have to call release(); The documentation says that the release(); method will end the MediaPlayer object, I am using the same MediaPlayer object to switch between the different raw files so will that interfere, or do I just call release after the program ends 回答1: Call reset() first. It resets the MediaPlayer to its uninitialized state.

Mediaplayer prepare showing Illegal State Exception

随声附和 提交于 2019-12-11 02:08:27
问题 I am trying to play an audio file from the internal storage. The code I used is.. package com.abhi.firstapp.firstapp; import android.content.Context; import android.media.AudioManager; import android.media.MediaPlayer; import android.net.Uri; import android.os.Bundle; import android.os.Environment; import android.support.design.widget.FloatingActionButton; import android.support.design.widget.Snackbar; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.Toolbar;