Uly.me

cloud engineer

  • Home
  • About
  • Archives
Home/Archives for youtube

January 20, 2019

Gutenberg Youtube Embed

The Gutenberg Youtube embed lacks a few things. The alignment doesn’t seem to be working, at least in the theme I’m using. I’m using Generate-Pro, a Genesis child theme. By default, it’s left-aligned. I have to add this div to make it centered.

<div style="text-align:center">
</div>

<div style="text-align:center"> </div>

If you want right aligned, use this div.

<div style="text-align:right">
</div>

<div style="text-align:right"> </div>

December 23, 2016

Override WordPress Video Dimensions

WordPress comes with its own media player. It supports M4a, MP4, OGG, WebM, FLV, WMV, MP3, WAV and WMA formats. In addition, you can also embed videos from a dozen external sites such as YouTube, Vimeo, etc. WordPress will automatically embed the video when you add it to your post. You can change the dimensions of your videos by overriding the width and the height of the media player.

Edit the functions.php file, and add the following code.

function override_video_dimensions( $out, $pairs, $atts ) {
  $out['width'] = '640';
  $out['height'] = '360';
  return $out;
}
add_filter( 'shortcode_atts_video', 'override_video_dimensions', 10, 3 );

function override_video_dimensions( $out, $pairs, $atts ) { $out['width'] = '640'; $out['height'] = '360'; return $out; } add_filter( 'shortcode_atts_video', 'override_video_dimensions', 10, 3 );

Here’s how to add YouTube videos in WordPress.

January 28, 2015

YouTube HTML5 Video Player

YouTube now defaults to HTML5 video player instead of Flash. The new player takes advantage of MediaSource extensions for its Adaptive Bitrate streaming allowing viewers to quickly and seamlessly switch resolutions. The new player also uses a new video codec called VP9 which gives you higher resolution with low bandwidth. YouTube will also start using WebRTC for recording videos and for live streaming capabilities. Read more.

  • Cloud
  • Linux
  • Git

Copyright © 2012–2021