import QtMultimedia 6.8 pragma Singleton MediaPlayer { source: "" function startPlaying(url) { if (playing) { return; } console.log("Starting playback from " + url); source = url; play(); } function stopPlaying() { console.log("Stopping playback..."); source = ""; stop(); } audioOutput: AudioOutput { volume: 0.4 } onErrorOccurred: function(error, errorString) { stopPlaying(); } }