Play video in several Container Gadgets

Just starting out? Need help? Post your questions and find answers here.
mcsalsa
User
User
Posts: 17
Joined: Thu Sep 28, 2006 1:20 pm

Play video in several Container Gadgets

Post 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
Coolman
Enthusiast
Enthusiast
Posts: 103
Joined: Sat Sep 03, 2005 4:07 pm

Re: Play video in several Container Gadgets

Post 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)
Last edited by Coolman on Mon May 31, 2010 6:11 pm, edited 1 time in total.
*** Excuse my bad English, I uses has translating program ***
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Re: Play video in several Container Gadgets

Post 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.
Post Reply