media-player

javaFX: MediaPlayer's seek method hangs the player without error message oder Status change

那年仲夏 提交于 2020-12-26 08:32:13
问题 I have a programm with 8 mediaplayer, which are controlled like one big video with a single set of controls. I have one Slider to control the time, aka I call all MediaPlayer's seek methods in onMouseReleased of the slider. My Problem is, the mediaplayer hang all the time, without changing their status or calling onError . When I put every seek in a new Thread, these problems disappear msot of the time, but not always and I'm gettign a lot of concurrency issues. Does anybody know the reason

Android - How do I only allow one instance of MediaPlayer to play at a time?

早过忘川 提交于 2020-12-05 12:20:48
问题 I'm trying to create a simple Sound-board Android app, using ListView items as buttons. (Btw, I'm a novice programmer) The idea is that I press a button, and a specific sound file plays. If I press any button while a sound is playing, it should first stop that sound and then start to play the new one. Currently the sounds play without stopping any currently playing sounds, so that if I spam the buttons I get multiple sounds playing at the same time (and if I press too many at once, the app

JavaScript detecting play/pause keyboard (virtual) key

余生颓废 提交于 2020-12-03 15:50:05
问题 By accident, I just pressed the play/pause ( ▶/❚❚ ) button on my keyboard (the button just above Num Lock on , while playing a YouTube video in a tab that was not focused. To my massive surprise, the YouTube video paused immediately. Now, I tried looking up how this works, but I was not able to find anything on the internet explaining how a keypress can be detected for keys like this. I tried running onkeydown = function(e) {console.log(e)} in my console, but pressing the play/pause button

JavaScript detecting play/pause keyboard (virtual) key

谁都会走 提交于 2020-12-03 15:48:34
问题 By accident, I just pressed the play/pause ( ▶/❚❚ ) button on my keyboard (the button just above Num Lock on , while playing a YouTube video in a tab that was not focused. To my massive surprise, the YouTube video paused immediately. Now, I tried looking up how this works, but I was not able to find anything on the internet explaining how a keypress can be detected for keys like this. I tried running onkeydown = function(e) {console.log(e)} in my console, but pressing the play/pause button

Android MediaPlayer. Catch onVolumeChange or something like

こ雲淡風輕ζ 提交于 2020-08-10 19:17:22
问题 I have a situation. Some custom Android firmware does not send onAudioFocusChange in some circumstances, but instead just lower my application audio output. Volume changes only for my app, not the main volume control. I really don't know how it does it, maybe on the core level. I want to pause, my player, when someone acquires audio stream, not just lower sound. So as a workaround I want catch this volume change event and process it by myself. Problem is that I don't know what to catch and

setAudioStreamType deprecated method, how i can replace it?

感情迁移 提交于 2020-07-18 21:43:31
问题 I am trying make a radio streaming app in android studio using mediaplayer, but i when compile shows the next error: uses or overrides a deprecated API. Recompile with -Xlint:deprecation for details. I was search in android documentation and i should reemplace this method for setAudioAttributes, i how can change it? i am new using android studio. Thanks. public class Radio extends Fragment { Button play_pause; MediaPlayer mp; @Override public View onCreateView(LayoutInflater inflater,

Starting a Service throws an IllegalAccessException

心不动则不痛 提交于 2020-07-16 05:30:34
问题 I have a Service which takes in an audio file and plays it with MediaPlayer . This is how I call my Service : private void playAudio(String url) throws Exception { Intent music = new Intent(this,MusicService.class); music.putExtra("paths", path); startService(music); } This is my Service class: class MusicService extends Service implements OnCompletionListener { MediaPlayer mediaPlayer; String musicFile; @Override public void onCreate() { mediaPlayer = new MediaPlayer(); mediaPlayer