Skip to content

Commit

Permalink
Fix: [Client][Player/PlayerWrapper] 細かな修正
Browse files Browse the repository at this point in the history
  • Loading branch information
tsukumijima committed Oct 30, 2023
1 parent 6ad7567 commit dd8ef55
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions client/src/services/player/PlayerWrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -508,9 +508,13 @@ class PlayerWrapper {
private getPlaybackBufferSeconds(): number {
if (this.player === null) return 0;
if (this.playback_mode === 'Live') {
const buffered_range_count = this.player.video.buffered.length;
const buffer_remain = this.player.video.buffered.end(buffered_range_count - 1) - this.player.video.currentTime;
return Utils.mathFloor(buffer_remain, 3);
try {
const buffered_range_count = this.player.video.buffered.length;
const buffer_remain = this.player.video.buffered.end(buffered_range_count - 1) - this.player.video.currentTime;
return Utils.mathFloor(buffer_remain, 3);
} catch (error) {
return 0;
}
} else {
return 0;
}
Expand Down

0 comments on commit dd8ef55

Please sign in to comment.