Used to play audio files bundled in the application
Loads the content of file specified by fileName parameter and prepares it to play
Loads the content of file and prepares it to play, looking for given file name in documents folder
starts to play loaded file
stops currently playing audio
pauses currently played audio
resumes playback from paused state
returns integer value specifying duration in seconds of the loaded audio
sets playback position in seconds
returns current position measured in seconds
Used to get information about when playback finished Parameters: callback - function name to be called when playback finished
set's if player should repeat loaded file, can take argument "yes", "no", "1" and "0"
set's current volume for player, parameter has to be in range [0..100]
disposes resources allocated for player
if this function is set to "yes" then application will still continue to play even if user locked the phone.
page1.html: var player1 = new NKAudioPlayer(); player1.loadFile("music.mp3"); var settings = new NKSettings(); settings.setValueForKey(player_id,”playerID”); //save player1.id in NKSettings page2.html: var player2 = new NKAudioPlayer(); player2.dispose(); // release second's player resources as we will use resources of the first player var settings = new NKSettings(); player2.id = settings.getValueForKey(“playerID”); player2.play(); // launch play of the first player