<commit_before>import React, { Component } from 'react';
import VideoPlayer from 'react-background-video-player';
import { Parallax, Background } from 'react-parallax';


export default class BackgroundParallaxVideo extends Component {
  
  constructor(props) {
    super(props);
    this.state = {
      isPlaying: undefined,
      isMuted: undefined,
      progress: 0,
      currentTime: 0,
      duration: 0,
      windowWidth: window.innerWidth,
      windowHeight: window.innerHeight,
    };
  }

  componentDidMount() {
    this.setState({
      isPlaying: !this.state.isPaused,
      isMuted: true,
    });
    window.addEventListener('resize', this.handleResize);
  }

  componentWillMount() {
    window.removeEventListener('resize', this.handleResize);
  }

  handleResize = () => {
    this.setState({
      windowWidth: window.innerWidth,
      windowHeight: window.innerHeight,
    })
  };

  render() {
    return (
      <div>
        <Parallax strength={1000}>
          <Background>
            <div style={{
              width: this.state.windowWidth,
              height: this.state.windowHeight
            }} />
            <VideoPlayer 
              playsInline
              containerWidth = {this.state.windowWidth}
              containerHeight = {this.state.windowHeight}
              src = {this.props.videoSource}
              volume = {0}
              startTime = {this.props.startTime}
              muted
              loop
              autoPlay
            />
          </Background>
          <div style={{
            width: this.state.windowWidth,
            height: this.state.windowHeight
            }} className="transparent-scranton-bg">
            {this.props.children}
          </div>
        </Parallax>
      </div>
    );
  }<commit_msg>fixed window is not defined bug<commit_after>import React, { Component } from 'react';
import VideoPlayer from 'react-background-video-player';
import { Parallax, Background } from 'react-parallax';


export default class BackgroundParallaxVideo extends Component {
  
  constructor(props) {
    super(props);
    this.state = {
      isPlaying: undefined,
      isMuted: undefined,
      progress: 0,
      currentTime: 0,
      duration: 0,
      windowWidth: 0,
      windowHeight: 0,
    };
  }

  componentDidMount() {
    this.setState({
      isPlaying: !this.state.isPaused,
      isMuted: true,
    });
    if (typeof window !== 'undefined') {
      window.addEventListener('resize', this.handleResize);
    }
  }

  componentWillMount() {
    if(typeof window !== 'undefined') {
      this.setState({
        windowWidth: window.innerWidth,
        windowHeight: window.innerHeight
      });
      window.removeEventListener('resize', this.handleResize);
    }
  }

  handleResize = () => {
    if (typeof window !== 'undefined') {
      this.setState({
        windowWidth: window.innerWidth,
        windowHeight: window.innerHeight,
      });
    }
  };

  render() {
    return (
      <div>
        <Parallax strength={1000}>
          <Background>
            <div style={{
              width: this.state.windowWidth,
              height: this.state.windowHeight
              }} />
            <VideoPlayer 
              playsInline
              containerWidth = {this.state.windowWidth}
              containerHeight = {this.state.windowHeight}
              src = {this.props.videoSource}
              volume = {0}
              startTime = {this.props.startTime}
              muted
              loop
              autoPlay
            />
          </Background>
          <div style={{
            width: this.state.windowWidth,
            height: this.state.windowHeight
            }} className="transparent-scranton-bg">
            {this.props.children}
          </div>
        </Parallax>
      </div>
    );
  }
{'fraction_non_alphanumeric': 0.11331075800989841, 'fraction_numerical': 0.004688721021099245, 'mean_word_length': 1.8381374722838137, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3522590', 'n_tokens_mistral': 1064, 'n_tokens_neox': 1047, 'n_words': 207}