getPlaying

 

A fast way to check if the player is currently playing a track.

NOTE: You can also use getStatus to check for playing/paused, this is just a convenience function.

getPlaying()

 

Parameters

none

 

Return Value

int

0 = paused / stopped
1 = playing

 

 

See Also

 

Examples

 

<!-- Create a player -->
<div id="player1" data-wimpyplayer data-media="../song1.mp3|../song2.mp3"></div>


<!-- A simple button to ping the "doit" function. -->
<button onclick="checkPlaying()">Check Playing</button>

<script>

// Put variable on the window scope so all function have access to the var.
var player;

// The function to edit the "live" playlist
function checkPlaying(){

	if( ! player ){
		player = wimpy.getPlayer("player1");
	}
	
	// The alert should show a 1 or a 0, where 1=playing and 0 = paused/stopped/not playing
	alert ( player.getPlaying() );

}

</script>