audioPlayer - Methods - Assess API

Assess API Methods

audioPlayer()

Allows access to the global Assess API audio player. This can be used to play audio files programmatically.

Examples

assessApp.audioPlayer()
    .then(function (player) {
        player.volume.set(0.5);
        player.play('MP3_file.mp3');
    })
    .catch(function () {
        console.log('Cannot get assess audio player');
    });

Arguments

None.

Return value

Type promise

  • then function

    Takes a success callback function that resolves the promise with the Assess API audio player as its parameter.

  • catch function

    Takes a rejection callback function that rejects the promise with an error as its parameter.

Was this article helpful?

Did you arrive here by accident? If so, learn more about Learnosity.