Cannot get jPlayer to load and autoplay on iPad on a "touch" event

171 views
Skip to first unread message

Greg

unread,
Dec 3, 2012, 5:45:07 PM12/3/12
to jpl...@googlegroups.com
I am developing a plugin where when you hover or tap on sections of a page, a jPlayer video relevant to that section loads and plays.  The autoplay function is not working on the iPad.  I believe that this is because in order to play, I have to wait for jPlayer's "ready", which is apparently a callback, or I have to build a setTimeout to poll for "ready", which is also a callback.  The callbacks prevent this from being a user initiated action.  Is there some option built in to jPlayer by which I can generate a synchronous "ready", so that I do not have to use a callback and I can successfully perform a load and autoplay?

The nature of this plugin is that I cannot pre-load the player on pageload, so that is not an option for me.

Alex

unread,
Dec 5, 2012, 6:00:49 AM12/5/12
to jpl...@googlegroups.com
http://jplayer.org/latest/developer-guide/#jPlayer-known-issues
Under the "Event Driven Mobile Browsers" header.

Greg

unread,
Dec 5, 2012, 1:41:03 PM12/5/12
to jpl...@googlegroups.com
Yes, but the required user gesture is the tap on the section to load and play.  This is supposed to be allowed by by iOS, since it is user driven, but a callback is computer driven and breaks the chain of events generated by the user.

Greg

unread,
Dec 6, 2012, 11:45:49 AM12/6/12
to jpl...@googlegroups.com
I have come up with a simple solution.  I deliver a play command directly to the video element in touch devices, bypassing jPlayer, and there is no dependency on the ready event.  Now what I'm hoping is that this does not get the video player out of sync with any of your tracking variables.
Reply all
Reply to author
Forward
0 new messages