Page 1 of 1

Problem when changing source file

Posted: Mon Sep 25, 2006 9:10 am
by Dnx
Hi,

i have a little problem

i use the beginInvoke with 2 sub (one calling the Sub Sync)
it works nicely, the player is "linked" to a datagridview
when i click on a row, it plays the selected file, but when i click on the same row, sometimes the player doesn't play the selected file (link)
or sometimes when i click on a row, a process convert some files in SWF format and detect when it is finished, so when it is done, i call the flash player to play the new file, sometimes it plays, sometimes not...

Code: Select all

 Private Sub PlayMovie(ByVal SrcFile As String)
       
        If Not (System.Threading.Thread.CurrentThread.ManagedThreadId = mainThreadID) Then

            Dim del As New SyncDelegateMovie(AddressOf PlayMovieSync)
            Me.FlashPlayer.BeginInvoke(del, New Object() {SrcFile})
        Else
            Me.PlayMovieSync(SrcFile)
        End If

    End Sub

    Private Sub PlayMovieSync(ByVal SrcFile As String)
        With Me.FlashPlayer
            .FlashProperty_Movie = SrcFile
            .Visible = True
            .FlashMethod_Rewind()
            .FlashProperty_Loop = 0
            .FlashProperty_Quality = 1
            .FlashMethod_Play()
        End With
    End Sub


Re: Problem when changing source file

Posted: Mon Sep 25, 2006 9:27 am
by Softanics
I can suggest you the following modification:

Code: Select all

        With Me.FlashPlayer
            .FlashProperty_Movie = "_none_" ' <-- add this line
            .FlashProperty_Movie = SrcFile

Posted: Mon Sep 25, 2006 9:52 am
by Dnx
now i see the video loaded on the player but i have the same problem sometimes it start to play sometimes not...
i have to click again on the row to play the movie, i don't know what happen...

regards

Posted: Mon Sep 25, 2006 3:07 pm
by Softanics
Do you forget to call EndEnvoke after BeginInvoke?...