Vimeo video play button color function

I did a couple of things to fix this issue…

  1. I added a function that adds a class to my Vimeo iFrame:

https://wp-time.com/add-custom-class-to-wordpress-iframe-video/

function video_class($html) {
    if (preg_match('/(vimeo.com)/', $html)) {
        return str_replace('<iframe', '<iframe class="video"', $html);
    } else {
        return $html;
    }
}
add_filter('embed_oembed_html', 'video_class', 99, 4);
  1. I implemented some JS to change the properties of the embed:

https://jsfiddle.net/tfj8pow9/

$(document).ready(function() {
    $('.video').each(function(index) {
        var new_src = $(this).prop('src') + '&color=f1d925';
        $(this).prop('src', new_src)
    });
});

That’s it! Now everything is working as expected 🙂

Thanks,
Josh

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)