Hi,
Please insert given below php code at functions.php of child. This code will prevent from update and modification everytime.
function sf_video_youtube($url, $width = 640, $height = 480) {
preg_match('/[\\?\\&]v=([^\\?\\&]+)/', $url, $video_id);
return '<div class="sf-video-wrap"><iframe itemprop="video" src="//www.youtube.com/embed/'. $video_id[1] .'?wmode=transparent" width="'. $width .'" height="'. $height .'" ></iframe></div>';
}
function sf_video_vimeo($url, $width = 640, $height = 480) {
preg_match('/http:\/\/vimeo.com\/(\d+)$/', $url, $video_id);
return '<div class="sf-video-wrap"><iframe itemprop="video" src="//player.vimeo.com/video/'. $video_id[1] .'?title=0&byline=0&portrait=0?wmode=transparent" width="'. $width .'" height="'. $height .'"></iframe></div>';
}
function sf_get_embed_src($url) {
if (strpos($url,'youtube')){
preg_match('/[\\?\\&]v=([^\\?\\&]+)/', $url, $video_id);
if (isset($video_id[1])) {
return '//www.youtube.com/embed/'. $video_id[1] .'?autoplay=1&wmode=transparent';
}
} else {
preg_match('/https:\/\/vimeo.com\/(\d+)$/', $url, $video_id);
if (isset($video_id[1])) {
return '//player.vimeo.com/video/'. $video_id[1] .'?title=0&byline=0&portrait=0&autoplay=1&wmode=transparent';
}
}
}
Thanks
Mohammad