Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(vttcue) add navigator check #372

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions lib/vtt.js
Original file line number Diff line number Diff line change
Expand Up @@ -266,12 +266,12 @@
// Apply default values for any missing fields.
cue.region = settings.get("region", null);
cue.vertical = settings.get("vertical", "");
cue.line = settings.get("line", "auto");
cue.line = settings.get("line", cue.line || "auto");
cue.lineAlign = settings.get("lineAlign", "start");
cue.snapToLines = settings.get("snapToLines", true);
cue.size = settings.get("size", 100);
cue.align = settings.get("align", "middle");
cue.position = settings.get("position", "auto");
//cue.align = settings.get("align", "middle");
cue.position = settings.get("position", cue.position || "auto");
cue.positionAlign = settings.get("positionAlign", {
start: "start",
left: "start",
Expand Down
5 changes: 3 additions & 2 deletions lib/vttcue.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@

function VTTCue(startTime, endTime, text) {
var cue = this;
var isIE8 = (/MSIE\s8\.0/).test(navigator.userAgent);
var isIE8 = (typeof navigator !== "undefined") && (/MSIE\s8\.0/).test(navigator.userAgent);
var baseObj = {};

if (isIE8) {
Expand Down Expand Up @@ -94,7 +94,8 @@
var _snapToLines = true;
var _line = "auto";
var _lineAlign = "start";
var _position = 50;
//var _position = 50;
var _position = "auto";
var _positionAlign = "middle";
var _size = 50;
var _align = "middle";
Expand Down