mirror of
https://github.com/serratus/quaggaJS.git
synced 2026-08-13 05:31:37 +08:00
code changes according to PR line notes
This commit is contained in:
+4
-6
@@ -47,9 +47,7 @@ function initInputStream(cb) {
|
||||
} else if (_config.inputStream.type === "ImageStream") {
|
||||
_inputStream = InputStream.createImageStream();
|
||||
} else if (_config.inputStream.type === "LiveStream") {
|
||||
|
||||
var $viewport = getViewPort(_config);
|
||||
|
||||
var $viewport = getViewPort();
|
||||
if ($viewport) {
|
||||
video = $viewport.querySelector("video");
|
||||
if (!video) {
|
||||
@@ -73,7 +71,7 @@ function initInputStream(cb) {
|
||||
_inputStream.addEventListener("canrecord", canRecord.bind(undefined, cb));
|
||||
}
|
||||
|
||||
function getViewPort(_config) {
|
||||
function getViewPort() {
|
||||
var target = _config.inputStream.target;
|
||||
// Check if target is already a DOM element
|
||||
if(target && target.nodeName && target.nodeType === 1) {
|
||||
@@ -106,9 +104,9 @@ function ready(cb){
|
||||
cb();
|
||||
}
|
||||
|
||||
function initCanvas(_config) {
|
||||
function initCanvas() {
|
||||
if (typeof document !== "undefined") {
|
||||
var $viewport = getViewPort(_config);
|
||||
var $viewport = getViewPort();
|
||||
_canvasContainer.dom.image = document.querySelector("canvas.imgBuffer");
|
||||
if (!_canvasContainer.dom.image) {
|
||||
_canvasContainer.dom.image = document.createElement("canvas");
|
||||
|
||||
Reference in New Issue
Block a user