<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Welcome Page</title>
    <style>
        body, html {
            height: 100%;
            margin: 0;
            font-family: Arial, Helvetica, sans-serif;
        }
        .bg-video {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            overflow: hidden;
            z-index: -1;
        }
        .bg-video video {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }
    </style> 
</head>
<body>
    <div class="bg-video">
        <video id="welcome-video" autoplay muted>
            <source src="https://dl.dropboxusercontent.com/scl/fi/1eoyykh8usex41mcwb8po/VID_20240624_044242_383-2.mp4?rlkey=gka3tt347ylsxjmpcb472ez31&st=e9sn8xqx&dl=0" type="video/mp4">
            Your browser does not support HTML5 video.
        </video>
    </div>

    <!-- Add audio element for background music -->
    <audio id="welcome-audio" loop>
        <source src="wlc.mp3" type="audio/mpeg">
        Your browser does not support the audio element.
    </audio>

    <script>
        var video = document.getElementById('welcome-video');
        var audio = document.getElementById('welcome-audio');

        // Play the audio when the window loads
        window.addEventListener('load', function() {
            // Check for the autoplay policy
            audio.play().catch(error => {
                console.log('Autoplay error:', error);
                // Attempt to play audio after user interaction
                document.body.addEventListener('click', function() {
                    audio.play();
                }, { once: true });
            });
        });

        // Add an event listener for when the video ends
        video.addEventListener('ended', function() {
            // Redirect to the login page
            window.location.href = 'login.php'; // Change this to your actual login page URL
        });
    </script>
</body>
</html>
