I'm writing a very simple tutorial on how to play an audio file with Tabrisjs with this simple code which you can test in Playground. It works, but will only play the audio file once and I have to Reload it to have it play again. How do I get the audio to play more than once?
// simple example to play audio file
const {Button, ui} = require('tabris');
var my_media = new Media('http://static1.grsites.com/archive/sounds/cartoon/cartoon001.mp3');
let btnPlay = new Button({
centerX: 0, centerY: 0,
text: 'Play sound',
background: 'blue',
textColor: 'white',
font: '24px'
}).on("select", function() {
my_media.play();
}).appendTo(ui.contentView);
Reference: - I'm trying to simplify the example tabrisjs.com provides
This will play audio file correctly:
MediaPage.js
https://github.com/eclipsesource/tabris-js/tree/master/examples/cordova