Skip to content

Commit 190742b

Browse files
authored
Merge pull request #530 from sc-atompower/feature/noposter
allows the poster attribute of the html video tag to be bindable.
2 parents 3daa74e + 180964d commit 190742b

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

projects/zxing-scanner/src/lib/zxing-scanner.component.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<video #preview [style.object-fit]="previewFitMode" poster="noposter">
1+
<video #preview [style.object-fit]="previewFitMode" [poster]="poster">
22
<p>
33
Your browser does not support this feature, please try to upgrade it.
44
</p>

projects/zxing-scanner/src/lib/zxing-scanner.component.ts

+9-2
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,12 @@ export class ZXingScannerComponent implements OnInit, OnDestroy {
122122
@Input()
123123
previewFitMode: 'fill' | 'contain' | 'cover' | 'scale-down' | 'none' = 'cover';
124124

125+
/**
126+
* Url of the HTML video poster
127+
*/
128+
@Input()
129+
poster: string = '';
130+
125131
/**
126132
* Emits events when the torch compatibility is changed.
127133
*/
@@ -757,7 +763,7 @@ export class ZXingScannerComponent implements OnInit, OnDestroy {
757763
if (!this._codeReader) {
758764
const options = {
759765
delayBetweenScanAttempts: this.timeBetweenScans,
760-
delayBetweenScanSuccess: this.delayBetweenScanSuccess,
766+
delayBetweenScanSuccess: this.delayBetweenScanSuccess
761767
};
762768
this._codeReader = new BrowserMultiFormatContinuousReader(this.hints, options);
763769
}
@@ -784,7 +790,8 @@ export class ZXingScannerComponent implements OnInit, OnDestroy {
784790

785791
const next = (x: ResultAndError) => this._onDecodeResult(x.result, x.error);
786792
const error = (err: any) => this._onDecodeError(err);
787-
const complete = () => { };
793+
const complete = () => {
794+
};
788795

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

0 commit comments

Comments
 (0)