Compare commits

..

4 Commits

Author SHA1 Message Date
e89e87de62 Prevent poster being downloaded twice 2015-02-17 23:40:57 +11:00
b7ea8c3875 Merge 2015-02-17 23:18:03 +11:00
a67e495910 Merge branch 'master' of github.com:selz/plyr
Conflicts:
	dist/js/plyr.js
2015-02-17 23:17:39 +11:00
97d6216409 Removed XHR for IE8 2015-02-17 23:17:15 +11:00
3 changed files with 10 additions and 19 deletions

View File

@ -571,30 +571,23 @@
if (captionSrc !== "") {
// Create XMLHttpRequest Object
var xhr;
if (window.XMLHttpRequest) {
xhr = new XMLHttpRequest();
}
else if (window.ActiveXObject) { // IE8
xhr = new ActiveXObject("Microsoft.XMLHTTP");
}
var xhr = new XMLHttpRequest();
xhr.onreadystatechange = function() {
if (xhr.readyState === 4) {
if (xhr.status === 200) {
if (config.debug) {
console.log("xhr = 200");
}
player.captions = [];
var records = [],
record,
req = xhr.responseText;
records = req.split("\n\n");
for (var r=0; r < records.length; r++) {
record = records[r];
player.captions[r] = [];
player.captions[r] = record.split("\n");
}
// Remove first element ("VTT")
player.captions.shift();
@ -602,14 +595,14 @@
console.log("Successfully loaded the caption file via ajax.");
}
}
else {
if (config.debug) {
console.log("There was a problem loading the caption file via ajax.");
}
else if (config.debug) {
console.error("There was a problem loading the caption file via ajax.");
}
}
}
xhr.open("get", captionSrc, true);
xhr.send();
}
}

2
dist/js/plyr.js vendored

File diff suppressed because one or more lines are too long

View File

@ -30,9 +30,7 @@
<!-- Fallback for browsers that don't support the <video> element -->
<div>
<a href="//cdn.sampotts.me/plyr/movie.mp4">
<img src="//cdn.sampotts.me/plyr/poster.jpg" alt="Download">
</a>
<a href="//cdn.sampotts.me/plyr/movie.mp4">Download</a>
</div>
</video>
</div>