Skip to content

Commit

Permalink
Fix suppression of 'encrypted' events.
Browse files Browse the repository at this point in the history
If the events happened quickly enough, some extra sessions were being
created.

Change-Id: I73367f3ba44172d3820e1d6283235f49fb1b119b
  • Loading branch information
joeyparrish committed Feb 12, 2015
1 parent f6a7dcf commit d797c70
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions lib/player/player.js
Original file line number Diff line number Diff line change
Expand Up @@ -448,13 +448,12 @@ shaka.player.Player.prototype.onEncrypted_ = function(event) {
this.onSessionMessage_.bind(this)));

var p = session.generateRequest(event.initDataType, event.initData);
p.then(shaka.util.TypedBind(this,
function() {
this.requestGenerated_[initDataKey] = true;
})
).catch(shaka.util.TypedBind(this,
this.requestGenerated_[initDataKey] = true;

p.catch(shaka.util.TypedBind(this,
/** @param {!Error} error */
function(error) {
this.requestGenerated_[initDataKey] = false;
var event = shaka.util.FakeEvent.createErrorEvent(error);
this.dispatchEvent(event);
})
Expand Down

0 comments on commit d797c70

Please sign in to comment.