mirror of
https://github.com/Rafostar/clapper.git
synced 2025-08-31 00:11:59 +02:00
Skip setting player option when unsupported
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
const { GLib, GObject, Gst, GstPlayer } = imports.gi;
|
const { GLib, GObject, Gst, GstPlayer } = imports.gi;
|
||||||
|
const Debug = imports.clapper_src.debug;
|
||||||
|
|
||||||
const GSTPLAYER_DEFAULTS = {
|
const GSTPLAYER_DEFAULTS = {
|
||||||
position_update_interval: 1000,
|
position_update_interval: 1000,
|
||||||
@@ -6,6 +7,8 @@ const GSTPLAYER_DEFAULTS = {
|
|||||||
user_agent: 'clapper',
|
user_agent: 'clapper',
|
||||||
};
|
};
|
||||||
|
|
||||||
|
let { debug } = Debug;
|
||||||
|
|
||||||
var Player = GObject.registerClass(
|
var Player = GObject.registerClass(
|
||||||
class ClapperPlayer extends GstPlayer.Player
|
class ClapperPlayer extends GstPlayer.Player
|
||||||
{
|
{
|
||||||
@@ -37,8 +40,14 @@ class ClapperPlayer extends GstPlayer.Player
|
|||||||
|
|
||||||
let config = this.get_config();
|
let config = this.get_config();
|
||||||
|
|
||||||
for(let setting of Object.keys(GSTPLAYER_DEFAULTS))
|
for(let setting of Object.keys(GSTPLAYER_DEFAULTS)) {
|
||||||
GstPlayer.Player[`config_set_${setting}`](config, opts[setting]);
|
let setOption = GstPlayer.Player[`config_set_${setting}`];
|
||||||
|
if(!setOption) {
|
||||||
|
debug(`unsupported option: ${setting}`, 'LEVEL_WARNING');
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
setOption(config, opts[setting]);
|
||||||
|
}
|
||||||
|
|
||||||
this.set_config(config);
|
this.set_config(config);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user