Skip to content

Commit

Permalink
[Test] Retry on Max Buffer Range
Browse files Browse the repository at this point in the history
  • Loading branch information
jaruba committed May 30, 2024
1 parent 220f94e commit a280357
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions src/WebOsVideo/WebOsVideo.js
Original file line number Diff line number Diff line change
Expand Up @@ -297,9 +297,20 @@ function WebOsVideo(options) {
if ((result || {}).bufferRange) {
count_message++;

if (count_message === 30 && !answered) {
answered = true;
unsubscribe(cb);
if (count_message === 30) {
if (!gotSourceInfo && subscribeRetries < 5) {
// eslint-disable-next-line no-console
console.log('max bufferRange: waiting 0.2s and retrying to subscribe, count', subscribeRetries);
count_message = 0;
subscribed = false;
subscribeRetries++;
setTimeout(function() {
subscribe(cb);
}, 200);
} else if (!answered) {
answered = true;
unsubscribe(cb);
}
}
}
}, function(err) {
Expand Down

0 comments on commit a280357

Please sign in to comment.