question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Live Stream leaves a black screen

See original GitHub issue

I’ve incorporated Quaggajs successfully into my node project however after the scan is complete and Quagga.stop() is called a black screen fills the area of the scanner and doesn’t close out. I am using the LiveStream function. Has anyone else had to deal with this problem?

Here is my code:

Index.html:

<section id="UPC Search"> <form id="form-search"> <button class="submit-button mdl-button mdl-js-button mdl-button--raised mdl-js-ripple-effect mdl-button--accent">Scan barcode</button> <input type="hidden" name="query" value=""/> <div id="interactive" class="viewport"></div> </form>

` var $formSearch = $(“#form-search”); var $submitButton = $formSearch.find(‘.submit-button’);

$submitButton.on(‘click’, function(e){ e.preventDefault(); //prevent form submission openReader(); });

            $formSearch.submit(function(event) {
                // cancel default behavior
                event.preventDefault();


                var query = $formSearch.find("input[name='query']").val();
                console.log("index query value = "+ query);

                $brand.html('');
                $manufacturer.html('');
                window.upcSearch.queryProducts(query, $brand, $manufacturer, $subsidies, $violations, $co_profile_description, $parentCo);

            }); `

BarcodeReader.js:

`function openReader(){ Quagga.init({ inputStream: { name: “Live”, type: “LiveStream”, constraints: { width: 640, height: 480, facingMode: “environment” } }, locator: { patchSize: “medium”, halfSample: true }, numOfWorkers: 4, locate: true, decoder : { readers: [“upc_reader”, “upc_e_reader”] } }, function() { Quagga.start(); });

Quagga.onDetected(function(result) { var code = result.codeResult.code; console.log("The code is "+code);

var $form = $("#form-search");

$form.find("input[name='query']").val(code);
Quagga.stop();
$form.submit();

}); } `

https://github.com/ruskibenya/DolDem/tree/quaggajs

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:16 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
shwetametacommented, Feb 15, 2021

I solved it by setting the desired value via jquery and triggering the change event.

Thanks

0reactions
ericbladecommented, Feb 14, 2021

I use this for my constraints block to specify camera

                constraints: {
                    width: 640,
                    height: 480,
                    ...(cameraId && { deviceId: cameraId }),
                    ...(!cameraId && { facingMode: 'environment' }),
                },

if cameraId is not falsy, then use deviceId: cameraId, otherwise use the (i believe deprecated, but still working) facingMode: ‘environment’ constraint

I do wonder if it would be possible to specify constraints such as aspect ratio, as required elements, to automatically prevent the wide-angle lenses from being used. I do not know what numbers would need to be plugged in to do that, though.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Black Screen Display When Live Streaming
A common scenario when setting up your first live stream is a black screen. Here's how you can resolve this. Check the following...
Read more >
[SOLVED] Twitch Black Screen Issues - Driver Easy
Start streaming in Twitch and see if the black screen issue is resolved. If yes, then congrats! If the black screen persists, please...
Read more >
Screen goes black seconds into streaming video from ANY ...
Every time i watch a video now from any streaming service, the screen goes black. This happens whether it is full screen or...
Read more >
I get a black screen when I watch Live TV - 10 play
I get a black screen when I watch Live TV · Check that your browser is not blocking ads (instructions on how to...
Read more >
How can I fix black screen issues? - Agora Documentation
Black screen on the remote side ​ ... This is likely caused by a video capture failure on the remote side or slow...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found