Use for audio files.
A music player.
A music player. Plays one media source. To change source, for example to change track, create a new player.
The user needs to provide the media length and size to enable seek functionality. Seeking streams which cannot be
reopened is only supported if InputStream.markSupported() of media.stream
is true, and even then the support is
buggy. markSupported() is true at least for java.io.BufferedInputStreams.
The stream provided in media
is not by default closed when the player is closed, but if you wish to do so,
subclass this player and override close()
accordingly or mix in trait SourceClosing.
Mix this in to JavaSoundPlayers when you want to close the audio stream when the player is closed.
Mix this in to JavaSoundPlayers when you want to close the audio stream when the player is closed. Whether you want to do that depends on who creates the stream.
Use for audio files. Since this constructor opens an InputStream, trait SourceClosing is mixed in so that when this player is closed, so is the InputStream.