Skip to content

Error: shiny app crashes on browser when using qr_scanner #42

@mkaranja

Description

@mkaranja

I have a minimal app working well on my local but crashes on shiny server pro when I click 'Scan Barcode' button (see attached error log). I think the app can't find camera on browser. Is it possible to have a pop-window on browser requesting access to your camera?

library(shiny)
library(opencv)

UI

ui <- fluidPage(
titlePanel("Read QR code in real-time"),
fluidRow(
actionButton("barcode", "Scan Barcode"),
textOutput("results")
)
)

server logic

server <- function(input, output) {
observeEvent( input$barcode , {
identity <- opencv::qr_scanner(draw = FALSE, decoder = "wechat")
output$results <- renderText({
identity
})
})
}

Run the application

shinyApp(ui = ui, server = server)

Error log:
Screenshot from 2024-03-21 10-19-38

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions