0

I am trying to insert a video background on a div in my header and it works in my local server. But whenever I deploy it in the live server it goes black and shows

DevTools failed to load source map: Could not load content for chrome-extension://gighmmpiobklfepjocnamgkkbiglidom/browser-polyfill.js.map: System error: net::ERR_FILE_NOT_FOUND

I have tried adding the MIME type in my .htaccess

As well I also tried to disable the JavaScript source maps and CSS source maps but the div is still black. Because my video is in my build folder with every media file in my code. So I do not understand why it's telling me that it does not exist or cannot find it. Also i removed the last line (//# sourceMappingURL=main.c0dd6000.js.map) but it's still not playing the video as suggested in this answer(How can I fix the "DevTools failed to load SourceMap: Could not load content" error when adding a JavaScript library?) Never the less, here is the code:

import React from 'react';
import './header.css';

import Typewriter from 'typewriter-effect';
// ------------NEW STYLE----------------
import { Parallax, ParallaxBanner, ParallaxBannerLayer } from 'react-scroll-parallax';

import video_bg from '../../assets/bg_video1.mp4';
import textil from '../../assets/Guatemala/textil2.jpg';
import tree from '../../assets/Guatemala/tree.png';
import { Circle } from '../../icons';
import { CircleRings } from '../../icons';

const Header = () => {
  return (
    <>
    <div className='RO__header section__padding' >
      <div className='RO__header-content'>
        <h1 className='content_text-1'>
          I’m 
        </h1>
        <div className='content_text-effect'>
          
          <Typewriter 
            options={{
              strings: ['an Engineer', 'a Data Scientist', 'a Web Developer'],
              autoStart: true,
              loop: true,
            }}
          />
        </div>
        <h1 className='content_text-2'>
          here to help you turn your business into something greater
        </h1>
      </div>
    </div>
    <div className='RO__Parallax'>
      <div className='RO__Parallax_background'>
        {/* <ParallaxBanner 
          layers={[
            { image: textil, speed: -30}
          ]}>
        </ParallaxBanner> */}
        <video 
          src = {video_bg} autoPlay loop 
          className='RO__Parallax_foreground-video'/> 
      </div>
      <div className='RO__Parallax_foreground'>
        <ParallaxBanner 
        layers={[
          ,
          {
            speed: -15,
            children: (
              <div className='RO__Parallax_foreground-title'>
                  <h1>R A F A E L</h1>  
              </div>
            ),
          }
        ]}>
        </ParallaxBanner> 
        
      </div>
    </div>
    <div className='RO__Overlap'>
      <Parallax
        translateY={[-50, 50]}
        translateX={[-10, 90]}>
        <Circle className='RO__Overlap-Circle' />
      </Parallax>
      <Parallax 
        translateY={[-50, 50]}
        translateX={[10, -90]}
        rotate={[-360,0]}>
        <CircleRings className='RO__Overlap-circleRings' />
      </Parallax>
    </div>
    
    </>
  )
}

export default Header
TylerH
  • 20,799
  • 66
  • 75
  • 101
  • `not showing video just on mozzilla` + `it works in my local server` ... does this mean it works in ALL browsers locally, but fails in firefox on the live server? but then you add `Could not load content for chrome-extension:` which is not mozilla, and it's just a source map, so won't effect the functionality of the site – Jaromanda X May 15 '23 at 00:24
  • Sorry, i think i have to edit the wording. It works in every browser locally but when i push it live, the video goes black in everyother broswer except in mozzilla (the video only shows in mozzilla while live) – Rafael Oliva May 15 '23 at 03:36
  • I would check if a plain HTML document with a `video` element is able to play that video file in your other browsers, first of all. Maybe it gets returned by the server with some response headers the browsers don't like. – CBroe May 15 '23 at 08:55
  • The sourcemap error is not relevant. Inspect the `video` element in your browser's dev tools. Does its `src` attribute point to a video url? Can you open that video url directly in a new tab? Start there. If that all checks out, look at the network tab in the dev tools. Is the browser requesting it? Is it being blocked by an extension or adblocker? – ray Jun 01 '23 at 20:08

0 Answers0