Initial video playlist support

For now player will load only first video from playlist. Good enough for testing. Full playlist support will be added later on.
This commit is contained in:
Rafostar
2020-09-01 23:46:49 +02:00
parent 9f04b74e05
commit 7307845646
2 changed files with 12 additions and 2 deletions

View File

@@ -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)

View File

@@ -8,5 +8,7 @@ Gst.init(null);
function main()
{
let clapper = new App(arguments).run();
let clapper = new App({
playlist: ARGV
}).run();
}