[gnome-music] Bug 697636 - Autoplay next song
- From: Vadim Rutkovsky <vrutkovsky src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-music] Bug 697636 - Autoplay next song
- Date: Tue, 9 Apr 2013 15:14:04 +0000 (UTC)
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]