Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
Player.prototype.init = function(opts) {
this.serviceName = `org.mpris.MediaPlayer2.${this.name}`;
dbus.validators.assertBusNameValid(this.serviceName);
this._bus = dbus.sessionBus();
this._bus.on('error', (err) => {
this.emit('error', err);
});
this.interfaces = {};
this._addRootInterface(this._bus, opts);
if (this.supportedInterfaces.indexOf('player') >= 0) {
this._addPlayerInterface(this._bus);
}
if (this.supportedInterfaces.indexOf('trackList') >= 0) {
this._addTracklistInterface(this._bus);