Object Title

Click the button to start scanning for beacons.

Bluetooth/title> </head> <body> <button id="startBeaconScan" data-element-type="dButtonLinkId" style="border-radius: 10px!important; color:white; font-weight: 800; background-color: rgba(2, 133, 244, 1)!important; padding: 1em 2.5em!important;" class="u_activate-bluetooth align-center dmButtonLink dmWidget dmWwr default dmOnlyButton dmDefaultGradient"> Aktivieren Sie Bluetooth für den Exponatführer </button> <p> ... und erhalten Sie interaktive Inhalte, wenn Sie sich Exponaten nähern. </p> <script> const beaconStatusElement = document.getElementById('beaconStatus'); const startScanButton = document.getElementById('startBeaconScan'); startScanButton.addEventListener('click', startBeaconScan); async function startBeaconScan() { if (!('bluetooth' in navigator)) { beaconStatusElement.textContent = 'Bluetooth not supported in this browser.'; return; } try { // Request location permission (if needed) if (navigator.permissions) { const { state } = await navigator.permissions.query({ name: 'geolocation' }); if (state !== 'granted') { console.error("Location permission is not granted."); beaconStatusElement.textContent = "Please grant location permission."; return; } } const scan = await navigator.bluetooth.requestLEScan(); navigator.bluetooth.addEventListener('advertisementreceived', (event) => { const { uuid } = event.device; if (uuid === '0xf7826da6-bc5b71e0-893e-625958574577' || uuid === '0xf7826da6-bc5b71e0-893e-6934564f706f' || uuid === '0xF7826DA6BC5B71E0893E625958574577') { scan.stop(); handleBeaconDetection(uuid); } }); setTimeout(() => { scan.stop(); beaconStatusElement.textContent = 'Beacon scan stopped.'; }, 10000); } catch (error) { console.error('Error during beacon scan:', error); beaconStatusElement.textContent = 'Error: ' + error; } } function handleBeaconDetection(uuid) { console.log('Beacon detected:', uuid); if (uuid === '0xf7826da6-bc5b71e0-893e-625958574577') { window.location.href = "https://bergdietikon.gallery.cultart.ch/details/1352"; } else if (uuid === '0xf7826da6-bc5b71e0-893e-6934564f706f') { // Load YouTube video const mediaContainer = document.createElement('div'); mediaContainer.innerHTML = ` <iframe width="560" height="315" src="https://www.youtube.com/embed/YOUR_VIDEO_ID" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen> </iframe> `; document.body.appendChild(mediaContainer); } else if (uuid === '0xf7826da6-bc5b71e0-893e-337365454c32') { beaconStatusElement.textContent = 'Welcome to the special exhibit!'; } } </script> </body> </html>
Bluetooth/title> </head> <body> <button id="startBeaconScan" data-element-type="dButtonLinkId" style="border-radius: 10px!important; color:white; font-weight: 800; background-color: rgba(2, 133, 244, 1)!important; padding: 1em 2.5em!important;" class="u_activate-bluetooth align-center dmButtonLink dmWidget dmWwr default dmOnlyButton dmDefaultGradient"> Aktivieren Sie Bluetooth für den Exponatführer </button> <p> ... und erhalten Sie interaktive Inhalte, wenn Sie sich Exponaten nähern. </p> <script> const beaconStatusElement = document.getElementById('beaconStatus'); const startScanButton = document.getElementById('startBeaconScan'); startScanButton.addEventListener('click', startBeaconScan); async function startBeaconScan() { if (!('bluetooth' in navigator)) { beaconStatusElement.textContent = 'Bluetooth not supported in this browser.'; return; } try { // Request location permission (if needed) if (navigator.permissions) { const { state } = await navigator.permissions.query({ name: 'geolocation' }); if (state !== 'granted') { console.error("Location permission is not granted."); beaconStatusElement.textContent = "Please grant location permission."; return; } } const scan = await navigator.bluetooth.requestLEScan(); navigator.bluetooth.addEventListener('advertisementreceived', (event) => { const { uuid } = event.device; if (uuid === '0xf7826da6-bc5b71e0-893e-625958574577' || uuid === '0xf7826da6-bc5b71e0-893e-6934564f706f' || uuid === '0xF7826DA6BC5B71E0893E625958574577') { scan.stop(); handleBeaconDetection(uuid); } }); setTimeout(() => { scan.stop(); beaconStatusElement.textContent = 'Beacon scan stopped.'; }, 10000); } catch (error) { console.error('Error during beacon scan:', error); beaconStatusElement.textContent = 'Error: ' + error; } } function handleBeaconDetection(uuid) { console.log('Beacon detected:', uuid); if (uuid === '0xf7826da6-bc5b71e0-893e-625958574577') { window.location.href = "https://bergdietikon.gallery.cultart.ch/details/1352"; } else if (uuid === '0xf7826da6-bc5b71e0-893e-6934564f706f') { // Load YouTube video const mediaContainer = document.createElement('div'); mediaContainer.innerHTML = ` <iframe width="560" height="315" src="https://www.youtube.com/embed/YOUR_VIDEO_ID" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen> </iframe> `; document.body.appendChild(mediaContainer); } else if (uuid === '0xf7826da6-bc5b71e0-893e-337365454c32') { beaconStatusElement.textContent = 'Welcome to the special exhibit!'; } } </script> </body> </html>
Bluetooth/title> </head> <body> <button id="startBeaconScan" data-element-type="dButtonLinkId" style="border-radius: 10px!important; color:white; font-weight: 800; background-color: rgba(2, 133, 244, 1)!important; padding: 1em 2.5em!important;" class="u_activate-bluetooth align-center dmButtonLink dmWidget dmWwr default dmOnlyButton dmDefaultGradient"> Aktivieren Sie Bluetooth für den Exponatführer </button> <p> ... und erhalten Sie interaktive Inhalte, wenn Sie sich Exponaten nähern. </p> <script> const beaconStatusElement = document.getElementById('beaconStatus'); const startScanButton = document.getElementById('startBeaconScan'); startScanButton.addEventListener('click', startBeaconScan); async function startBeaconScan() { if (!('bluetooth' in navigator)) { beaconStatusElement.textContent = 'Bluetooth not supported in this browser.'; return; } try { // Request location permission (if needed) if (navigator.permissions) { const { state } = await navigator.permissions.query({ name: 'geolocation' }); if (state !== 'granted') { console.error("Location permission is not granted."); beaconStatusElement.textContent = "Please grant location permission."; return; } } const scan = await navigator.bluetooth.requestLEScan(); navigator.bluetooth.addEventListener('advertisementreceived', (event) => { const { uuid } = event.device; if (uuid === '0xf7826da6-bc5b71e0-893e-625958574577' || uuid === '0xf7826da6-bc5b71e0-893e-6934564f706f' || uuid === '0xF7826DA6BC5B71E0893E625958574577') { scan.stop(); handleBeaconDetection(uuid); } }); setTimeout(() => { scan.stop(); beaconStatusElement.textContent = 'Beacon scan stopped.'; }, 10000); } catch (error) { console.error('Error during beacon scan:', error); beaconStatusElement.textContent = 'Error: ' + error; } } function handleBeaconDetection(uuid) { console.log('Beacon detected:', uuid); if (uuid === '0xf7826da6-bc5b71e0-893e-625958574577') { window.location.href = "https://bergdietikon.gallery.cultart.ch/details/1352"; } else if (uuid === '0xf7826da6-bc5b71e0-893e-6934564f706f') { // Load YouTube video const mediaContainer = document.createElement('div'); mediaContainer.innerHTML = ` <iframe width="560" height="315" src="https://www.youtube.com/embed/YOUR_VIDEO_ID" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen> </iframe> `; document.body.appendChild(mediaContainer); } else if (uuid === '0xf7826da6-bc5b71e0-893e-337365454c32') { beaconStatusElement.textContent = 'Welcome to the special exhibit!'; } } </script> </body> </html>
Share by: