diff --git a/clapper_src/player.js b/clapper_src/player.js index 394c1c1b..ae5481a9 100644 --- a/clapper_src/player.js +++ b/clapper_src/player.js @@ -1,4 +1,5 @@ const { GLib, GObject, Gst, GstPlayer } = imports.gi; +const Debug = imports.clapper_src.debug; const GSTPLAYER_DEFAULTS = { position_update_interval: 1000, @@ -6,6 +7,8 @@ const GSTPLAYER_DEFAULTS = { user_agent: 'clapper', }; +let { debug } = Debug; + var Player = GObject.registerClass( class ClapperPlayer extends GstPlayer.Player { @@ -37,8 +40,14 @@ class ClapperPlayer extends GstPlayer.Player let config = this.get_config(); - for(let setting of Object.keys(GSTPLAYER_DEFAULTS)) - GstPlayer.Player[`config_set_${setting}`](config, opts[setting]); + for(let setting of Object.keys(GSTPLAYER_DEFAULTS)) { + let setOption = GstPlayer.Player[`config_set_${setting}`]; + if(!setOption) { + debug(`unsupported option: ${setting}`, 'LEVEL_WARNING'); + continue; + } + setOption(config, opts[setting]); + } this.set_config(config);