Skip to content

Commit

Permalink
Avoid duplicate idle timers in receiver app.
Browse files Browse the repository at this point in the history
It is possible to call startIdleTimer_ multiple times in a row.  This
change makes sure that there is only one idle timer at a time.
Otherwise there is no way to cancel the other timers.

Closes #684

Change-Id: I264c7e2edadea76978c4f3848f27bb13c29510dd
  • Loading branch information
TheModMaker committed Feb 24, 2017
1 parent 4a9d5d5 commit 3f62693
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions demo/receiver_app.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,8 @@ ShakaReceiver.prototype.checkIdle_ = function() {

/** @private */
ShakaReceiver.prototype.startIdleTimer_ = function() {
this.cancelIdleTimer_();

this.idleTimerId_ = window.setTimeout(
window.close.bind(window), this.idleTimeout_ * 1000.0);
};
Expand Down

0 comments on commit 3f62693

Please sign in to comment.