Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

cross browser embedded video grayscale filter

On my page I am embedding a video from vimeo as so

<h4>Favopurite songs</h4>
<ul>
    <li>
        <a href="https://player.vimeo.com/video/9159308?autoplay=1" target="vimeoPlayer">
            Three little birds
        </a>
    <li>
</ul>

<section id="player">
    <iframe class="first" src="#" name="vimeoPlayer" width="200" height="150"
frameborder="1" webkitallowfullscreen mozallowfullscreen allowfullscreen>
    </iframe>
</section>

For the css I have

iframe {filter: grayscale(100%)}

This is working in all browsers but not internet exploere 11.

I am aware that since internet exploere 10 they removed the filter property.

I have come across multiple fiddles that are suggested for images and that have hover effects over them.

I am purely looking to add a greyscale filter to my embedded videos without any hover effects and some of the fiddles I found wont work with embedded video.

any help would be greatly appriciated, Thanks

like image 336
Mark Avatar asked Dec 14 '16 12:12

Mark


People also ask

Which declaration will render an image completely grayscale?

The contrast() function adjusts the contrast of the input image. A value of 0% will create an image that is completely gray.

How do I embed a video link in HTML?

To embed a video in an HTML page, use the <iframe> element. The source attribute included the video URL. For the dimensions of the video player, set the width and height of the video appropriately. The Video URL is the video embed link.


1 Answers

use this for different browsers

iframe{
   -webkit-filter: grayscale(100%);
   -moz-filter: grayscale(100%);
   -ms-filter: grayscale(100%);
   -o-filter: grayscale(100%);
   filter: grayscale(100%);
}

now test in IE11.

if IE 11 doesn't support css filters, you have to use a javascript solution to do the same thing.

cross browser grayscale

That link explains the process in detail, using modernizer to detect browsers and so on. It'd be a lot of work to implement though.

like image 162
Milan Gajjar Avatar answered Oct 16 '22 09:10

Milan Gajjar