0
votes

See http://jsfiddle.net/rCGSB/4/.

Using the seekTo method from the YouTube iframe api does not work in mobile Safari under iOS 6 using an iPad 3.

The video just starts playing at the beginning. Once the video is playing, the seekTo method works. However, as stated in https://developers.google.com/youtube/iframe_api_reference#Playback_controls for the seekTo method:

"Seeks to a specified time in the video. If the player is paused when the function is called, it will remain paused. If the function is called from another state (playing, video cued, etc.), the player will play the video."

So, the video should start playing at the specified time even if it's not playing. And since I am interacting with a click, the disabled autoplay under mobile Safari should not be the problem.

It works fine on all desktop browsers I tested (FF, Safari, Chrome under Mac OS).

Does this work at all under iOS? Feel free to edit and update the fiddle.

1

1 Answers

2
votes

Being able to playback from a certain point in time in a YouTube video is something I've been interested in for a long time.

I've found that this bit of iframe-based markup works, at least on iOS 6:

<iframe width="480" height="270" src="http://www.youtube.com/embed/n1-OKPmQyh4?fs=1&feature=oembed&start=533" frameborder="0" allowfullscreen="1"></iframe>

The trick is the "start" parameter in the URL you're using for the iframe

I've also wanted the "autoplay" parameter to work, but from my understanding Apple prevents that from happening so as to avoid excess data charges for users viewing web content.