Mijail
Mijail

Reputation: 186

Can't Play iFrame embedded YouTube video on iPad

I'm developing an iOS iPad app with an embedded YouTube video.

I'm having issues when the user tries to play the video touching the red square play image from YouTube, it seems that pressing that image won't trigger the play action. However, touching anywhere outside the red square play button works.

I've tested it with the iPad user agent with same results.

When embedding with controls:0 it seems that the action triggers perfectly, but I need the default controls.

Is there anyway to keep controls:1 and detect that touch to successfully play the video?

Upvotes: 1

Views: 1267

Answers (1)

youshea
youshea

Reputation: 154

Try playing the video itself when it is loaded. If hitting the big red button is not a compulsion add "event.target.playVideo();" to the onReady function in the embeded HTML body. I have done so and the player in my application shows the big red button and starts the video itself immediately. I have used the following YouTube iFrame library youtube-ios-player-helper

Upvotes: 2

Related Questions