AxShockwave not loading movies

347 Views Asked by At

I'm trying to load some youtube videos to a AxShockwave control in VB.net but so far it does not load

I've tryed to use rlVideo.Movie = "..." and rlVideo.LoadMovie(0,"...") (rlVideo being the AxShockwave control)

And yes the url is http://youtube.com/v/xxxxxx

I can't set the movie property in the designer because It's dinamically loaded onto the app any ideas?

1

There are 1 best solutions below

0
On

I've removed the Control from the designer and create a new instace of the control every time I change the video Of course I delete the previous instance of the Control For example

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)