我正在使用自定义主题的Wordpress。
我有选择后的格式,如音频,视频,引用等。
当我选择我的帖子作为视频时,它显示了两个选项:视频URL,视频嵌入代码。
在视频嵌入代码,如果我把嵌入代码从Youtube,它工作。但主要的问题是我把我的视频上传到Ooyala.com上。当我从ooyala插入我的html嵌入代码时。它不显示视频,只显示代码。(无视频)
在浏览了我的主题代码后,我发现了这个代码,它将嵌入代码转换为
function wpbandit_video_wmode_transparent($html, $url, $attr) {
if ( strpos( $html, "<embed src=" ) !== false ) {
$html = str_replace('</param><embed', '</param><param name="wmode" value="opaque"></param><embed wmode="opaque" ', $html);
} elseif ( strpos ($html, 'feature=oembed') !== false ) {
$html = str_replace('feature=oembed', 'feature=oembed&wmode=opaque', $html);
}
return $html;
}
add_filter('embed_oembed_html','wpbandit_video_wmode_transparent',10,3);
/**
Add container to default video embeds
**/
function wpbandit_embed_oembed_html($html, $url, $attr, $post_id) {
return '<div class="video-container">' . $html . '</div>';
}
add_filter('embed_oembed_html', 'wpbandit_embed_oembed_html', 99, 4);作为我的视频嵌入代码,我从ooyala得到的代码如下:
<script src='https://player.ooyala.com/v3/84b6e4bac6d945439a38bdfff895a0fd'></script> <div id='ooyalaplayer' style='width:1280px;height:720px'></div><script>OO.ready(function() { OO.Player.create('ooyalaplayer', 'N5MG1rYTpsId-Q4ZlUy1JEykqD5QMWEN'); });</script><noscript> <div>Please enable Javascript to watch this video</div></noscript>请帮帮我。
发布于 2013-04-17 12:18:12
尝试安装我们的Wordpress插件:http://wordpress.org/extend/plugins/ooyala-video-browser/
https://stackoverflow.com/questions/16051138
复制相似问题