@@ -39,13 +39,8 @@ QtObject {
40 function playSource(newSource, newPlaylist) {
40 function playSource(newSource, newPlaylist) {
42− // Make sure we change the source, even if two items point to the same uri location
44− audio.playlist = null;
42+ audio.playlist.clear();
45 if (newPlaylist) {
43 if (newPlaylist) {
47− audio.playlist = playlist;
49 // Look for newSource in newPlaylist
44 // Look for newSource in newPlaylist
50 var sourceIndex = -1;
45 var sourceIndex = -1;
51 for (var i in newPlaylist) {
46 for (var i in newPlaylist) {
@@ -63,10 +58,11 @@ QtObject {
63 for (var i in newPlaylist) {
58 for (var i in newPlaylist) {
64 urls.push(newPlaylist[i]);
59 urls.push(newPlaylist[i]);
66− playlist.addSources(urls);
61+ audio.playlist.addSources(urls);
67− playlist.currentIndex = sourceIndex;
62+ audio.playlist.currentIndex = sourceIndex;
69− audio.source = newSource;
64+ audio.playlist.addSource(newSource);
65+ audio.playlist.currentIndex = 0;
@@ -86,13 +82,12 @@ QtObject {
86 property QtObject audio: Audio {
82 property QtObject audio: Audio {
88 objectName: "audio"
84 objectName: "audio"
86+ objectName: "playlist"
90 onErrorStringChanged: console.warn("Dash Audio player error:", errorString)
89 onErrorStringChanged: console.warn("Dash Audio player error:", errorString)
92− property QtObject playlist: Playlist {
94− objectName: "playlist"
97 function lengthToString(s) {
92 function lengthToString(s) {
98 if (typeof(s) !== "number" || s < 0) return "";
93 if (typeof(s) !== "number" || s < 0) return "";