media-player

How to set the PlayList Index for Mediaplayer(ExpressionMediaPlayer:Mediaplayer)

烈酒焚心 提交于 2019-12-13 03:23:59
问题 I have a Mediaplayer control on my XAML page like below: <CustomMediaElement:CustomMediaPlayer x:Name="custMediaElement" VerticalAlignment="Center" Width="600" Height="300" Visibility="Collapsed" /> Now I am ble to set the playList by using setPlayList() method like below: private void setPlayList() { IEnumerable eLevelData = null; eLevelData = pMainPage.GetDataFromDictonary(pMainPage.strChildFolderID); foreach (RMSMedia folderItems in eLevelData) { string strmediaURL = folderItems

OnBufferingUpdate not being called in MediaPlayer

北战南征 提交于 2019-12-13 02:32:53
问题 My OnBufferingUpdate never gets called when I try to use it with my MediaPlayer. I'm using videos saved on my SDcard as the media source. I think this is the source of the problem and I'm wondering if OnBufferingUpdate only works for internet streams. The code I am using is below. public class FullImageActivity extends Activity implements SurfaceHolder.Callback, OnPreparedListener, OnInfoListener, OnErrorListener, OnBufferingUpdateListener{ private static final String TAG = "MediaPlayer shit"

Android Mediaplayer - based on seekbar progress update the elapsed time of audio in textview

故事扮演 提交于 2019-12-13 01:24:29
问题 Using Mediaplayer to play the audio file. Everything works fine but the elapsed time of audio need to be updated in textview. textview.setText(mediaplayer.getCurrentPosition()/100000.0).toString(); This gives the double value but if the end time is more than a minute and the elapsed time is 1minute it shows 0:60... but it should as 1:00... Is there anyother way to show the elapsed time based on seekbar progress? Thanks. 回答1: This works- Answer taken from another post : How do I correctly

Media Service Activity

痞子三分冷 提交于 2019-12-13 00:28:53
问题 I have an activity that is a service which plays audio using a media player. This is the service class MusicService extends Service implements OnCompletionListener { MediaPlayer mediaPlayer; @Override public IBinder onBind(Intent intent) { return null; } @Override public void onCreate() { mediaPlayer = MediaPlayer.create(this, R.raw.s);// raw/s.mp3 mediaPlayer.setOnCompletionListener(this); } @Override public int onStartCommand(Intent intent, int flags, int startId) { if (!mediaPlayer

Android MediaPlayer stops playing after some time

不羁的心 提交于 2019-12-12 19:02:51
问题 Having small game to play short sound after onclick ImageButton. But after touching 10times MediaPlayer stop playing sounds on short time. After sometime it play sound again. When I look to LogCat console it show error: E/MediaPlayer(19584): error (1, -2147483648) . Please can you show me the way to find sollution to solve this problem ? Why MediaPlayer gives me error ? I use this part of code to play Sound: public void playAudio () { try { mediaPlayer = MediaPlayer.create(getBaseContext(), R

Playing a sound file when a list item is clicked

浪尽此生 提交于 2019-12-12 18:35:40
问题 Just a disclaimer, I'm very new to both android and Java. The end product that I'm going after in this is a soundboard like application. I want to display a list of sounds that the user can tap on to play the associated sound file. So far I have setup a couple of string-arrays in my strings.xml file. One array represents the sounds available, and the second array represents the actual R.raw.soundfile resources. Might be easier to just show it. <string-array name="alex_list"> <item>Sound Title

Azure media player playback issue in IE and firefox

丶灬走出姿态 提交于 2019-12-12 17:21:22
问题 Getting an error while playing videos from azure media services. For the last 2 weeks i am facing this issue. In IE, no compatible source found for the current browser environment (0x10600003), In firefox,The video playback was aborted due to a corruption problem or because the video used features your browser did not support. 回答1: 0x10600000 - HTML5 playback issue, or unsupported DRM selected by JS. 0x10600001 - Flash player issue. 0x10600002 - Silverlight player issue. 0x10600003 -

Android Mediaplayer adjust volume

纵然是瞬间 提交于 2019-12-12 17:16:33
问题 Anyone know how can I increase/decrease the volume of the sound from mediaplayer by clicking on the volume button at the side of the phone? And how can I mute the sound if the phone was set to silent mode? Code I'm using: mp = MediaPlayer.create(this, R.raw.sound); mp.start(); 回答1: I think this is what you might be interested in: 1, increase/decrease the volume of the sound: Link Here Basically Override the onKeyDown and then call mp.setVolumn(float leftVolume,float rightVolume); 2, mute the

MediaRecorder IOException: prepare failed

我的未来我决定 提交于 2019-12-12 15:06:34
问题 I want to use MediaRecorder to record voice, my code is: public void record(View v) { Log.d(TAG, "record"); this.mediaRecorder.setAudioChannels(1); this.mediaRecorder.setAudioSamplingRate(44100); this.mediaRecorder.setAudioEncodingBitRate(64000); this.mediaRecorder.setAudioSource(MediaRecorder.AudioSource.MIC); this.mediaRecorder.setOutputFormat(MediaRecorder.OutputFormat.MPEG_4); this.mediaRecorder.setOutputFile(this.file.getAbsolutePath()); this.mediaRecorder.setAudioEncoder(MediaRecorder

Android Mediaplayer: setDataSource issue for downloaded media file

橙三吉。 提交于 2019-12-12 10:30:49
问题 I have an application that will record and play audio files. Some of the audio files are downloaded using simple standard http downloads using httpclient. It worked like a charm for a long time. Now all of a sudden I cannot play the files I download. It fails with this stack. I store the files on the SDCard and I experience the problem both on a handset and a USB connected device. I have checked that the downloaded file is cool on the server, and I can play it without any issues. These are