2012-09-23 49 views
1

我有一個MVC應用程序,它是專爲JQM。MVC和Jquery移動與YouTube

但是,當我嵌入YouTube視頻時,出現以下錯誤。

This content cannot be displayed in a frame 
To help protect the security of information you enter into this website, the publisher of this content does not allow it to be displayed in a frame. 
What you can try: 
Open this content in a new window 

這是我的代碼;

<asp:Content ID="Content4" ContentPlaceHolderID="PositionImage" runat="server"> 
    <div class="videoPlayer" id="PlayerPanel"> 
     <embed enablejsapi=1 id="player1" width="300" src="http://youtu.be/_Nng-Ri4c2U" frameborder="0" allowscriptaccess="always" /> 
    </div> 
</asp:Content> 

回答

1

給這一個鏡頭:

<asp:Content ID="Content4" ContentPlaceHolderID="PositionImage" runat="server"> 
    <div class="videoPlayer" id="PlayerPanel"> 
     <iframe src="http://www.youtube.com/embed/_Nng-Ri4c2U" width="300" height="190"></iframe> 
    </div> 
</asp:Content> 

但不是用一個<embed />標籤,只需使用一個<iframe />代替。