Skip to content

Commit

Permalink
Use default framerate when video track framerate is undefined in `Def…
Browse files Browse the repository at this point in the history
…aultVideoFrameProcessorPipeline` (#3045)

Co-authored-by: Shi Su <[email protected]>
  • Loading branch information
shi-su and Shi Su authored Feb 26, 2025
1 parent c81e938 commit a1079c5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Removed

### Changed
- Use default framerate when video track framerate is undefined in `DefaultVideoFrameProcessorPipeline`

### Fixed
Fix TypeError when calling unbindVideoElement
- Fix TypeError when calling unbindVideoElement

## [3.27.0] - 2024-12-11

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export default class DefaultVideoFrameProcessorPipeline implements VideoFramePro
// A negative framerate will cause `captureStream` to throw `NotSupportedError`.
// The setter prevents this by switching to the default framerate if less than 0.
set framerate(value: number) {
this.fr = value < 0 ? DEFAULT_FRAMERATE : value;
this.fr = value < 0 || value === undefined ? DEFAULT_FRAMERATE : value;
}

stop(): void {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,11 @@ describe('DefaultVideoFrameProcessorPipeline', () => {
pipe.framerate = -5;
expect(pipe.framerate).to.equal(15);
});

it('setter ignores undefined frame rate', () => {
pipe.framerate = undefined;
expect(pipe.framerate).to.equal(15);
});
});

describe('addObserver', () => {
Expand Down

0 comments on commit a1079c5

Please sign in to comment.