Files
qyouradio/Player.qml
Dark Steveneq def26f8fda
Some checks failed
Build / build-linux (push) Failing after 18s
Build / build-windows (push) Has been cancelled
Fix theme on native light mode, implement volume slider
2025-10-14 10:06:06 +02:00

34 lines
582 B
QML

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