media-player

JavaFX.MediaPlayer over HTTPS?

烈酒焚心 提交于 2020-01-01 04:56:26
问题 I tried to use MediaPlayer to play back a resource defined an HTTPS url, and it says protocol not supported. In the API reference they state FILE/HTTP/JAR are supported protocols (HTTPS not mentioned). Is it possible to somehow use urls via HTTPS? This seems quite a big drawback in my opinion... 回答1: This was fixed for Java 9, and later backported to Java 8. Java 8 update 91 and later should therefore be working with HTTPS URLs without an issue. If you're using an old version of Java that

Set Notification Sound from Assets folder

元气小坏坏 提交于 2020-01-01 03:56:06
问题 I am attaching the sound files in the assets folder for play sound in the notification but I am not able to play sound from the assets folder. I have setting page from which user can set the sound for the notification and also user can play sound. This part is completed. I am able to play sound from the assets folder using Media Player. I can use same logic at the Notification creation time but problem can be happened when user click on the Notification because media player still playing the

Notified when media player opens from UIWebView?

痴心易碎 提交于 2019-12-31 10:53:41
问题 I have got a UIViewController in my app with a UIWebView in it. The UIWebView is fixed-size and configured to open any links in a new UIViewController (browser). This works, but when I try clicking a video like YouTube or Vimeo from within the web view, it opens on top of the view controller. This would normally not be a problem, but I have an overlapping view that needs to get a message to move out of the way when this happens. Is there a notification or any other way my view controller can

Android: mediaplayer went away with unhandled events

旧城冷巷雨未停 提交于 2019-12-31 08:32:27
问题 I need to get the duration of an audio file for a series of voice announcements that need to play from an app. I have added the audio files as resources and they do play just fine. The sample code below actually works perfect for its intended purpose: it does return the duration of the audio files. Here is the code: float getDurationOfAudioResource(LocationEnum loc, Context context){ float duration = 0; try { MediaPlayer mp; mp = MediaPlayer.create(context, getAudioResource(loc)); duration =

Can MediaPlaybackservice be used for getting information of currently playing audio file in android?

我与影子孤独终老i 提交于 2019-12-31 05:38:27
问题 I wrote a class which will handle the MediaPlaybackService in android. But the code is not working. My code for binding the serviceconnection is as follows: Intent in = new Intent(); in.setClassName("com.android.playerapps","com.android.playerapps.MediaPlayerServiceConnection"); ServiceConnection conn = new MediaPlayerServiceConnection(); ctx.bindService(in, conn, 0); ServiceConnection class is as follows: public class MediaPlayerServiceConnection implements ServiceConnection {

mediaplayer error on soundboard app

十年热恋 提交于 2019-12-31 02:54:10
问题 I have a soundboard app that calls that calls audio files when their button is pressed. However, after most of the buttons havebeen pressed and played, I start to get these mediaplayer errors. Does anyone know How to detect it and just restart or stop it completely from happening? Thanks for your time. -colby for (Map.Entry<Integer, Integer> entry : map.entrySet()) { ImageButton button = (ImageButton) findViewById(entry.getKey()); button.setOnClickListener(new View.OnClickListener() { public

MediaPlayer isPlaying() always returning false

倖福魔咒の 提交于 2019-12-30 10:42:45
问题 I am testing on 2 phones. In one device isPlaying() of mediaplayer always return false even when it is playing. but in other device (lg optimus gingerbread) isPlaying() returns true is it is playing else returns false. Can anyone tell me why this is happening ? My some code depends on this isPlaying() part and i want to make it work on all devices. public void addSoundMedia(Context context, int resId){ MediaPlayer mp = MediaPlayer.create(context, resId); mp.setVolume(1.0f, 1.0f); try{

What does MediaPlayer info/warning (973, 0) mean?

╄→гoц情女王★ 提交于 2019-12-30 08:03:03
问题 I'm using MediaPlayer to play a lot of short music in my app, but I got this warning in my logcat: MediaPlayer info/warning (973, 0). What does this warning mean? I searched around (in the documentation and on Google) but nothing comes up. Also, I released the MediaPlayer 'properly'. EDIT: 01-18 18:43:22.662: W/MediaPlayer(24940): info/warning (973, 0) 回答1: Good question, the codes are somewhat buried. You will not find out what 973 is specifically, but it falls under the 9xx branch of error

What does MediaPlayer info/warning (973, 0) mean?

不问归期 提交于 2019-12-30 08:01:11
问题 I'm using MediaPlayer to play a lot of short music in my app, but I got this warning in my logcat: MediaPlayer info/warning (973, 0). What does this warning mean? I searched around (in the documentation and on Google) but nothing comes up. Also, I released the MediaPlayer 'properly'. EDIT: 01-18 18:43:22.662: W/MediaPlayer(24940): info/warning (973, 0) 回答1: Good question, the codes are somewhat buried. You will not find out what 973 is specifically, but it falls under the 9xx branch of error

Playing two sounds Simutaneosly

我怕爱的太早我们不能终老 提交于 2019-12-30 06:25:06
问题 I am trying to play two sounds simutaneosly in android.I have created two MediaPlayers and am using the code below.They are currently playing one after another.Or not exactly one after another but kinda delayed into eachother. private void playSound(){ if (mp1 != null) { mp1.release(); } if (mp2 != null) { mp2.release(); } mp1 = MediaPlayer.create(this, soundArray[0]); mp2 = MediaPlayer.create(this, soundArray[3]); mp1.start(); mp2.start(); } Thanks 回答1: Playing two digital sounds