{"id":118,"date":"2024-10-26T22:25:43","date_gmt":"2024-10-26T22:25:43","guid":{"rendered":"https:\/\/m7lauhbiqx.onrocket.site\/?page_id=303"},"modified":"2024-10-26T22:25:43","modified_gmt":"2024-10-26T22:25:43","slug":"qr-scan","status":"publish","type":"page","link":"https:\/\/vistway.com\/el\/qr-scan\/","title":{"rendered":"QR Scan"},"content":{"rendered":"<div class=\"ticket-verification-container\">\n\n            <div id=\"verification-result\" class=\"ticket-verification-result\">\n                            <\/div>\n            <div id=\"scanner-container\" style=\"display: none;\">\n                <video id=\"qr-video\" style=\"width: 100%; max-width: 500px;\"><\/video>\n                <canvas id=\"qr-canvas\" style=\"display: none;\"><\/canvas>\n            <\/div>\n            <a href=\"#\" class=\"qr-code-scan-btn\" id=\"start-scanner\">\n                <img decoding=\"async\" src=\"https:\/\/vistway.com\/wp-content\/plugins\/listeo-core\/assets\/images\/listeo_qr.svg\" \/>\n                <span>Click to Open QR Code Scanner<\/span>\n            <\/a>\n\n            <div id=\"debug-info\" style=\"display:none; margin-top: 20px; padding: 10px; background-color: #f0f0f0;\"><\/div>\n        <\/div>\n\n        <script src=\"https:\/\/cdn.jsdelivr.net\/npm\/jsqr@1.3.1\/dist\/jsQR.min.js\"><\/script>\n        <script>\n            document.addEventListener('DOMContentLoaded', function() {\n                const video = document.getElementById('qr-video');\n                const canvas = document.getElementById('qr-canvas');\n                const ctx = canvas.getContext('2d');\n                const startButton = document.getElementById('start-scanner');\n                const scannerContainer = document.getElementById('scanner-container');\n                const resultDiv = document.getElementById('verification-result');\n\n                const debugInfo = document.getElementById('debug-info');\n                let scanning = false;\n                let stream = null;\n\n                function log(message) {\n                    console.log(message);\n                    debugInfo.innerHTML += message + '<br>';\n                }\n\n                startButton.addEventListener('click', function() {\n                    if (scanning) {\n                        stopScanner();\n                    } else {\n                        startScanner();\n                    }\n                });\n\n                function startScanner() {\n                    if (!navigator.mediaDevices || !navigator.mediaDevices.getUserMedia) {\n                        log('Sorry, your browser doesn\\'t support accessing the camera.');\n                        return;\n                    }\n\n                    navigator.mediaDevices.getUserMedia({\n                            video: {\n                                facingMode: \"environment\"\n                            }\n                        })\n                        .then(function(mediaStream) {\n                            log('Camera access granted');\n                            scanning = true;\n                            stream = mediaStream;\n                            startButton.textContent = 'Stop Scanner';\n                            scannerContainer.style.display = 'block';\n                            video.srcObject = stream;\n                            video.setAttribute(\"playsinline\", true);\n                            video.play();\n                            requestAnimationFrame(tick);\n                        })\n                        .catch(function(err) {\n                            log('Error accessing the camera: ' + err.message);\n                        });\n                }\n\n                function stopScanner() {\n                    log('Stopping scanner');\n                    scanning = false;\n                    startButton.textContent = 'Start Scanner';\n                    scannerContainer.style.display = 'none';\n                    if (stream) {\n                        stream.getTracks().forEach(track => track.stop());\n                        stream = null;\n                    }\n                    video.srcObject = null;\n                }\n\n                function tick() {\n                    if (scanning) {\n                        if (video.readyState === video.HAVE_ENOUGH_DATA) {\n                            canvas.height = video.videoHeight;\n                            canvas.width = video.videoWidth;\n                            ctx.drawImage(video, 0, 0, canvas.width, canvas.height);\n                            var imageData = ctx.getImageData(0, 0, canvas.width, canvas.height);\n                            var code = jsQR(imageData.data, imageData.width, imageData.height, {\n                                inversionAttempts: \"dontInvert\",\n                            });\n                            if (code) {\n                                log(\"Found QR code: \" + code.data);\n                                stopScanner();\n                                window.location.href = code.data; \/\/ Automatically redirect to the URL in the QR code\n                            }\n                        }\n                        requestAnimationFrame(tick);\n                    }\n                }\n\n                function verifyTicket(url) {\n                    const verifyParam = new URL(url).searchParams.get('verify');\n                    if (verifyParam) {\n                        log('Verifying ticket: ' + verifyParam);\n                        window.location.href = url; \/\/ Redirect to the verification URL\n                    } else {\n                        resultDiv.innerHTML = '<p>Invalid QR code. Please try again.<\/p>';\n                    }\n                }\n\n                window.addEventListener('unload', stopScanner);\n            });\n        <\/script>\n        \n\n\n\n<p class=\"wp-block-paragraph\"><\/p>","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"template-dashboard.php","meta":{"footnotes":""},"class_list":["post-118","page","type-page","status-publish","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.6 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>QR Scan - VistWay<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/vistway.com\/el\/qr-scan\/\" \/>\n<meta property=\"og:locale\" content=\"el_GR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"QR Scan - VistWay\" \/>\n<meta property=\"og:url\" content=\"https:\/\/vistway.com\/el\/qr-scan\/\" \/>\n<meta property=\"og:site_name\" content=\"VistWay\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/vistway.com\\\/qr-scan\\\/\",\"url\":\"https:\\\/\\\/vistway.com\\\/qr-scan\\\/\",\"name\":\"QR Scan - VistWay\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/vistway.com\\\/#website\"},\"datePublished\":\"2024-10-26T22:25:43+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/vistway.com\\\/qr-scan\\\/#breadcrumb\"},\"inLanguage\":\"el\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/vistway.com\\\/qr-scan\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/vistway.com\\\/qr-scan\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u0391\u03c1\u03c7\u03b9\u03ba\u03ae\",\"item\":\"https:\\\/\\\/vistway.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"QR Scan\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/vistway.com\\\/#website\",\"url\":\"https:\\\/\\\/vistway.com\\\/\",\"name\":\"VistWay\",\"description\":\"Direct booking Greece - Europe\",\"publisher\":{\"@id\":\"https:\\\/\\\/vistway.com\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/vistway.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"el\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/vistway.com\\\/#organization\",\"name\":\"VistWay\",\"url\":\"https:\\\/\\\/vistway.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"el\",\"@id\":\"https:\\\/\\\/vistway.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/vistway.com\\\/wp-content\\\/uploads\\\/2026\\\/04\\\/Gemini_Generated_Image___4_-removebg-preview-removebg-preview.png\",\"contentUrl\":\"https:\\\/\\\/vistway.com\\\/wp-content\\\/uploads\\\/2026\\\/04\\\/Gemini_Generated_Image___4_-removebg-preview-removebg-preview.png\",\"width\":612,\"height\":408,\"caption\":\"VistWay\"},\"image\":{\"@id\":\"https:\\\/\\\/vistway.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"QR Scan - VistWay","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/vistway.com\/el\/qr-scan\/","og_locale":"el_GR","og_type":"article","og_title":"QR Scan - VistWay","og_url":"https:\/\/vistway.com\/el\/qr-scan\/","og_site_name":"VistWay","twitter_card":"summary_large_image","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/vistway.com\/qr-scan\/","url":"https:\/\/vistway.com\/qr-scan\/","name":"QR Scan - VistWay","isPartOf":{"@id":"https:\/\/vistway.com\/#website"},"datePublished":"2024-10-26T22:25:43+00:00","breadcrumb":{"@id":"https:\/\/vistway.com\/qr-scan\/#breadcrumb"},"inLanguage":"el","potentialAction":[{"@type":"ReadAction","target":["https:\/\/vistway.com\/qr-scan\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/vistway.com\/qr-scan\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u0391\u03c1\u03c7\u03b9\u03ba\u03ae","item":"https:\/\/vistway.com\/"},{"@type":"ListItem","position":2,"name":"QR Scan"}]},{"@type":"WebSite","@id":"https:\/\/vistway.com\/#website","url":"https:\/\/vistway.com\/","name":"VistWay","description":"Direct booking Greece - Europe","publisher":{"@id":"https:\/\/vistway.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/vistway.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"el"},{"@type":"Organization","@id":"https:\/\/vistway.com\/#organization","name":"VistWay","url":"https:\/\/vistway.com\/","logo":{"@type":"ImageObject","inLanguage":"el","@id":"https:\/\/vistway.com\/#\/schema\/logo\/image\/","url":"https:\/\/vistway.com\/wp-content\/uploads\/2026\/04\/Gemini_Generated_Image___4_-removebg-preview-removebg-preview.png","contentUrl":"https:\/\/vistway.com\/wp-content\/uploads\/2026\/04\/Gemini_Generated_Image___4_-removebg-preview-removebg-preview.png","width":612,"height":408,"caption":"VistWay"},"image":{"@id":"https:\/\/vistway.com\/#\/schema\/logo\/image\/"}}]}},"_links":{"self":[{"href":"https:\/\/vistway.com\/el\/wp-json\/wp\/v2\/pages\/118","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/vistway.com\/el\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/vistway.com\/el\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/vistway.com\/el\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/vistway.com\/el\/wp-json\/wp\/v2\/comments?post=118"}],"version-history":[{"count":0,"href":"https:\/\/vistway.com\/el\/wp-json\/wp\/v2\/pages\/118\/revisions"}],"wp:attachment":[{"href":"https:\/\/vistway.com\/el\/wp-json\/wp\/v2\/media?parent=118"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}