Skip to content

Commit 7f1a0da

Browse files
committed
update nextjs sample to adapt to DBR JS 9.0.0
1 parent 8381a10 commit 7f1a0da

7 files changed

Lines changed: 32 additions & 31 deletions

File tree

1.hello-world/7.read-video-nextjs/components/HelloWorld.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React from 'react';
22
import VideoDecode from './VideoDecode';
33
import ImgDecode from './ImgDecode';
44
import "../dbr"; // import side effects. The license, engineResourcePath, so on.
5-
import { BarcodeScanner } from 'dynamsoft-javascript-barcode';
5+
import { BarcodeScanner } from 'keillion-dynamsoft-javascript-barcode';
66

77
class HelloWorld extends React.Component {
88
constructor(props) {

1.hello-world/7.read-video-nextjs/components/ImgDecode.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, { Component } from 'react'
2-
import { BarcodeReader } from 'dynamsoft-javascript-barcode'
2+
import { BarcodeReader } from 'keillion-dynamsoft-javascript-barcode'
33

44
export default class ImgDecode extends Component {
55
constructor(props) {

1.hello-world/7.read-video-nextjs/components/VideoDecode.js

Lines changed: 13 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

1.hello-world/7.read-video-nextjs/dbr.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { BarcodeReader } from "dynamsoft-javascript-barcode";
1+
import { BarcodeReader } from "keillion-dynamsoft-javascript-barcode";
22

33
/** LICENSE ALERT - README
44
*
@@ -14,4 +14,4 @@ import { BarcodeReader } from "dynamsoft-javascript-barcode";
1414

1515
/** LICENSE ALERT - THE END */
1616

17-
BarcodeReader.engineResourcePath = "https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@8.8.7/dist/";
17+
BarcodeReader.engineResourcePath = "https://cdn.jsdelivr.net/npm/keillion-dynamsoft-javascript-barcode@0.20220318174621.0/dist/";

1.hello-world/7.read-video-nextjs/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
},
1111
"dependencies": {
1212
"dynamsoft-javascript-barcode": "8.8.7",
13+
"keillion-dynamsoft-javascript-barcode": "0.20220318174621.0",
1314
"next": "11.1.2",
1415
"react": "17.0.2",
1516
"react-dom": "17.0.2"
@@ -18,4 +19,4 @@
1819
"eslint": "7.32.0",
1920
"eslint-config-next": "11.1.2"
2021
}
21-
}
22+
}
Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
.component-barcode-scanner{width:100%;height:100%;min-width:640px;min-height:480px;background:#eee;position:relative;resize:both;}
2-
.dbrScanner-bg-loading{animation:1s linear infinite dbrScanner-rotate;width:40%;height:40%;position:absolute;margin:auto;left:0;top:0;right:0;bottom:0;fill:#aaa;}
3-
.dbrScanner-bg-camera{width:40%;height:40%;position:absolute;margin:auto;left:0;top:0;right:0;bottom:0;fill:#aaa;}
4-
.dbrScanner-video{width:100%;height:100%;position:absolute;left:0;top:0;}
5-
.dbrScanner-cvs-drawarea{width:100%;height:100%;position:absolute;left:0;top:0;}
6-
.dbrScanner-cvs-scanarea{width:100%;height:100%;position:absolute;left:0;top:0;}
7-
.dbrScanner-scanlight{width:100%;height:3%;position:absolute;animation:3s infinite dbrScanner-scanlight;border-radius:50%;box-shadow:0px 0px 2vw 1px #00e5ff;background:#fff;}
8-
.dbrScanner-sel-camera{margin:0 auto;position:absolute;left:0;top:0;}
9-
.dbrScanner-sel-resolution{position:absolute;left:0;top:20px;}
10-
.dbrScanner-msg-poweredby{position:absolute;left:50%;bottom:10%;transform:translateX(-50%);}
11-
.dbrScanner-msg-poweredby svg {height:max(3vmin,17px);fill:#FFFFFF;}
12-
@keyframes dbrScanner-rotate{from{transform:rotate(0turn);}to{transform:rotate(1turn);}}
13-
@keyframes dbrScanner-scanlight{from{top:0;}to{top:97%;}}
2+
.dce-bg-loading{animation:1s linear infinite dce-rotate;width:40%;height:40%;position:absolute;margin:auto;left:0;top:0;right:0;bottom:0;fill:#aaa;}
3+
.dce-bg-camera{width:40%;height:40%;position:absolute;margin:auto;left:0;top:0;right:0;bottom:0;fill:#aaa;}
4+
.dce-video-container{position:absolute;left:0;top:0;width:100%;height:100%;}
5+
.dce-scanarea{width:100%;height:100%;position:absolute;left:0;top:0;}
6+
.dce-scanlight{width:100%;height:3%;position:absolute;animation:3s infinite dce-scanlight;border-radius:50%;box-shadow:0px 0px 2vw 1px #00e5ff;background:#fff;}
7+
.div-select-container{position:absolute;left:0;top:0;}
8+
.dce-sel-camera{display:block;}
9+
.dce-sel-resolution{display:block;margin-top:5px;}
10+
.dbr-msg-poweredby{position:absolute;left:50%;bottom:10%;transform:translateX(-50%);}
11+
.dbr-msg-poweredby svg {height:max(3vmin,17px);fill:#FFFFFF;}
12+
@keyframes dce-rotate{from{transform:rotate(0turn);}to{transform:rotate(1turn);}}
13+
@keyframes dce-scanlight{from{top:0;}to{top:97%;}}

1.hello-world/7.read-video-nextjs/styles/Home.module.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,6 @@
124124
margin: 2vmin auto;
125125
text-align: center;
126126
font-size: medium;
127-
height: 40vh;
127+
/* height: 40vh; */
128128
width: 80vw;
129129
}

0 commit comments

Comments
 (0)