Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix TSLint errors #77

Merged
merged 2 commits into from
Nov 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/common/HTMLCanvasElementLuminanceSource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export class HTMLCanvasElementLuminanceSource extends LuminanceSource {
// .299R + 0.587G + 0.114B (YUV/YIQ for PAL and NTSC),
// (306*R) >> 10 is approximately equal to R*0.299, and so on.
// 0x200 >> 10 is 0.5, it implements rounding.
// tslint:disable-next-line:no-bitwise
gray = (306 * pixelR + 601 * pixelG + 117 * pixelB + 0x200) >> 10;
}
grayscaleBuffer[j] = gray;
Expand Down
3 changes: 3 additions & 0 deletions src/readers/BrowserCodeReader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -287,11 +287,13 @@ export class BrowserCodeReader {
public static async tryPlayVideo(videoElement: HTMLVideoElement): Promise<boolean> {

if (videoElement?.ended) {
// tslint:disable-next-line:no-console
console.error('Trying to play video that has ended.');
return false;
}

if (BrowserCodeReader.isVideoPlaying(videoElement)) {
// tslint:disable-next-line:no-console
console.warn('Trying to play video that is already playing.');
return true;
}
Expand All @@ -300,6 +302,7 @@ export class BrowserCodeReader {
await videoElement.play();
return true;
} catch (error) {
// tslint:disable-next-line:no-console
console.warn('It was not possible to play the video.', error);
return false;
}
Expand Down