Skip to content

Commit

Permalink
Don't reset player progress with a 'stop'
Browse files Browse the repository at this point in the history
  • Loading branch information
himynameisjonas committed Jan 11, 2017
1 parent 04465cb commit 33af624
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lib/ZPAccessory.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ ZPAccessory.prototype.copyCoordinator = function() {
coordinator.becomePlatformCoordinator();
this.log.debug("%s: copy group characteristics from %s", this.name, coordinator.name);
if (this.state.group.on !== coordinator.state.group.on) {
this.log.debug("%s: set member play/stop from %s to %s", this.name,
this.log.debug("%s: set member play/pause from %s to %s", this.name,
this.state.group.on, coordinator.state.group.on);
this.state.group.on = coordinator.state.group.on;
this.groupService.setCharacteristic(Characteristic.On, this.state.group.on);
Expand Down Expand Up @@ -298,7 +298,7 @@ ZPAccessory.prototype.handleAVTransportEvent = function(data) {
}
}
if (on !== this.state.group.on) {
this.log.info("%s: on (play/stop) changed from %s to %s", this.name, this.state.group.on, on);
this.log.info("%s: on (play/pause) changed from %s to %s", this.name, this.state.group.on, on);
this.state.group.on = on;
this.groupService.setCharacteristic(Characteristic.On, this.state.group.on);
for (const member of this.members()) {
Expand Down Expand Up @@ -528,7 +528,7 @@ ZPAccessory.prototype.handleAVTransportEvent = function(data) {
if (!this.isCoordinator) {
return this.coordinator.setGroupOn(on, callback);
}
this.log.info("%s: set on (play/stop) from %s to %s", this.name, this.state.group.on, on);
this.log.info("%s: set on (play/pause) from %s to %s", this.name, this.state.group.on, on);
if (on) {
this.log.debug("%s: play", this.name);
this.zp.play(function(err, success) {
Expand All @@ -539,10 +539,10 @@ ZPAccessory.prototype.handleAVTransportEvent = function(data) {
return callback();
}.bind(this));
} else {
this.log.debug("%s: stop", this.name);
this.zp.stop(function(err, success) {
this.log.debug("%s: pause", this.name);
this.zp.pause(function(err, success) {
if (err || !success) {
this.log.error("%s: stop: %s", this.name, err);
this.log.error("%s: pause: %s", this.name, err);
return callback(err);
}
return callback();
Expand Down

0 comments on commit 33af624

Please sign in to comment.