Skip to content

Commit

Permalink
Change setRestrictions to throw TypeError
Browse files Browse the repository at this point in the history
  • Loading branch information
Sanborn Hilland committed Mar 17, 2015
1 parent 3c33313 commit 5672cae
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/player/player.js
Original file line number Diff line number Diff line change
Expand Up @@ -746,13 +746,13 @@ shaka.player.Player.prototype.setPlaybackRate = function(rate) {
* For example: A Restrictions instance with maxBandwidth = 700000
* and minBandwidth = 200000 will restrict
* playback to video tracks with bandwidth between 700000 and 200000.
* @throws {TypeError} if restrictions argument isn't a Restrictions instance.
* @export
*/
shaka.player.Player.prototype.setRestrictions = function(restrictions) {
shaka.asserts
.assert(restrictions instanceof shaka.player.DrmSchemeInfo.Restrictions);
if (!(restrictions instanceof shaka.player.DrmSchemeInfo.Restrictions))
return;
if (!(restrictions instanceof shaka.player.DrmSchemeInfo.Restrictions)) {
throw new TypeError('Argument must be a Restrictions instance.');
}
this.restrictions_ = restrictions;
this.videoSource_.setRestrictions(this.restrictions_);
};
Expand Down

0 comments on commit 5672cae

Please sign in to comment.