\/iframe>#Usm', $the_content, $matches, PREG_SET_ORDER)) {
            foreach ($matches as $match) {
                $the_content = str_replace($match[0], 'httpv://youtu.be/'.$match[1], $the_content);
            }
        }
    }
    if ( strpos($the_content,".*(.*) <\!--\s?/wp:(?:core[-|/])?embed(?:/youtube)?\s?-->%Us';
            $the_content = preg_replace($gutenbeard_playlist_regex, 'httpv://www.youtube.com/playlist?list=\1\2  ',$the_content);
        }
        $gutenbeard_single_regex = '%<\!--\s?wp:(?:core[-|/])?embed(?:/youtube)?\s?{"url":"https?://(?:www\.)?youtu(?:be\.com|.be)/(?:watch\?v=)?(.*)"}\s?-->.*(.*) <\!--\s?/wp:(?:core[-|/])?embed(?:/youtube)?\s?-->%Us';
        $the_content = preg_replace($gutenbeard_single_regex, 'httpv://www.youtube.com/watch?v=\1\2  ',$the_content);
    }
    if((strpos($the_content, "httpv")!==FALSE)||(strpos($the_content, "httpa")!==FALSE)) {
        if (apply_filters('lyte_remove_wpautop',false)) {
            remove_filter('the_content','wpautop');
        }
        $char_codes = array('×','–');
        $replacements = array("x", "--");
        $the_content=str_replace($char_codes, $replacements, $the_content);
        $lyte_feed=is_feed();
        
        $hidefClass = ($lyteSettings['hidef']==="1") ? " hidef" : "";
        $postID = get_the_ID();
        $toCache_index=array();
        $lytes_regexp="/(?:
)?http(v|a):\/\/([a-zA-Z0-9\-\_]+\.|)(youtube|youtu)(\.com|\.be)\/(((watch(\?v\=|\/v\/)|.+?v\=|)([a-zA-Z0-9\-\_]{11}))|(playlist\?list\=([a-zA-Z0-9\-\_]*)))([^\s<]*)()?/";
        preg_match_all($lytes_regexp, $the_content, $matches, PREG_SET_ORDER); 
        foreach($matches as $match) {
            /** API: filter hook to preparse fragment in a httpv-url, e.g. to force hqThumb=1 or showinfo=0 */
            $match[12] = apply_filters( 'lyte_match_preparse_fragment',$match[12] );
            preg_match("/stepSize\=([\+\-0-9]{2})/",$match[12],$sMatch);
            preg_match("/showinfo\=([0-1]{1})/",$match[12],$showinfo);
            preg_match("/start\=([0-9]*)/",$match[12],$start);
            preg_match("/enablejsapi\=([0-1]{1})/",$match[12],$jsapi);
            preg_match("/hqThumb\=([0-1]{1})/",$match[12],$hqThumb);
            preg_match("/noMicroData\=([0-1]{1})/",$match[12],$microData);
            $thumb="normal";
            if ($lyteSettings['hidef']==="1") {
                $thumb="highres";
            } else if (!empty($hqThumb)) {
                if ($hqThumb[0]==="hqThumb=1") {
                    $thumb="highres";
                }
            }
            $noMicroData="0";
            if (!empty($microData)) {
                if ($microData[0]==="noMicroData=1") {
                    $noMicroData="1";
                }
            }
  
            $qsa="";
            if (!empty($showinfo[0])) {
                $qsa="&".$showinfo[0];
                $titleClass=" hidden";
            } else {
                $titleClass="";
            }
            if (!empty($start[0])) $qsa.="&".$start[0];
            if (!empty($jsapi[0])) $qsa.="&".$jsapi[0]."&origin=".$origin;
            if (!empty($qsa)) {
                $esc_arr=array("&" => "\&", "?" => "\?", "=" => "\=");
                $qsaClass=" qsa_".strtr($qsa,$esc_arr);
            } else {
                $qsaClass="";
            }
            if (!empty($sMatch)) {
                $newSize=(int) $sMatch[1];
                $newPos=(int) $lyteSettings['selSize']+$newSize;
                if ($newPos<0) {
                    $newPos=0;
                } else if ($newPos > count($lyteSettings['sizeArray'])-1) {
                    $newPos=count($lyteSettings['sizeArray'])-1;
                }
                $lyteSettings[2]=$lyteSettings['sizeArray'][$newPos]['w'];
                $lyteSettings[3]=$lyteSettings['sizeArray'][$newPos]['h'];
            } else {
                $lyteSettings[2]=$lyteSettings['sizeArray'][$lyteSettings['selSize']]['w'];
                $lyteSettings[3]=$lyteSettings['sizeArray'][$lyteSettings['selSize']]['h'];
            }
            if ($match[1]!=="a") {
                 $divHeight=$lyteSettings[3];
                $audioClass="";
                $audio=false;
            } else {
                $audio=true;
                $audioClass=" lyte-audio";
                $divHeight=38;
            }
            $NSimgHeight=$divHeight-20;
            if ($match[11]!="") {
                $plClass=" playlist";
                $vid=$match[11];
                switch ($lyteSettings['links']) {
                    case "0":
                        $noscript_post="".$noscript_post." 
";
                }
            } else if ($match[9]!="") {
                $plClass="";
                $vid=$match[9];
                switch ($lyteSettings['links']) {
                    case "0":
                        $noscript_post="
";
                        break;
                    default:
                        $noscript_post="";
                        $lytelinks_txt="";
                }
                $thumbUrl = $lyteSettings['scheme']."://i.ytimg.com/vi/".$vid."/0.jpg";
                if (get_option('lyte_local_thumb','0') === '1') {
                        $thumbUrl = plugins_url( 'lyteThumbs.php?origThumbUrl=' . urlencode($thumbUrl) , __FILE__   );
                }
                $noscript="' . $disclaimer . ' ';
            }
            
            if ( $disclaimer && empty( $lytelinks_txt ) ) {
                $lytelinks_txt = "".$diclaimer."
";
            } else if ( $disclaimer ) {
                $lytelinks_txt = str_replace('','";
            } else {
                $wrapper="
";
            }
            if ($doExcerpt) {
                $lytetemplate="";
                $templateType="excerpt";
            } elseif ($lyte_feed) {
                $postURL = get_permalink( $postID ); 
                $textLink = ($lyteSettings['links']===0)? "" : "
".strip_tags($lytelinks_txt, '
')." ".$textLink;
                $templateType="feed";
            } elseif (($audio !== true) && ( $plClass !== " playlist") && (($lyteSettings['microdata'] === "1")&&($noMicroData !== "1" ))) {
                $lytetemplate = $wrapper."
".$captionsMeta."
".$yt_resp_array["title"]."
".$noscript."
".$lytelinks_txt;
                $templateType="postMicrodata";
            } else {
                $lytetemplate = $wrapper."
";
                if (isset($yt_resp_array) && !empty($yt_resp_array) && !empty($yt_resp_array["title"])) {
                    $lytetemplate .= "
".$yt_resp_array['title']."
";
                }
                
                $lytetemplate .= "
".$noscript."
' . __('Settings') . ' ';
    return $links;
}
/** is_amp, but I shouldn't have to do this, should I? */
if (!function_exists("is_amp")) {
    function is_amp() {
        if ((strpos($_SERVER['REQUEST_URI'],'?amp')!==false) || (strpos($_SERVER['REQUEST_URI'],'/amp/')!==false)) {
            return true;
        } else {
            return false;
        }
    }
}
/** hooking it all up to wordpress */
if ( is_admin() ) {
    require_once(dirname(__FILE__).'/options.php');
    add_filter( 'plugin_action_links_' . plugin_basename(__FILE__), 'lyte_add_action_link' );
} else {
    add_filter('the_content', 'lyte_parse', 4);
    add_shortcode("lyte", "shortcode_lyte");
    remove_filter('get_the_excerpt', 'wp_trim_excerpt');
    add_filter('get_the_excerpt', 'lyte_trim_excerpt');
    add_action('schedule_captions_lookup', 'captions_lookup', 1, 3);
    /** API: action hook to allow extra actions or filters to be added */
    do_action("lyte_actionsfilters");
}
?>