YouTube iFrame API hangs in buffering state after the playVideo() command on iPad

本小妞迷上赌 提交于 2019-12-04 09:22:01

问题


I have a problem with the iFrame API on the iPad (iOS 7, Safari browser). When I try to start the video with the 'player.playVideo()' command, the player goes to black and returns a '3'-state when I call 'player.getPlayerState()' command (says it's buffering).

Hitting the big red YouTube button works, but using the 'playVideo()' command does not. This can be reproduced on Google's own YouTube API demo page: https://developers.google.com/youtube/youtube_player_demo

Make sure you display an iFrame, and hit the blue 'Play' button below the player. On desktop browsers, this works fine, but fails on an iOS7 iPad.

I need the 'playVideo()' command to control a chromeless player (no controls). Any ideas?


回答1:


Try the autoplay feature if hitting the big red button is not a compulsion, i have done so by adding "event.target.playVideo();" to the onReady function in the embeded HTML body. My player shows the big red button and starts itself immediately. I have used the latest ios helper availble on GitHub youtube-ios-player-helper. It is also mentioned on the google developers site Using the YouTube Helper Library to embed YouTube videos in your iOS application



来源:https://stackoverflow.com/questions/23741332/youtube-iframe-api-hangs-in-buffering-state-after-the-playvideo-command-on-ipa

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!