It is currently Wed Sep 18, 2019 7:18 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: PlayMovie
PostPosted: Thu Jul 18, 2019 10:50 pm 
Offline
New User
New User

Joined: Tue Dec 27, 2016 11:13 pm
Posts: 5
[5.71 Beta2 LTS (x32)] - Windows 10

Playmove does not work i only get a white window

PureBasic Version 5.51 (x32) is working, all versions higher than 5.51 will not work anymore

Code:
InitMovie()

OpenWindow(0, 0, 0, 400, 300, "A screen in a window...", #PB_Window_SizeGadget | #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
ButtonGadget(0, 170, 135, 45, 20, "Quit")
PanelGadget(1,5,5,390,290)
AddGadgetItem(1,-1,"2")
AddGadgetItem(1,0,"1")
CloseGadgetList()

LoadMovie(0,"test.wmv")
SetGadgetState(1,0)

Repeat
 Event = WaitWindowEvent()
    If Event=#PB_Event_Gadget
        Num =GetGadgetState(1)
        Result$ = GetGadgetItemText(1, Num,0)
        If Result$ = "2"
            If Movieflag = 0
                PlayMovie(0,GetTopWindow_(GadgetID(1)))
                ResizeMovie(0,0,(265-(MovieHeight(0)*384/MovieWidth(0)))/2,384,MovieHeight(0)*384/MovieWidth(0))
            Else
                ResumeMovie(0)
            EndIf
        ElseIf Result$ = "1"
            If IsMovie(0)
               PauseMovie(0)
               Movieflag = 1
            EndIf
        EndIf
    EndIf
Until Event = #PB_Event_CloseWindow


Top
 Profile  
Reply with quote  
 Post subject: Re: PlayMovie
PostPosted: Sun Aug 25, 2019 5:23 pm 
Offline
New User
New User

Joined: Sun Aug 18, 2019 8:07 pm
Posts: 5
Trion wrote:
[5.71 Beta2 LTS (x32)] - Windows 10

Playmove does not work i only get a white window

PureBasic Version 5.51 (x32) is working, all versions higher than 5.51 will not work anymore
gimp freejobalert notepad++
Code:
InitMovie()

OpenWindow(0, 0, 0, 400, 300, "A screen in a window...", #PB_Window_SizeGadget | #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
ButtonGadget(0, 170, 135, 45, 20, "Quit")
PanelGadget(1,5,5,390,290)
AddGadgetItem(1,-1,"2")
AddGadgetItem(1,0,"1")
CloseGadgetList()

LoadMovie(0,"test.wmv")
SetGadgetState(1,0)

Repeat
 Event = WaitWindowEvent()
    If Event=#PB_Event_Gadget
        Num =GetGadgetState(1)
        Result$ = GetGadgetItemText(1, Num,0)
        If Result$ = "2"
            If Movieflag = 0
                PlayMovie(0,GetTopWindow_(GadgetID(1)))
                ResizeMovie(0,0,(265-(MovieHeight(0)*384/MovieWidth(0)))/2,384,MovieHeight(0)*384/MovieWidth(0))
            Else
                ResumeMovie(0)
            EndIf
        ElseIf Result$ = "1"
            If IsMovie(0)
               PauseMovie(0)
               Movieflag = 1
            EndIf
        EndIf
    EndIf
Until Event = #PB_Event_CloseWindow

Facing same issue here too. Help is appreciated.

Thanks in advance.
Regards,
Oliver


Last edited by OliverS on Sun Sep 01, 2019 9:25 pm, edited 1 time in total.

Top
 Profile  
Reply with quote  
 Post subject: Re: PlayMovie
PostPosted: Mon Aug 26, 2019 8:56 am 
Offline
User
User

Joined: Fri Aug 04, 2017 11:03 pm
Posts: 74
Sorry for the earlier post. :oops:

Hope this isof any help.
Code:
InitMovie()
flg= #PB_Window_SizeGadget | #PB_Window_SystemMenu | #PB_Window_ScreenCentered
OpenWindow(0, 0, 0, 400, 300, "A screen in a window...",flg)
ButtonGadget(0, 170, 135, 45, 20, "Quit")
PanelGadget(1,5,5,390,290)
AddGadgetItem(1,-1,"2")
AddGadgetItem(1,0,"1")

ButtonGadget(16, 3, 14, 100, 20, "Open")
ButtonGadget(17, 3, 34, 100, 20, "Play")
ButtonGadget(18, 3, 56, 100, 20, "Pause")
CloseGadgetList()

LoadMovie(0,"carribean.wmv")
SetGadgetState(1,0)

Repeat
  Select WaitWindowEvent()
    Case #PB_Event_CloseWindow
      AppQuit = 1
     
    Case #PB_Event_Menu
      Select EventMenu()
      EndSelect

    Case #PB_Event_Gadget
      Select EventGadget()

    Case 16 ; "Open")
      MovieName$ = OpenFileRequester("Choose the movie to play", "", "Movie files|*.wmv|*.mp4|All Files|*.*", 0)
      LoadMovie(0, MovieName$)
   
     Case 17   ;Play
      SetGadgetState(1,1)
      If SetGadgetState(17,1)
           
      PlayMovie(0,GetTopWindow_(GadgetID(1)))
      ResizeMovie(0,0,(265-(MovieHeight(0)*384/MovieWidth(0)))/2,384,MovieHeight(0)*384/MovieWidth(0))
      Else
      ResumeMovie(0)
      EndIf
             
     Case 18 ;Pause
          If SetGadgetState(18,1)
           PauseMovie(0)
          Else
          ResumeMovie(0)
          EndIf
     EndSelect

  EndSelect
Until AppQuit


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye