Do not import GstClapper for remote app

No need to import and initialize whole GStreamer for web application if the only thing needed there is a single enum.
This commit is contained in:
Rafał Dzięgiel
2021-02-22 16:34:08 +01:00
parent 8df5c38357
commit 6950cf1bbb
5 changed files with 19 additions and 11 deletions

View File

@@ -1,7 +1,7 @@
const { GObject, Gtk, GstClapper } = imports.gi;
const { GObject, Gtk } = imports.gi;
const Buttons = imports.src.buttons;
const Misc = imports.src.misc;
const { PlayerRemote } = imports.src.playerRemote;
const { PlayerRemote, ClapperState } = imports.src.playerRemote;
var WidgetRemote = GObject.registerClass(
class ClapperWidgetRemote extends Gtk.Grid
@@ -50,11 +50,11 @@ class ClapperWidgetRemote extends Gtk.Grid
switch(action) {
case 'state_changed':
switch(value) {
case GstClapper.ClapperState.STOPPED:
case GstClapper.ClapperState.PAUSED:
case ClapperState.STOPPED:
case ClapperState.PAUSED:
this.togglePlayButton.setPrimaryIcon();
break;
case GstClapper.ClapperState.PLAYING:
case ClapperState.PLAYING:
this.togglePlayButton.setSecondaryIcon();
break;
default: