mirror of
https://github.com/Rafostar/clapper.git
synced 2025-08-30 16:02:00 +02:00
Add player motion and key controllers
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
const { Gio, GLib, GObject, Gst, GstPlayer } = imports.gi;
|
||||
const { Gio, GLib, GObject, Gst, GstPlayer, Gtk } = imports.gi;
|
||||
const ByteArray = imports.byteArray;
|
||||
const Debug = imports.clapper_src.debug;
|
||||
|
||||
@@ -80,6 +80,12 @@ class ClapperPlayer extends GstPlayer.Player
|
||||
this._trackId = 0;
|
||||
this.playlist_ext = opts.playlist_ext || 'claps';
|
||||
|
||||
this.keyController = new Gtk.EventControllerKey();
|
||||
this.motionController = new Gtk.EventControllerMotion();
|
||||
|
||||
this.widget.add_controller(this.keyController);
|
||||
this.widget.add_controller(this.motionController);
|
||||
|
||||
this.connect('state-changed', this._onStateChanged.bind(this));
|
||||
this.connect('uri-loaded', this._onUriLoaded.bind(this));
|
||||
this.connect('end-of-stream', this._onStreamEnded.bind(this));
|
||||
|
Reference in New Issue
Block a user