Commit 125b8855 authored by Nico Mack's avatar Nico Mack

Audio playback is started in a new Thread

parent d012f19c
......@@ -97,6 +97,7 @@ public class AudioDelegate extends MediaDelegate implements Playable {
MediaLocator locator = new MediaLocator(mediaUrl);
this.player = Manager.createPlayer(locator);
this.player.realize();
this.player.prefetch();
} catch (NoPlayerException | IOException e) {
LOGGER.error("Failed to prepare media {} in {}!", this.media, this.baseUrl, e); //$NON-NLS-1$
}
......@@ -109,7 +110,14 @@ public class AudioDelegate extends MediaDelegate implements Playable {
@Override
public boolean handle(Interaction action) {
this.play();
Runnable play = () -> {
play();
};
Thread playThread = new Thread(play);
playThread.start();
return true;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment