我正在尝试将一些youtube视频加载到VB.net中的AxShockwave控件,但到目前为止它还没有加载
我尝试使用rlVideo.Movie =“...”和rlVideo.LoadMovie(0,“...”)(rlVideo是AxShockwave控件)
是的,网址是http://youtube.com/v/xxxxxx
我无法在设计师中设置电影属性,因为它会在应用程序中添加任何想法吗?
答案 0 :(得分:0)
已从设计器中删除Control,并在每次更改视频时创建控件的新实例 当然我删除了控件的前一个实例 例如
Dim prevControl() As Control = Me.Controls.Find("flashVideoPlayer", True)
Try
tbVideo.Controls.Remove(prevControl(0))
Catch ex As Exception
End Try
Dim video As AxShockwaveFlash = New AxShockwaveFlash()
video.Name = "flashVideoPlayer"
Dim strMovie As String = CType(ComboBox1.SelectedItem, ComboBoxItem).Value.ToString.Replace("watch?v=", "v/")
video.Anchor = AnchorStyles.Bottom Or AnchorStyles.Left Or AnchorStyles.Right Or AnchorStyles.Top
video.Location = New Point(0, 27)
video.Size = New Size(tbVideo.Width, tbVideo.Height - 27)
tbVideo.Controls.Add(video)
video.LoadMovie(0, strMovie)