Skip to content

Commit

Permalink
Conditionalize the navigator IE8 check.
Browse files Browse the repository at this point in the history
This caused a problem in gecko, where the jsm runs in an
environment without access to the navigator object.
  • Loading branch information
rillian committed Dec 1, 2015
1 parent 6c4fe04 commit 58d0924
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/vtt.js
Original file line number Diff line number Diff line change
Expand Up @@ -716,7 +716,8 @@
// Constructs the computed display state of the cue (a div). Places the div
// into the overlay which should be a block level element (usually a div).
function CueStyleBox(window, cue, styleOptions) {
var isIE8 = (/MSIE\s8\.0/).test(navigator.userAgent);
var isIE8 = (typeof navigator !== "undefined") &&
(/MSIE\s8\.0/).test(navigator.userAgent);
var color = "rgba(255, 255, 255, 1)";
var backgroundColor = "rgba(0, 0, 0, 0.8)";

Expand Down

0 comments on commit 58d0924

Please sign in to comment.