React js stop looping background video












0















I am trying to make a page with looping background video with React js.



When I compile the code I can see the video is playing straight away on the browser but when I click the link of website, the video is not playing. I should click the Home button in the page and starts again.



I used



<video src={BackVideo} autoplay="true" loop="true">


I could not use :



react-native-video



library because I got an error when I import the library in the code.



Also I have one more problem that the video is not playing in Safari at all.



Can someone help me please.



Here is my part of Javascript file



render() {
return (
<div>
<div className="bgded overlay">
{/* Menu, call the menu component with the ChangeViewButtonClick function recieved from Dashbaord */}
<Menu ChangeViewButtonClick={this.props.ChangeViewButtonClick} />

</div>

<header className="v-header container">

<div class="fullscreen-video-wrap">

<video src={BackVideo} autoplay="true" loop="true"> </video>

</div>
<div className="header-overlay"></div>
<div className="header-content">

<article>
<h1 className="heading">Something</h1>
<h2 className="heading">something too</h2>



</article>

</div>
</header>

{/* Start of Overview */}
<div className="wrapper row3">
<main className="hoc container clear">
<article className="two_third first">
<h4 className="font-x2 font-x3">
Lorem ipsum dolor sit, amet consectetur adipisicing elit.
Exercitationem, nihil.
</h4>


</article>

</main>
</div>
{/* End of Overview */}
</div>









share|improve this question





























    0















    I am trying to make a page with looping background video with React js.



    When I compile the code I can see the video is playing straight away on the browser but when I click the link of website, the video is not playing. I should click the Home button in the page and starts again.



    I used



    <video src={BackVideo} autoplay="true" loop="true">


    I could not use :



    react-native-video



    library because I got an error when I import the library in the code.



    Also I have one more problem that the video is not playing in Safari at all.



    Can someone help me please.



    Here is my part of Javascript file



    render() {
    return (
    <div>
    <div className="bgded overlay">
    {/* Menu, call the menu component with the ChangeViewButtonClick function recieved from Dashbaord */}
    <Menu ChangeViewButtonClick={this.props.ChangeViewButtonClick} />

    </div>

    <header className="v-header container">

    <div class="fullscreen-video-wrap">

    <video src={BackVideo} autoplay="true" loop="true"> </video>

    </div>
    <div className="header-overlay"></div>
    <div className="header-content">

    <article>
    <h1 className="heading">Something</h1>
    <h2 className="heading">something too</h2>



    </article>

    </div>
    </header>

    {/* Start of Overview */}
    <div className="wrapper row3">
    <main className="hoc container clear">
    <article className="two_third first">
    <h4 className="font-x2 font-x3">
    Lorem ipsum dolor sit, amet consectetur adipisicing elit.
    Exercitationem, nihil.
    </h4>


    </article>

    </main>
    </div>
    {/* End of Overview */}
    </div>









    share|improve this question



























      0












      0








      0








      I am trying to make a page with looping background video with React js.



      When I compile the code I can see the video is playing straight away on the browser but when I click the link of website, the video is not playing. I should click the Home button in the page and starts again.



      I used



      <video src={BackVideo} autoplay="true" loop="true">


      I could not use :



      react-native-video



      library because I got an error when I import the library in the code.



      Also I have one more problem that the video is not playing in Safari at all.



      Can someone help me please.



      Here is my part of Javascript file



      render() {
      return (
      <div>
      <div className="bgded overlay">
      {/* Menu, call the menu component with the ChangeViewButtonClick function recieved from Dashbaord */}
      <Menu ChangeViewButtonClick={this.props.ChangeViewButtonClick} />

      </div>

      <header className="v-header container">

      <div class="fullscreen-video-wrap">

      <video src={BackVideo} autoplay="true" loop="true"> </video>

      </div>
      <div className="header-overlay"></div>
      <div className="header-content">

      <article>
      <h1 className="heading">Something</h1>
      <h2 className="heading">something too</h2>



      </article>

      </div>
      </header>

      {/* Start of Overview */}
      <div className="wrapper row3">
      <main className="hoc container clear">
      <article className="two_third first">
      <h4 className="font-x2 font-x3">
      Lorem ipsum dolor sit, amet consectetur adipisicing elit.
      Exercitationem, nihil.
      </h4>


      </article>

      </main>
      </div>
      {/* End of Overview */}
      </div>









      share|improve this question
















      I am trying to make a page with looping background video with React js.



      When I compile the code I can see the video is playing straight away on the browser but when I click the link of website, the video is not playing. I should click the Home button in the page and starts again.



      I used



      <video src={BackVideo} autoplay="true" loop="true">


      I could not use :



      react-native-video



      library because I got an error when I import the library in the code.



      Also I have one more problem that the video is not playing in Safari at all.



      Can someone help me please.



      Here is my part of Javascript file



      render() {
      return (
      <div>
      <div className="bgded overlay">
      {/* Menu, call the menu component with the ChangeViewButtonClick function recieved from Dashbaord */}
      <Menu ChangeViewButtonClick={this.props.ChangeViewButtonClick} />

      </div>

      <header className="v-header container">

      <div class="fullscreen-video-wrap">

      <video src={BackVideo} autoplay="true" loop="true"> </video>

      </div>
      <div className="header-overlay"></div>
      <div className="header-content">

      <article>
      <h1 className="heading">Something</h1>
      <h2 className="heading">something too</h2>



      </article>

      </div>
      </header>

      {/* Start of Overview */}
      <div className="wrapper row3">
      <main className="hoc container clear">
      <article className="two_third first">
      <h4 className="font-x2 font-x3">
      Lorem ipsum dolor sit, amet consectetur adipisicing elit.
      Exercitationem, nihil.
      </h4>


      </article>

      </main>
      </div>
      {/* End of Overview */}
      </div>






      javascript html reactjs






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 22 '18 at 0:49







      Axis

















      asked Nov 21 '18 at 22:39









      AxisAxis

      1,1091926




      1,1091926
























          1 Answer
          1






          active

          oldest

          votes


















          0














          I figure out and might someone have the same problem.



          use autoPlay loop muted so;



          <video className='VideoTag' autoPlay loop muted>
          <source src={BackVideo} type='video/mp4'/>
          </video>





          share|improve this answer
























            Your Answer






            StackExchange.ifUsing("editor", function () {
            StackExchange.using("externalEditor", function () {
            StackExchange.using("snippets", function () {
            StackExchange.snippets.init();
            });
            });
            }, "code-snippets");

            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "1"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53421422%2freact-js-stop-looping-background-video%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            I figure out and might someone have the same problem.



            use autoPlay loop muted so;



            <video className='VideoTag' autoPlay loop muted>
            <source src={BackVideo} type='video/mp4'/>
            </video>





            share|improve this answer




























              0














              I figure out and might someone have the same problem.



              use autoPlay loop muted so;



              <video className='VideoTag' autoPlay loop muted>
              <source src={BackVideo} type='video/mp4'/>
              </video>





              share|improve this answer


























                0












                0








                0







                I figure out and might someone have the same problem.



                use autoPlay loop muted so;



                <video className='VideoTag' autoPlay loop muted>
                <source src={BackVideo} type='video/mp4'/>
                </video>





                share|improve this answer













                I figure out and might someone have the same problem.



                use autoPlay loop muted so;



                <video className='VideoTag' autoPlay loop muted>
                <source src={BackVideo} type='video/mp4'/>
                </video>






                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Nov 22 '18 at 1:55









                AxisAxis

                1,1091926




                1,1091926
































                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53421422%2freact-js-stop-looping-background-video%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    How to change which sound is reproduced for terminal bell?

                    Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents

                    Can I use Tabulator js library in my java Spring + Thymeleaf project?