Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
e89e87de62 | |||
b7ea8c3875 | |||
a67e495910 | |||
97d6216409 |
@ -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
2
dist/js/plyr.js
vendored
File diff suppressed because one or more lines are too long
@ -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>
|
||||
|
Reference in New Issue
Block a user