javascript - jQuery not working with video -


i trying video fade out using jquery

on html have video:

html

  <video playsinline autoplay loop id="video">       <source src="myvideo.mp4" type="video/mp4">   </video> 

then on js file:

var $vid = $('#video');  $vid.delay(2000).fadeout(500); 

instead of fade out video disappear. appreciated.

there seems inconsistency between browsers handling of opacity applied video tag. although reason inconsistency not clear me, able reproduce , solve adding parent div , fading div.

so, html be:

<div>     <video playsinline autoplay loop id="video">         <source src="myvideo.mp4" type="video/mp4">     </video> </div> 

then, js be:

var $vid = $('#video'); $vid.delay(2000).parent().fadeout(500); 

Comments

Popular posts from this blog

How to understand 2 main() functions after using uftrace to profile the C++ program? -

c# - Update a combobox from a presenter (MVP) -

How to put a lock and transaction on table using spring 4 or above using jdbcTemplate and annotations like @Transactional? -