diff --git a/clapper_src/app.js b/clapper_src/app.js index 99b7945d..3b720389 100644 --- a/clapper_src/app.js +++ b/clapper_src/app.js @@ -13,12 +13,17 @@ var App = GObject.registerClass({ } }, class ClapperApp extends Gtk.Application { - _init(args) + _init(opts) { GLib.set_prgname(APP_NAME); super._init(); + let defaults = { + playlist: [], + }; + Object.assign(this, defaults, opts); + this.window = null; this.interface = null; this.player = null; @@ -100,6 +105,9 @@ var App = GObject.registerClass({ this.player.widget.show_all(); this.emit('ready', true); + + if(this.playlist.length) + this.player.set_uri(this.playlist[0]); } _onWindowFullscreenChanged(window, isFullscreen) diff --git a/main.js b/main.js index bed20878..ce9ffdc1 100644 --- a/main.js +++ b/main.js @@ -8,5 +8,7 @@ Gst.init(null); function main() { - let clapper = new App(arguments).run(); + let clapper = new App({ + playlist: ARGV + }).run(); }