vendor/assets/javascripts/webshims/shims/track.js in webshims-rails-1.14.6 vs vendor/assets/javascripts/webshims/shims/track.js in webshims-rails-1.15.2
- old
+ new
@@ -64,12 +64,16 @@
this.cues = mediaelement.createCueList();
} else {
var lastCue = this.cues[this.cues.length-1];
if(lastCue && lastCue.startTime > cue.startTime){
webshims.error("cue startTime higher than previous cue's startTime");
+ return;
}
}
+ if(cue.startTime >= cue.endTime ){
+ webshim.error('startTime >= endTime of cue: '+ cue.text);
+ }
if(cue.track && cue.track.removeCue){
cue.track.removeCue(cue);
}
cue.track = this;
this.cues.push(cue);
@@ -157,10 +161,11 @@
$([trackList]).triggerHandler($.Event({type: 'removetrack', track: removed[i]}));
}
for(i = 0, len = added.length; i < len; i++){
$([trackList]).triggerHandler($.Event({type: 'addtrack', track: added[i]}));
}
+ //todo: remove
if(baseData.scriptedTextTracks || removed.length){
$(this).triggerHandler('updatetrackdisplay');
}
}
};
@@ -173,11 +178,11 @@
if(trackData && !trackData.isTriggering){
trackData.isTriggering = true;
setTimeout(function(){
$(track).closest('audio, video').triggerHandler('updatetrackdisplay');
trackData.isTriggering = false;
- }, 1);
+ }, 9);
}
};
var isDefaultTrack = (function(){
var defaultKinds = {
subtitles: {
@@ -366,18 +371,13 @@
});
},
error: error
});
};
- if($.ajax && $.ajaxSettings.xhr){
- if(isDisabled){
- setTimeout(createAjax, loadingTracks * 2);
- } else {
- createAjax();
- }
+ if(isDisabled){
+ setTimeout(createAjax, loadingTracks * 2);
} else {
- webshims.ready('jajax', createAjax);
- webshims.loader.loadList(['jajax']);
+ createAjax();
}
} catch(er){
error();
webshims.error(er);
}