Moving a built-in youtube iframe to dom using jquery makes fullscreen not work in Windows8 IE10

I am trying to move the contents of one div and add it to another div. The div I'm moving includes a built-in iframe iframe. When I try to press the full screen button after the div has been moved, the video is reset instead of continuing to play in full screen. The same problem occurs if I move the iframe itself to another location.

Here is an example:

$(iframes).each(function() { $('.tab_content').append($(this)); }); 

After moving the embedded frames in Windows 8 IE10, I can’t watch the video in full screen.

Rebooting the iframe also does not seem to fix the error:

 $('iframe').each(function() { var src = $(this).attr('src'); $(this).attr('src', ''); $(this).attr('src', src); }); 
+6
source share
2 answers

you can use this method.

 $('iframe').each(function() { $('.tab_content').append($(this).prop('outerHTML')); $(this).remove(); }); 

Hooray!

+4
source

What if you clone an iframe?

 $(iframes).each(function() { $('.tab_content').append($(this).clone()); }); 
0
source

Source: https://habr.com/ru/post/952544/


All Articles