mirror of
https://github.com/Rafostar/clapper.git
synced 2025-08-30 15:52:10 +02:00
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:
@@ -1,4 +1,4 @@
|
||||
const { GObject, Gst, Gtk } = imports.gi;
|
||||
const { GObject, Gtk } = imports.gi;
|
||||
const Dialogs = imports.src.dialogs;
|
||||
|
||||
var actions = {
|
||||
|
@@ -1,4 +1,4 @@
|
||||
const { Gio, GstAudio, GstClapper, Gdk, Gtk } = imports.gi;
|
||||
const { Gio, GstAudio, Gdk, Gtk } = imports.gi;
|
||||
const Debug = imports.src.debug;
|
||||
|
||||
const { debug } = Debug;
|
||||
@@ -48,11 +48,11 @@ function loadCustomCss()
|
||||
);
|
||||
}
|
||||
|
||||
function inhibitForState(state, window)
|
||||
function setAppInhibit(isInhibit, window)
|
||||
{
|
||||
let isInhibited = false;
|
||||
|
||||
if(state === GstClapper.ClapperState.PLAYING) {
|
||||
if(isInhibit) {
|
||||
if(inhibitCookie)
|
||||
return;
|
||||
|
||||
|
@@ -1,4 +1,4 @@
|
||||
const { Gdk, Gio, GLib, GObject, Gst, GstClapper, Gtk } = imports.gi;
|
||||
const { Gdk, Gio, GObject, Gst, GstClapper, Gtk } = imports.gi;
|
||||
const ByteArray = imports.byteArray;
|
||||
const Debug = imports.src.debug;
|
||||
const Misc = imports.src.misc;
|
||||
@@ -320,7 +320,8 @@ class ClapperPlayer extends PlayerBase
|
||||
|
||||
return;
|
||||
}
|
||||
Misc.inhibitForState(state, root);
|
||||
const isInhibit = (state === GstClapper.ClapperState.PLAYING);
|
||||
Misc.setAppInhibit(isInhibit, root);
|
||||
}
|
||||
|
||||
const clapperWidget = player.widget.get_ancestor(Gtk.Grid);
|
||||
|
@@ -1,6 +1,13 @@
|
||||
const { GObject } = imports.gi;
|
||||
const { WebClient } = imports.src.webClient;
|
||||
|
||||
var ClapperState = {
|
||||
STOPPED: 0,
|
||||
BUFFERING: 1,
|
||||
PAUSED: 2,
|
||||
PLAYING: 3,
|
||||
};
|
||||
|
||||
var PlayerRemote = GObject.registerClass(
|
||||
class ClapperPlayerRemote extends GObject.Object
|
||||
{
|
||||
|
@@ -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:
|
||||
|
Reference in New Issue
Block a user