|
@@ -256,19 +256,20 @@ export class VideoSource implements Source
|
256
|
256
|
/**
|
257
|
257
|
* Wait for the input video to be playable
|
258
|
258
|
* @param video
|
259
|
|
- * @returns a promise that resolves to the input video when it can be played through to the end
|
|
259
|
+ * @returns a promise that resolves to the input video when it can be played
|
260
|
260
|
*/
|
261
|
261
|
private _waitUntilPlayable(video: HTMLVideoElement): SpeedyPromise<HTMLVideoElement>
|
262
|
262
|
{
|
263
|
263
|
const TIMEOUT = 15000, INTERVAL = 500;
|
264
|
264
|
|
265
|
|
- if(video.readyState >= 4)
|
|
265
|
+ if(video.readyState >= 3)
|
266
|
266
|
return Speedy.Promise.resolve(video);
|
267
|
267
|
|
268
|
268
|
return new Speedy.Promise<HTMLVideoElement>((resolve, reject) => {
|
269
|
269
|
let ms = 0, t = setInterval(() => {
|
270
|
270
|
|
271
|
|
- if(video.readyState >= 4) { // canplaythrough
|
|
271
|
+ //if(video.readyState >= 4) { // canplaythrough (may timeout on slow connections)
|
|
272
|
+ if(video.readyState >= 3) {
|
272
|
273
|
clearInterval(t);
|
273
|
274
|
resolve(video);
|
274
|
275
|
}
|