• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JavaFX MediaPlayer playback

 
Joel Christophel
Ranch Hand
Posts: 250
1
Chrome Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to use JavaFX to stream audio content from the Internet using both HTTP and HTTPS (support for the latter was added as of 8u72). However, the playback is very unreliable and different each time. There are usually short spurts of sound, and then silence. I know my Internet connection is fine because the streaming the same file works flawlessly when done via a web browser. What's going on?

 
Mark Onelppa
Greenhorn
Posts: 4
IntelliJ IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I realize this is already a week old but I'll post anyway in case someone stumbles upon this again.

I believe garbage collection is getting rid of your player once the method returns.
Try moving the player initialization higher, make it a field for example and it should play without any trouble.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic