Mobile Safari Youtube opened via javascript

Posted by Squeegy on Stack Overflow See other posts from Stack Overflow or by Squeegy
Published on 2010-04-06T21:58:19Z Indexed on 2010/04/06 22:13 UTC
Read the original article Hit count: 265

We have a youtube player embedded in a plage in Mobile Safari and it works great. But we need to be able to launch the youtube player by a means other than user tapping the video itself, for various reasons.

So I am trying to figure out what event to trigger in javascript to make it happen with no luck. None of the following appear to work.

var vid = document.getElementById('vid');
vid.click();
vid.onclick();
vid.ontouchend();
vid.ontouchstart();
vid.focus();

I tried to find an event handler added to the embedded object with this snippet, but didn't find anything.

for (var key in vid) {
  if (typeof vid[key] == 'function') console.log(key +': '+ vid[key]);
}

Is this just so wrapped up in a custom plugin there is no way?

© Stack Overflow or respective owner

Related posts about mobilesafari

Related posts about JavaScript