[gnome-music] Bug 697636 - Autoplay next song



commit 3098f9ce8893655bc5aad665f97ec218aa64e610
Author: Vadim Rutkovsky <vrutkovs redhat com>
Date:   Tue Apr 9 17:00:22 2013 +0200

    Bug 697636 - Autoplay next song

 src/player.js |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/src/player.js b/src/player.js
index 8b9243f..630a8da 100644
--- a/src/player.js
+++ b/src/player.js
@@ -71,6 +71,15 @@ const Player = new Lang.Class({
 
         Gst.init(null, 0);
         this.player = Gst.ElementFactory.make("playbin", "player");
+        this.player.connect("about-to-finish", Lang.bind(this,
+            function() {
+                let newCurrentTrack = parseInt(this.currentTrack) + 1;
+                if (newCurrentTrack < this.playlist.length) {
+                    this.currentTrack = newCurrentTrack;
+                    this.load(this.playlist[this.currentTrack]);
+                }
+                return true;
+            }));
         this.bus = this.player.get_bus();
         this.bus.add_signal_watch()
         this.bus.connect("message", Lang.bind(this,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]