Skip to content

Commit

Permalink
allows the poster attribute of the html video tag to be bindable. Thi…
Browse files Browse the repository at this point in the history
…s resolves the 404 noposter issue when using this library.
  • Loading branch information
sc-atompower committed Jun 26, 2023
1 parent 3daa74e commit 180964d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<video #preview [style.object-fit]="previewFitMode" poster="noposter">
<video #preview [style.object-fit]="previewFitMode" [poster]="poster">
<p>
Your browser does not support this feature, please try to upgrade it.
</p>
Expand Down
11 changes: 9 additions & 2 deletions projects/zxing-scanner/src/lib/zxing-scanner.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,12 @@ export class ZXingScannerComponent implements OnInit, OnDestroy {
@Input()
previewFitMode: 'fill' | 'contain' | 'cover' | 'scale-down' | 'none' = 'cover';

/**
* Url of the HTML video poster
*/
@Input()
poster: string = '';

/**
* Emits events when the torch compatibility is changed.
*/
Expand Down Expand Up @@ -757,7 +763,7 @@ export class ZXingScannerComponent implements OnInit, OnDestroy {
if (!this._codeReader) {
const options = {
delayBetweenScanAttempts: this.timeBetweenScans,
delayBetweenScanSuccess: this.delayBetweenScanSuccess,
delayBetweenScanSuccess: this.delayBetweenScanSuccess
};
this._codeReader = new BrowserMultiFormatContinuousReader(this.hints, options);
}
Expand All @@ -784,7 +790,8 @@ export class ZXingScannerComponent implements OnInit, OnDestroy {

const next = (x: ResultAndError) => this._onDecodeResult(x.result, x.error);
const error = (err: any) => this._onDecodeError(err);
const complete = () => { };
const complete = () => {
};

this._scanSubscription = scanStream.subscribe(next, error, complete);

Expand Down

0 comments on commit 180964d

Please sign in to comment.