The youtube player's play button works fine, but my custom play button does not work.
** EDIT **
The current JSFiddle now works fine on a pc/mac, but not on an iPad.
** EDIT 2 **
iframed youtube w/external play button
** EDIT 3 **
The youtube player's play button works fine, but my custom play button does not work.
** EDIT **
The current JSFiddle now works fine on a pc/mac, but not on an iPad.
** EDIT 2 **
iframed youtube w/external play button
** EDIT 3 **
Try this:
however i would recommend to use something like swfobject to embed the video.
https://developers.google.com/youtube/js_api_reference#Embedding
For whatever reason, limitations are in place. This does not work if you are on an ipad in html5. My jsfiddle does, however, work for desktop browsers.
Please post back if you've gotten this to work for ipad and I'll re-mark you as the answer.
I just had this problem too I decided to give HTML5 a try and it worked. The only problem is that you will have to host the videos on your host.
(Works on iPad) http://www.w3schools.com/html/tryit.asp?filename=tryhtml5_video_js_prop
Every Youtube embedded player contains a player id that is in the form of :
player_uid_\d+_1
like - player_uid_271874942_1
So just do a regex search
for player_uid_\d+_1
in the page source
and add following js to anything you want :
var player = document.getElementById(playerId);
//playerId id the matched string from regex search in page-source
player.playVideo();
Other actions related to above player variable can be found here.