Skip to content

Commit 76f323f

Browse files
committed
Optimize yt for faster loading
1 parent 9a87023 commit 76f323f

File tree

7 files changed

+12
-5
lines changed

7 files changed

+12
-5
lines changed

chrome/player/modules/dash.mjs

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

chrome/player/modules/googlevideo.mjs

Lines changed: 2 additions & 1 deletion
Large diffs are not rendered by default.

chrome/player/modules/yt.mjs

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

chrome/player/network/StandardDownloader.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ export class StandardDownloader {
8989

9090
async onSuccess(response, stats, entry, xhr) {
9191
this.updateSpeed(stats);
92-
this.entry.onSuccess(response, stats, this.entry, xhr);
92+
await this.entry.onSuccess(response, stats, this.entry, xhr);
9393
this.cleanup();
9494
}
9595

chrome/player/players/dash/DashLoader.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ export function DASHLoaderFactory(player) {
2222
const requestObj = httpRequest.customData.request;
2323
const representation = requestObj.representation;
2424
if (!representation) {
25+
console.error('Representation not found', requestObj);
2526
request(httpRequest, true, requestObj.startTime || 0, true);
2627
return;
2728
}

chrome/player/players/dash/DashPlayer.mjs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,11 @@ export default class DashPlayer extends EventEmitter {
9191
initialize();
9292
});
9393

94+
this.dash.on('REPRESENTATION_UPDATED', (a) => {
95+
const rep = a.representation;
96+
this.extractFragments(rep);
97+
});
98+
9499
this.dash.on('dataUpdateCompleted', (a) => {
95100
this.extractAllFragments();
96101
});

chrome/player/players/yt/YTPlayer.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -653,7 +653,7 @@ export default class YTPlayer extends DashPlayer {
653653

654654

655655
if (!newResponse.data) {
656-
throw new Error('No data from SABR UMP processor');
656+
throw new Error('(r) No data from SABR UMP processor');
657657
}
658658
return newResponse;
659659
}

0 commit comments

Comments
 (0)