Youtube embed videos not playing
So I've been trying to embed Youtube vi开发者_StackOverflow中文版deos inside my phonegap Android app using the new youtube iframe API. The embed itself working and a youtube window pops in with the preview picture and the play button in the centre. The problem is when I click the button to start streaming the video the embed doesn't play the video - just loads the preview picture in and does nothing. The code used is below if it helps.
<iframe title="YouTube video player" class="youtube-player" type="text/html" width="320" height="194" src="http://www.youtube.com/embed/xxxxxxxx" frameborder="0"></iframe>
It works great inside a browser, but not inside the app so far. Maybe it's a Phonegap issue? Any insight would be appreciated.
Thanks.
The solution for me was to set a Uses Permission of android.permission.WAKE_LOCK in the Android Manifest file.
Given that you are using phonegap, you will have to investigate how that framework allows you to manipulate Uses Permissions.
精彩评论