Skip to content

Commit

Permalink
Merge pull request #530 from sc-atompower/feature/noposter
Browse files Browse the repository at this point in the history
allows the poster attribute of the html video tag to be bindable.
  • Loading branch information
werthdavid authored Jul 21, 2023
2 parents 3daa74e + 180964d commit 190742b
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 190742b

Please sign in to comment.