Note that there are some explanatory texts on larger screens.

plurals
  1. POHTML5 Video - Fading Effects not working on Chrome
    primarykey
    data
    text
    <p>I'm currently facing a strange behavior in Chrome. Basically, what I'm trying to do is, placing videos on top of other videos.</p> <p>I have a basic video which is at the base layer (z-index: 0). It repeats itself all the time. When a user performs certain actions (clicking a button, etc...) another video which was invisible before clicking the button, should fade in on top of the other video.</p> <p>In Firefox (fe) everything is working fine. In Chrome nothing happens. Instead of fading the top video appears instantly after the time for the fading animation ran out.</p> <p><a href="http://jsfiddle.net/J36nQ/" rel="nofollow">http://jsfiddle.net/J36nQ/</a></p> <p>I set up a fiddle. As you can see, the 1000ms are running trough and after that, the top video is shown directly without fading in. Trying to do the same in Firefox will result in a successful fading animation.</p> <p>That's what I tried so far:</p> <pre><code>&lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;title&gt;Video Test&lt;/title&gt; &lt;style type="text/css"&gt; *{ margin: 0; padding: 0; } .video{ position: absolute; } #video{ z-index: 0; } #action-1-wrapper{ z-index: 1; display: none; } button{ position: absolute; bottom: 10px; } &lt;/style&gt; &lt;script type="text/javascript" src="http://code.jquery.com/jquery-1.10.2.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; $(function(){ $action1 = $('#action-1').get(0); $mainVid = $('#main-video').get(0); $('#play1').click(function(){ // Main Video should be paused when playing a video on top stopMainVideo(); // I fade in the container which holds the video $('#action-1-wrapper').fadeIn(1000, function(){ // After fading in the video in the top wrapper should be played $action1.play(); }); }); $('.actionvideo').bind('ended', function(){ var $video = $(this).get(0); $video.currentTime = 0; $(this).parent().fadeOut(1000, function(){ playMainVideo(); }); }); function stopMainVideo() { $mainVid.pause(); } function playMainVideo() { $mainVid.play(); } }); &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;div id="video" class="video"&gt; &lt;video autobuffer width="100%" autoplay="autoplay" loop="loop" id="main-video"&gt; &lt;source src="https://workid-service.de/samplevids/loop.mp4" type="video/mp4" /&gt; &lt;/video&gt; &lt;/div&gt; &lt;div id="action-1-wrapper" class="video"&gt; &lt;video autobuffer width="100%" id="action-1" class="actionvideo"&gt; &lt;source src="https://workid-service.de/samplevids/aktion1.mp4" type="video/mp4" /&gt; &lt;/video&gt; &lt;/div&gt; &lt;button id="play1"&gt;Animation 1&lt;/button&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>I hope somebody can give me a hint why chrome behaves like that.</p> <p>Thanks in advance, Thomas</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload