vimeo embed showing black screen on firefox?

夙愿已清 提交于 2019-12-08 12:53:41

rob.m - yup, showing and hiding vimeo videos will cause that random black screen to appear. I JUST ran into this on a project, and tore my hair out for the better part of a day figuring out why.

If you NEED to show/hide videos, and you NEED the black screen to not show up, you will have to use the old school flash embed. That will work.

It's a trade off - consistent embed images = flash OR inconsistent embed images = universal method (read: HTML5 w/ flash fallback).

[Brief rant: the Vimeo API documentation leaves a LOT to be desired]

If you need to further interact with these videos that you show/hide, and plan to use the Vimeo API to do so, I found that I had to use the SWFobjects library method. See this forum post for more: http://vimeo.com/forums/topic:44521 - specifically, the second to last post.

Eventually i came up with using this:

In the main page I have a element which i then populate and replace with the iframe. Thanks

Main page:

<span class="video clearfix" data-vimeoid="<?php echo the_field('vimeo') ?>"></span>

Content page to be loaded:

var url = this.href + " .content";
var videoSpan = infoBox.find("span.video");
var iframe = $('<iframe/>', {

        'frameborder' : 0,

        'width' : '692',

        'height' : '389',

        'src' : 'http://player.vimeo.com/video/'+ videoSpan.data("vimeoid") +'?autoplay=0&api=1'

});

videoSpan.replaceWith(iframe);
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!