Video size and border radius using a shortcode

How can I remove the style attribute from the <video> tag? I embedded a video on the front page using the video shortcode and applied a border-radius to it with CSS. It looks good. I modified the video shortcode a bit in functions.php: add_filter( ‘wp_video_shortcode’, function( $output ) { $output = str_replace( “<video”, “<video muted … Read more

How to Replace the WordPress Featured Image with a Video?

I need to replace featured images on pages with a video if certain posts contain a video from YouTube, Vimeo, other video hosting services allowed by WordPress. Here’s the pseudo code that I want to use on a custom page: if ( has_post_thumbnail( get_the_ID() { if has_video(pseudocode to check whether the single post contains youtube … Read more

Trying to remove the download button on WordPress Native Video Player?

Can I remove the download button in the WordPress Native Video Player? I don’t want to encourage people to download my video’s. 1 Answer 1 This is actually the default behavior of how the browser renders HTML5 video. From this post you should be able to use the following CSS to hide the button. video::-internal-media-controls-download-button … Read more

Remove wp-mediaelement.css from wp_head

I´m customizing the new core audio/video player via CSS in my styles.css. I tried to remove the wp-mediaelement.css with the following code in functions.php, because I don´t need it anymore. function custom_deregister_styles() { wp_deregister_style( ‘mediaelement’); } add_action( ‘wp_print_styles’, ‘custom_deregister_styles’, 100 ); The problem is, that this function removes the call of mediaelementplayer.min.css and wp-mediaelement.css. The … Read more

How add class youtube and type/html to oembed code?

How can i add : class=”youtube-player” type=”text/html” to iframe like : function Oembed_youtube_no_title($html,$url,$args){ $url_string = parse_url($url, PHP_URL_QUERY); parse_str($url_string, $id); if (isset($id[‘v’])) { return ‘<iframe class=”youtube-player” type=”text/html” src=”https://www.youtube.com/embed/’ .$id[‘v’].’?vq=large&autohide=1&autoplay=1&fs=1&hl=fr&rel=0&loop=1″ frameborder=”0″ allowfullscreen></iframe>’; } return $html; } 2 s 2 You can try this: add_filter( ’embed_oembed_html’, ‘custom_youtube_oembed’ ); function custom_youtube_oembed( $code ){ if( stripos( $code, ‘youtube.com’ ) !== … Read more

How do i disable or Remove the Native WordPress Video Player?

Any idea on how I can totally disable or entirely remove the default/Native WordPress video player? 1 1 welcome aboard. WordPress uses Media Elements JS for default video/audio player. You can disable this scripts with this code. Please add this code to your theme’s functions.php function deregister_media_elements(){ wp_deregister_script(‘wp-mediaelement’); wp_deregister_style(‘wp-mediaelement’); } add_action(‘wp_enqueue_scripts’,’deregister_media_elements’); PS. This code de-register … Read more