我正在尝试在我的页面上嵌入视频,具体取决于用户在看到列表后选择的视频。在我的页面上,我有:
<div id="vidContent" style="text-align:left">
<object width="550px" height="350px" >
<asp:Literal ID="ltlVideo" runat="server"></asp:Literal>
</object>
</div>
在我背后的代码中:
Dim strVidPath As String = "http://www.youtube.com/v/" & strVidID
ltlVideo.Text = "<embed src='" & strVidPath & "' type='application/x-shockwave-flash' allowscriptaccess='always' allowfullscreen='true' height='350' width='470'></embed>
phVideoBanner.Visible = True
..
这工作正常...如果你有“strVidID”
如果您有 strVidPath = www.youtube.com/v/_O7iUiftbKU,它似乎只会显示和播放
但如果 strVidPath = www.youtube.com/watch?v=_O7iUiftbKU ....这似乎是观看 youtube 视频时地址栏中的正常 URL,则不播放。
我希望用户能够将视频添加到页面,我想如果粘贴到视频的 URL 中会更容易,但现在看来我必须让他们粘贴到 videoID 中,而不是似乎只有在我使用 www.youtube.com/v/_O7iUiftbKU 时才能播放
有谁知道这是为什么?