[Gambas-user] Embedding VLC movie window immediately... without a 2 second pause

Lee McPherson leemcpherson at ...626...
Wed Mar 26 00:49:19 CET 2008


I have the basic code to embed a VLC movie window into a gambas app, 
however, there is an annoying 2 second pause before the window finally 
becomes embedded.  The movie will actually start playing for a couple of 
seconds in a separate window before it gets embedded.  I'm not sure if 
it's a limitation of VLC or something else but I'm trying to figure out
how to stop this.  Here is the basic code I'm using (borrowed from 
another user) :

PUBLIC SUB Presence_Embed(windowTitle AS String)
  DIM key AS Integer
  key = WindowClasses.getWindowID(windowTitle)
  IF key > 0 THEN
  Embedder1.Embed(key)
  Embedder1.SetFocus
  ENDIF
  Embedder1.Visible = TRUE
END

PUBLIC SUB Form_Open()

  DIM iWindowInfoArray AS Integer
  $MplayerProc = EXEC ["/usr/bin/vlc", "-I", "rc"] FOR INPUT OUTPUT AS 
"$mplayerproc"   'starts vlc command line in a process
  PRINT #$mplayerproc, "add /home/lee/nip.avi"    'adds a sample movie 
to the playlist and starts it
  Presence_Embed("VLC (X11 output)")

END





More information about the User mailing list