getTime

 

Gets the current time in seconds.

If there is no track, the value returned will be 0

getTime()

 

Parameters

none

 

Return Value

number

Returns the current position of playhead represented in seconds.

 

 

See Also

 

Examples

 

<div id="player1" data-wimpyplayer data-media="song1.mp3|song2.mp3|song3.mp3"><div>
<div id="timeDisplay">00:00</div>

<script>

var myPlayer;
var timeDisplayElem;

function doTime(){
	timeDisplayElem.innerHTML = myPlayer.getTime(); // returns a number 12.316
}

wimpy.onReady(function(){

	myPlayer = wimpy.getPlayer("player1");
	timeDisplayElem = docuemnt.getElementById("timeDisplay");
	
	setInterval(doTime, 100); // run every 100 milliseconds
	
});
</script>