Getting video playback with dialog images?

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
MadQuestion
Pro Scripter
Posts: 70
Joined: Wed Nov 08, 2017 6:54 pm

Getting video playback with dialog images?

Post by MadQuestion » Wed Nov 15, 2017 7:07 pm

SO I was experimenting with dialog images and image sequences I have a sequence of flying through clouds video render into image sequence in .jpg I created a dialog to hold the images and play each frame in the correct sequence. I get small issues like playing a wav and then continuing the script while the wav sound plays and also getting the speed of the image playback to be smoother but I think as video is not even a feature I did pretty well with my experiment. I have included the script I use below in case anyone has better tips or suggestions?

Code: Select all

Label>RESTARTVIDEOPLAYER
Dialog>Dialog1
object Dialog1: TForm
  Left = 247
  Top = 96
  HelpContext = 5000
  BorderIcons = [biSystemMenu]
  Caption = 'CustomDialog'
  ClientHeight = 562
  ClientWidth = 746
  Color = clBtnFace
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWindowText
  Font.Height = -11
  Font.Name = 'MS Sans Serif'
  Font.Style = []
  OldCreateOrder = True
  ShowHint = True
  OnTaskBar = False
  PixelsPerInch = 96
  TextHeight = 13
  object SCREENAREA: tMSImage
    Left = 8
    Top = 8
    Width = 729
    Height = 473
  end
  object PLAY_BUTTON: tMSButton
    Left = 8
    Top = 489
    Width = 201
    Height = 56
    Caption = 'PLAY'
    TabOrder = 0
    DoBrowse = False
    BrowseStyle = fbOpen
  end
  object RESET_BUTTON: tMSButton
    Left = 536
    Top = 489
    Width = 201
    Height = 56
    Caption = 'RESET'
    TabOrder = 1
    DoBrowse = False
    BrowseStyle = fbOpen
  end
  object PAUSE_BUTTON: tMSButton
    Left = 264
    Top = 489
    Width = 217
    Height = 56
    Caption = 'PAUSE'
    TabOrder = 2
    DoBrowse = False
    BrowseStyle = fbOpen
  end
  object LOADINGBAR: TProgressBar
    Left = 8
    Top = 464
    Width = 729
    Height = 17
    TabOrder = 3
  end
end
EndDialog>Dialog1
CountFiles>C:\Users\ClashBOT\Desktop\TEST_RENDER_SEQUENCE\*.*,nCount,0
ExportData>RENDER,C:\Users\ClashBOT\Desktop\TEST_RENDER_SEQUENCE\
SetDialogProperty>Dialog1,SCREENAREA,LoadImage,C:\Users\ClashBOT\Desktop\TEST_RENDER_SEQUENCE\Flying Through Clouds HD_ (1).jpg
SetDialogProperty>Dialog1,tMSImage,LoadBitmap,C:\Users\ClashBOT\Desktop\TEST_RENDER_SEQUENCE\Flying Through Clouds HD_ (1).jpg
AddDialogHandler>Dialog1,PLAY_BUTTON,OnClick,PLAYVIDEO
AddDialogHandler>Dialog1,PAUSE_BUTTON,OnClick,PAUSEVIDEO
AddDialogHandler>Dialog1,RESET_BUTTON,OnClick,RESETVIDEO
AddDialogHandler>Dialog1,,OnClose,DoClose
Show>Dialog1,res1

SRT>DoClose
  Exit>0
END>DoClose

SRT>PLAYVIDEO
//PlayWav>
//I thought playing a wave file would start playing the video with audio also but only plays the wav until end of the .wav and then moves to next line....
Let>FPS=6
Let>PLAYED=0
Let>COUNT=0
Repeat>PLAYED
  Let>PLAYED=PLAYED+1
  Let>COUNT=COUNT+%FPS%
  ExportData>RENDER%COUNT%,C:\Users\ClashBOT\Desktop\TEST_RENDER_SEQUENCE\
  SetDialogProperty>Dialog1,SCREENAREA,LoadImage,C:\Users\ClashBOT\Desktop\TEST_RENDER_SEQUENCE\Flying Through Clouds HD_ (%COUNT%).jpg
  SetDialogProperty>Dialog1,tMSImage,LoadBitmap,C:\Users\ClashBOT\Desktop\TEST_RENDER_SEQUENCE\Flying Through Clouds HD_ (%COUNT%).jpg
Until>PLAYED=%nCount%
END>PLAYVIDEO

SRT>UNPAUSEVIDEO
Let>PLAYED=%COUNT%
Let>COUNT=%COUNT%
Repeat>PLAYED
  Let>PLAYED=PLAYED+1
  Let>COUNT=COUNT+1
  ExportData>RENDER%COUNT%,C:\Users\ClashBOT\Desktop\TEST_RENDER_SEQUENCE\
  SetDialogProperty>Dialog1,SCREENAREA,LoadImage,C:\Users\ClashBOT\Desktop\TEST_RENDER_SEQUENCE\Flying Through Clouds HD_ (%COUNT%).jpg
  SetDialogProperty>Dialog1,tMSImage,LoadBitmap,C:\Users\ClashBOT\Desktop\TEST_RENDER_SEQUENCE\Flying Through Clouds HD_ (%COUNT%).jpg
Until>PLAYED=%nCount%
END>UNPAUSEVIDEO

SRT>PAUSEVIDEO
  CloseDialog>Dialog1
  AddDialogHandler>Dialog1,PAUSE_BUTTON,OnClick,UNPAUSEVIDEO
  Show>Dialog1,r1
  ExportData>RENDER%COUNT%,C:\Users\ClashBOT\Desktop\TEST_RENDER_SEQUENCE\
  SetDialogProperty>Dialog1,SCREENAREA,LoadImage,C:\Users\ClashBOT\Desktop\TEST_RENDER_SEQUENCE\Flying Through Clouds HD_ (%COUNT%).jpg
  SetDialogProperty>Dialog1,tMSImage,LoadBitmap,C:\Users\ClashBOT\Desktop\TEST_RENDER_SEQUENCE\Flying Through Clouds HD_ (%COUNT%).jpg
END>PAUSEVIDEO

SRT>RESETVIDEO
  Let>COUNT=0
  Show>Dialog1,r2
  ExportData>RENDER%COUNT%,C:\Users\ClashBOT\Desktop\TEST_RENDER_SEQUENCE\
  SetDialogProperty>Dialog1,SCREENAREA,LoadImage,C:\Users\ClashBOT\Desktop\TEST_RENDER_SEQUENCE\Flying Through Clouds HD_ (%COUNT%).jpg
  SetDialogProperty>Dialog1,tMSImage,LoadBitmap,C:\Users\ClashBOT\Desktop\TEST_RENDER_SEQUENCE\Flying Through Clouds HD_ (%COUNT%).jpg
END>RESETVIDEO
Is there any possible way to have a youtube video played from within a dialog? Is this something the HTML Viewer could be used for?

User avatar
Marcus Tettmar
Site Admin
Posts: 7378
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Re: Getting video playback with dialog images?

Post by Marcus Tettmar » Thu Nov 16, 2017 2:41 pm

You could embed an IE frame into your dialog and have youtube in that:
viewtopic.php?f=9&t=8243
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Post Reply
cron
Sign up to our newsletter for free automation tips, tricks & discounts