3

I have a website which contains youtube flash player. Player's code was copied from Youtube and pasted to an HTML of my page.

When I'm opening the page in iPhone or iPad, the player can't be covered by absolute positioned DIV tag. The div tag has z-index 1000 and covers all elements (youtube flash player too) on the page if I use normal PC. But in iPhone or iPad I can't cover youtube player by this div element.

I used many tricks with OBJECT and EMBED tags of flash element (adding style="position:absolute; z-index:0" and etc.) but no results.

Please assist how can I cover Flash element in iPhone or iPad.

Evgeniy
  • 31
  • 2
  • 1
    This may be what you're looking for - a Flash object needs a special parameter to show HTML over it: http://stackoverflow.com/questions/1551183/javascript-dialog-over-a-flash-movie/1580638#1580638 – Piskvor left the building Feb 04 '11 at 13:44
  • Does changing the wmode value help? oops, Piskvor said the same thing. :) – mark123 Feb 04 '11 at 13:45
  • 2
    It's probably a violation of youtube's TOS to try to obscure parts of the screen, because you could be obscuring their branding and advertising. – Paul Tomblin Feb 04 '11 at 13:50
  • It is possible, but why it works for usual Firefox or any other browser on PC? – Evgeniy Feb 04 '11 at 13:56
  • The YouTube player in Safari on iPhone and iPad is not your Flash player, it is replaced by the included YouTube player. So I doubt setting `wmode` will help. Can you explore the DOM to see whether this player is included, or is it added as an overlay to the whole page? – Jan Fabry Feb 04 '11 at 14:04
  • @Evgeniy What you describe as a "PC browser" is probably a web browser with Flash. HTML5 video (the only option for iPhone/iPad, where *Flash is unsupported*) works completely different; and are ignored. Here's a short demo with overlayed youtube HTML5 video: http://phihag.de/2011/so/z-index.html – phihag Feb 04 '11 at 14:05
  • 1
    Yes, you right Jan! wmode does not work. Thank you for suggestion! I'll try to do this. – Evgeniy Feb 04 '11 at 14:07
  • 2
    @phihag thank you! Nice trick with iframe! I tried to open your page in iPad and it works. Interesting solution! ;) – Evgeniy Feb 04 '11 at 14:15

2 Answers2

0

You just had to add ?wmode=transparent at the end of the url of the youtube embed code to fix the problem.

It should work!

Jon Lin
  • 142,182
  • 29
  • 220
  • 220
Luc
  • 194
  • 2
  • 4
0

please use an iframe. That's the way I've done it. I found that on the iphone there are certain things that dont work but will work on a pc. I believe however Iframes are quite versatile with stuff.

Try it out. Let me know if it works.

Cody Gray - on strike
  • 239,200
  • 50
  • 490
  • 574
Pavan
  • 17,840
  • 8
  • 59
  • 100