2014-10-03 43 views
1

我在我的index.html文件中嵌入了一個YouTube視頻。Android手機上的混合應用程序的iframe視頻

<iframe id="video" width="640" height="360" src="//www.youtube.com/embed/xxxxxxxxx?rel=0&amp;controls=0&amp;showinfo=0" frameborder="0" allowfullscreen></iframe> 
  • 我通過CMD創建的應用程序與科爾多瓦的PhoneGap這樣的:

    cordova create hello com.example.hello HelloWorld 
    
  • 在app文件夾取代了我的HTML,CSS,JS文件。

  • 新增Android平臺:

    cordova platform add android 
    
  • 打開Eclipse中,進口的應用程序,並運行它。

  • 我將.apk放在我的平板電腦上,一切正常,但視頻無法正常工作。

    我得到錯誤「網頁不可用」而不是視頻。

我該如何解決這個問題?

回答

1

解決。

我只是簡單地添加HTTP:在鏈路上的SRC屬性

<iframe id="video" width="640" height="360" src="HTTP://www.youtube.com/embed/xxxxxxxxx?rel=0&amp;controls=0&amp;showinfo=0" frameborder="0" allowfullscreen></iframe>