Segui il video qui sotto per vedere come installare il nostro sito come web app sulla tua schermata principale.
Nota: Questa funzionalità potrebbe non essere disponibile in alcuni browser.
Pubblicità
public class PlayerThread extends Thread {
public void run()
{
try {
player.play();
} catch (Exception e) {
e.printStackTrace();
}
}
}
If you want to add pause and resume functionality to the Player, you will need to override the play() method,
but this requires that you recompile the JLayer source code because some of the objects that are referenced in
the play() method are private (instead of protected.) Specifically, I extended the Player class and replaced the
following snippet from the play() method:
while (frames-- > 0 && ret)
{
ret = decodeFrame();
}
With:
while (frames-- > 0 && ret)
{
if( this.playing )
{
ret = decodeFrame();
}
else
{
try
{
Thread.sleep( 100 );
}
catch( Exception e )
{
}
}
}
And then added pause() and resume() methods that controlled the value of the playing boolean variable.