mirror of
https://github.com/videojs/video.js.git
synced 2025-07-15 01:34:23 +02:00
Don't track progress until ready
Delay manual progress checks until the tech is ready to avoid errors. The Flash tech errors if buffered() is called before the SWF has loaded, for instance. closes #2316 fixes #2288 rel #2289
This commit is contained in:
@ -61,14 +61,26 @@ test('stops manual timeupdates while paused', function() {
|
||||
});
|
||||
|
||||
test('should synthesize progress events by default', function() {
|
||||
var progresses = 0, tech;
|
||||
var progresses = 0, bufferedPercent = 0.5, tech;
|
||||
tech = new Tech();
|
||||
tech.on('progress', function() {
|
||||
progresses++;
|
||||
});
|
||||
tech.bufferedPercent = function() {
|
||||
return bufferedPercent;
|
||||
};
|
||||
|
||||
this.clock.tick(500);
|
||||
equal(progresses, 0, 'waits until ready');
|
||||
|
||||
tech.trigger('ready');
|
||||
this.clock.tick(500);
|
||||
equal(progresses, 1, 'triggered one event');
|
||||
|
||||
tech.trigger('ready');
|
||||
bufferedPercent = 0.75;
|
||||
this.clock.tick(500);
|
||||
equal(progresses, 2, 'repeated readies are ok');
|
||||
});
|
||||
|
||||
test('dispose() should stop time tracking', function() {
|
||||
|
Reference in New Issue
Block a user