Elevate Your Business with Professional Video Production

Are you ready to take your firearm business to new heights? Look no further than Armory Daily – your premier partner for professional video production tailored specifically for firearm businesses like yours. With our unparalleled expertise and the world’s largest outdoor and firearm network, Armory Daily is your gateway to reaching millions of potential customers and making a lasting impression.

Video Pre-roll Form
      <!DOCTYPE html>
      <html lang="en">
      <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>Video Pre-roll</title>
        <style>
          /* Add your CSS styles here */
        </style>
      </head>
      <body>
        <div id="video-container">
          <video id="pre-roll-player" autoplay playsinline>
            <source src="https://armorydaily.com/wp-content/uploads/2024/06/Unleashing-the-Indestructibility-of-Glock_-The-Ultimate-Endurance-Test-glock-glock17.mp4" type="video/mp4">
          </video>
          <div id="countdown-container">
            <span id="countdown">Ad: 30</span>
          </div>
        </div>

        <!-- Desktop-specific content -->
        <div id="info-section" class="desktop">
          <div class="image-container">
            <img src="https://armorydaily.com/wp-content/uploads/2024/06/images.png" alt="Image">
          </div>
          <div class="text-container">
            <div class="title">Glock: Pursue Your Perfection</div>
            <a href="#" class="button" target="_blank">Learn More</a>
            <!-- Overlay for the button -->
            <a href="https://armorydaily.com/order-ads/?sid=9&bsa_pro_id=49&bsa_pro_url=us.glock.com/en" class="button-overlay" target="_blank"></a>
          </div>
        </div>

        <script>
          document.addEventListener('DOMContentLoaded', function() {
            const preRollPlayer = document.getElementById('pre-roll-player');
            const countdown = document.getElementById('countdown');
            const countdownContainer = document.getElementById('countdown-container');
            const videoContainer = document.getElementById('video-container');

            // Detect device type
            const isMobile = /iPhone|iPad|iPod|Android/i.test(navigator.userAgent);

            if (isMobile) {
              // Mobile-specific logic
              document.body.classList.add('mobile');
              document.body.classList.remove('desktop');

              // Mobile-specific script
              window.addEventListener('load', function() {
                // Find the YouTube video container (assumes it's the parent of the iframe)
                const youtubeIframe = document.querySelector('iframe[src*="youtube.com/embed"]');
                const youtubeVideoContainer = youtubeIframe ? youtubeIframe.parentElement : null;

                if (youtubeVideoContainer) {
                  // Hide the YouTube video container and show the pre-roll video
                  youtubeVideoContainer.style.display = 'none';
                  preRollPlayer.style.display = 'block';

                  let countdownInterval;
                  preRollPlayer.addEventListener('play', () => {
                    let timeLeft = 30;
                    countdownInterval = setInterval(() => {
                      timeLeft--;
                      countdown.textContent = `Ad: ${timeLeft}`;
                      if (timeLeft <= 0) {
                        clearInterval(countdownInterval);
                        preRollPlayer.style.display = 'none';
                        countdown.style.display = 'none';
                        youtubeVideoContainer.style.display = 'block';
                      }
                    }, 1000);
                  });

                  // Unmute the video when the user interacts with the page
                  const unmuteVideo = () => {
                    preRollPlayer.muted = false;
                    preRollPlayer.play().catch(error => {
                      console.log('Play error:', error);
                    });
                    document.removeEventListener('click', unmuteVideo);
                    document.removeEventListener('touchstart', unmuteVideo);
                  };

                  document.addEventListener('click', unmuteVideo);
                  document.addEventListener('touchstart', unmuteVideo);

                  preRollPlayer.addEventListener('error', function(e) {
                    console.log('Video error:', e);
                    // Display an error message or take appropriate action
                  });
                } else {
                  console.log('No YouTube video found on the page.');
                }
              });
            } else {
              // Desktop-specific logic
              document.body.classList.add('desktop');
              document.body.classList.remove('mobile');

              // Desktop-specific script
              const youtubeContainer = document.querySelector('iframe[src*="youtube.com/embed"]').parentElement;

              if (youtubeContainer) {
                // Hide the YouTube video and show the pre-roll video
                youtubeContainer.style.display = 'none';
                preRollPlayer.style.display = 'block';

                let timeLeft = 30;
                const countdownInterval = setInterval(() => {
                  timeLeft--;
                  countdown.textContent = `Ad: ${timeLeft}`;
                  if (timeLeft <= 0) {
                    clearInterval(countdownInterval);
                    preRollPlayer.style.display = 'none';
                    countdownContainer.style.display = 'none';
                    youtubeContainer.style.display = 'block';
                  }
                }, 1000);

                preRollPlayer.addEventListener('error', function(e) {
                  console.log('Video error:', e);
                  // Display an error message or take appropriate action
                });
              } else {
                console.log('No YouTube video found on the page.');
              }
            }
          });
        </script>
      </body>
      </html>
    
`; document.getElementById('html-code').innerText = htmlCode; }
Armory Daily Logo (7)