Create icon files, begin writing playback system
This commit is contained in:
30
Player.qml
Normal file
30
Player.qml
Normal file
@@ -0,0 +1,30 @@
|
||||
import QtMultimedia 6.8
|
||||
|
||||
pragma Singleton
|
||||
|
||||
MediaPlayer {
|
||||
source: ""
|
||||
|
||||
function startPlaying(url) {
|
||||
if (player.playing) {
|
||||
return;
|
||||
}
|
||||
console.log("Starting playback from " + url);
|
||||
player.source = url;
|
||||
player.play();
|
||||
}
|
||||
|
||||
function stopPlaying() {
|
||||
console.log("Stopping playback...");
|
||||
player.source = "";
|
||||
player.stop();
|
||||
}
|
||||
|
||||
audioOutput: AudioOutput {
|
||||
volume: 0.4
|
||||
}
|
||||
|
||||
onErrorOccurred: function(error, errorString) {
|
||||
player.stopPlaying();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user