首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >修复Ooyala的嵌入式视频代码

修复Ooyala的嵌入式视频代码
EN

Stack Overflow用户
提问于 2013-04-17 11:48:50
回答 1查看 2.5K关注 0票数 0

我正在使用自定义主题的Wordpress。

我有选择后的格式,如音频,视频,引用等。

当我选择我的帖子作为视频时,它显示了两个选项:视频URL,视频嵌入代码。

在视频嵌入代码,如果我把嵌入代码从Youtube,它工作。但主要的问题是我把我的视频上传到Ooyala.com上。当我从ooyala插入我的html嵌入代码时。它不显示视频,只显示代码。(无视频)

在浏览了我的主题代码后,我发现了这个代码,它将嵌入代码转换为

代码语言:javascript
复制
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得到的代码如下:

代码语言:javascript
复制
<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>

请帮帮我。

EN

回答 1

Stack Overflow用户

发布于 2013-04-17 12:18:12

尝试安装我们的Wordpress插件:http://wordpress.org/extend/plugins/ooyala-video-browser/

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/16051138

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档