Page 1 of 1

Play video in several Container Gadgets

Posted: Sun May 30, 2010 6:01 pm
by mcsalsa
Dear All,

I need to play several videos in the same window, one beside the other in rows, that is, a Video Selector.
One option will be the use of the ContainerGadget. I have been following a previous post in the forum: http://www.purebasic.fr/english/viewtop ... 13&t=39526

The problem is that I can create all ContainerGadgets... I can "hear" the Video but not see the video. Could someone give me an idea of what I am doing wrong?

Thanks in advance.

The code for the prototype is something like this:

Code: Select all

InitMovie()
hbox = GetSystemMetrics_(SM_CXSCREEN)
vbox = GetSystemMetrics_(SM_CYSCREEN)

mh=10:mv=20
margin=10:rows=2:cols=3
Dim wmdi.l(10)

;Loading videos
LoadMovie(0,"C:\temp\videos\vid1.wmv")
LoadMovie(1,"C:\temp\videos\vid1.wmv")
LoadMovie(2,"C:\temp\videos\vid1.wmv")
LoadMovie(3,"C:\temp\videos\vid1.wmv")
LoadMovie(4,"C:\temp\videos\vid1.wmv")
LoadMovie(5,"C:\temp\videos\vid1.wmv")


  
#Main = 0
If OpenWindow(#Main, 0, 0, hbox, vbox, "VideoSelector", #PB_Window_SystemMenu|#PB_Window_ScreenCentered|#PB_Window_SizeGadget|#PB_Window_MaximizeGadget)
  For i=0 To 5
    col=i%cols:fil=Int(i/cols)
    video_width=MovieWidth(i):video_height=MovieHeight(i)
    wmdi(i)=ContainerGadget(i,mh+(col*(video_width+margin)),mv+(fil*(video_height+margin)),video_width,video_height,#PB_Container_Raised)
    CloseGadgetList()
  Next i
  
  For i=0 To 5
    PlayMovie(i,wmdi(i))
    MovieAudio(i,50,0)
  Next i
  
  Repeat : Until WaitWindowEvent()=#PB_Event_CloseWindow

EndIf
I have also tried, with the result of just hearing but not seeing the video.

Code: Select all

  For i=0 To 5    
    col=i%cols:fil=Int(i/cols)
    video_width=MovieWidth(i):video_height=MovieHeight(i)
    PlayMovie(i,#Main)
    ResizeMovie(i,mh+(col*(video_width+margin)),mv+(fil*(video_height+margin)),video_width,video_height)
    MovieAudio(i,50,0)
  Next i

Re: Play video in several Container Gadgets

Posted: Mon May 31, 2010 5:53 pm
by Coolman
Windows 7 64 bit (32 bit purebasic)

it works, I recommend installing Win7codecs you find here:

http://shark007.net/win7codecs.html

It s one version winxp ...

for information, it seems that purebasic uses ffdshow...

*** Correction, it's strange, the same code does not work with 64 bit purebasic ***

8)

Re: Play video in several Container Gadgets

Posted: Mon May 31, 2010 6:10 pm
by Trond
Is there any reason you don't use a Frame3d gadget?

For me, all but the first videos play. But when I move the window, the first is shown as well.