cross browser embedded video grayscale filter

5.8k views Asked by At

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

1

There are 1 answers

0
Milan Gajjar On BEST ANSWER

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.