Skip to content

Commit

Permalink
fix(player): update initial duration in can play correctly
Browse files Browse the repository at this point in the history
closes #981
  • Loading branch information
mihar-22 committed Oct 29, 2023
1 parent 13162fd commit 2534cae
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/vidstack/src/core/state/media-state-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -345,10 +345,10 @@ export class MediaStateManager extends MediaPlayerController {

protected _onCanPlayDetail(detail: ME.MediaCanPlayDetail) {
const { seekable, seekableEnd, buffered, duration, canPlay } = this.$state;
seekable.set(detail.seekable);
buffered.set(detail.buffered);
duration.set(seekableEnd);
canPlay.set(true);
buffered.set(detail.buffered);
seekable.set(detail.seekable);
duration.set(seekableEnd());
}

['duration-change'](event: ME.MediaDurationChangeEvent) {
Expand Down

0 comments on commit 2534cae

Please sign in to comment.