Skip to content

Commit

Permalink
Try to recover from a streaming failure.
Browse files Browse the repository at this point in the history
Closes #28.

Change-Id: I09df3e2fbb631ca1215e5d44baa9ada67ede9cee
  • Loading branch information
joeyparrish committed Mar 10, 2015
1 parent eab39ef commit 55e6ebc
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/media/stream.js
Original file line number Diff line number Diff line change
Expand Up @@ -647,7 +647,6 @@ shaka.media.Stream.prototype.onUpdate_ = function() {
// Dispatch a non-bubbling event. Let the VideoSource handle it.
var event = shaka.util.FakeEvent.create({ type: 'ended' });
this.dispatchEvent(event);

return;
}

Expand Down Expand Up @@ -682,6 +681,12 @@ shaka.media.Stream.prototype.onUpdate_ = function() {
if (error.type != 'aborted') {
var event = shaka.util.FakeEvent.createErrorEvent(error);
this.dispatchEvent(event);

if (error.type == 'net' && error.xhr.status == 0) {
// Hope to recover soon...
this.updateTimerId_ =
window.setTimeout(this.onUpdate_.bind(this), 5000);
}
}
})
);
Expand Down

0 comments on commit 55e6ebc

Please sign in to comment.