워드프레스에서 기본 제공되지 않는 업체의 임베디드 추가
아래는 https://midibus.kinxcdn.com/ 의 임베디드 샘플 입니다.
javascript 는 Divi 테마에서 임베디드 된 영상의 사이즈를 반응형으로 동작하도록 할수 있습니다.
function add_embed_midibus(){ global $wp_embed; wp_embed_register_handler( 'midibus', '#https?://play\.mbus\.tv/hls/([^/]+)#i', // <-- Adjust this to your needs! 'midibus_embed_handler' ); } add_action( 'init', 'add_embed_midibus' ); function midibus_embed_handler( $matches, $attr, $url, $rawattr ){ $embed = sprintf( "<iframe src='https://play.mbus.tv/hls/%s' width='1080' height='608' frameborder='0' allowfullscreen></iframe>", esc_attr( $matches[1] ) ); return apply_filters( 'midibus_embed_handler', $embed, $matches, $attr, $url, $rawattr ); }
(function ($) { $(document).ready(function () { $(window).ready(function () { if ($.fn.fitVids) { $('#main-content').fitVids({ customSelector: "iframe[src*='play.mbus.tv']" }); } }); }) })(jQuery);
0개의 댓글