2013-04-17 64 views
0

我使用Wordpress与自定义建的主题。修复嵌入视频代码的Ooyala

我有选择,选择后的格式,如音频,视频,报价等

当我选择我的帖子的视频,它显示了两个选项视频网址,视频嵌入代码。

在视频嵌入代码,如果我把嵌入代码从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> 

请帮助我。

回答

相关问题