Mike
Mike

Reputation: 4075

YouTube video in page embeded in iframe not working in Firefox

I assume this is a bug in Firefox, but just thought I would check here.

I have an iframe on my web page that contains a page that contains an embedded you tube player (inside an iframe). This works OK in Firefox.

However, when I add the following CSS rule:

iframe {
  transform: scale(0.75, 0.75);
  -moz-transform: scale(.75, .75);
  -webkit-transform: scale(.75, .75);
  -o-transform: scale(.75, .75);
  -ms-transform: scale(.75, .75);
}

to the outer iframe, the YouTube video stops working in Firefox only. It works in Chrome, Opera and Safari.

Is this a Firefox bug?

Here is a JSFiddle example http://jsfiddle.net/6C65Y/28/

Upvotes: 1

Views: 1566

Answers (1)

MyBoon
MyBoon

Reputation: 1298

It seems that firefox doesn't manages CSS scale on iframe.

This code will work :

var previewFrame = document.getElementById('test');
var preview =  previewFrame.contentDocument ||  previewFrame.contentWindow.document;
preview.open();

var code = '<!doctype html><title>Test</title><h1>YouTube video</h1><iframe src="http://www.youtube.com/embed/64qx95Ckrwc" width="75%" height="75%"></iframe>';

preview.write(code);
preview.close();

Upvotes: 1

Related Questions