Drag & Drop - Video / Audio / Photo / GIF / Text and PLAY

Post your working scripts, libraries and tools
garry
Posts: 1505
Joined: 22 Dec 2013, 12:50

Drag & Drop - Video / Audio / Photo / GIF / Text and PLAY

09 Feb 2018, 09:44

Example with ActiveX / IE / Firefox / Videolan
( maybe play depending browser settings )

Code: Select all

modified =20180208
;created =20140630

;- ActiveX example
;- drag & drop video/audio/picture/text-files    and snapshot with vlc
;- XP / netbook / Mozilla-Firefox / videolan /
;--------------------------------------------------------------------------
#warn
#NoEnv
SetWorkingDir %A_ScriptDir%
SetTitleMatchMode 2
SetBatchLines, -1
Sendmode,input
ch1:=""

filename1=VideoPlay_Drag&Drop Video/Audio-Files here_%modified%  -- for TXT AHK GIF  use without VLC
vlc1     =%a_programfiles%\videolan\vlc\vlc.exe

Gui,2: Color,Black
Gui,2:Font,CDefault , FixedSys

h1=550
w1=1080
h2=610
w2=1100


ifexist,%vlc1%
{
FC1=%a_scriptdir%\checkboxtest.ini
ifnotexist,%fc1%
  IniWrite, 1, %fc1%, ss, Cb1
IniRead, Ch1, %fc1%, ss, Cb1 , 0
If (Ch1 = 1)
       Cb1 = Checked
    Else
       Cb1 =
Gui,2: Add, CheckBox, x150  y570   w130  vCh1 %cb1% cGray gRel,VLC
}

Gui,2:Add,Edit,    x10 y10 h0 w0 vF1,

;Gui,2:Add,ActiveX, x10 y10 w%w1% h%h1% vWB1, Shell.Explorer    ;- not works

if ch1
   Gui,2:Add,ActiveX, x10 y10 w%w1% h%h1% vWB1, VideoLAN.VLCPlugin.2
else
   Gui,2:Add,ActiveX, x10 y10 w%w1% h%h1% vWB1 ,Mozilla.Browser    ;- Firefox ok

if ch1
 Gui,2:add,button , x10 y570 w100 h27 gSnapshot vSnap,PrintScreen

Gui,2: Show,x0 y0 w%w2% h%h2%,%filename1%
if ch1
  GuiControl,2:Enable,Snap
else
  GuiControl,2:Disable,Snap
return
;-----------------------------------------------------

2Guiclose:
Gui,2: Submit
ifexist,%vlc1%
 IniWrite, %Ch1%, %fc1%, ss, Cb1
exitapp
;-----

rel:
Gui,2: Submit
ifexist,%vlc1%
 IniWrite, %Ch1%, %fc1%, ss, Cb1
reload
return

2GuiDropFiles:
Loop, parse, A_GuiEvent, `n
   GuiControl,2:,F1,%A_LoopField%
gosub,mh3
return


SNAPSHOT:
;- rename saved picture bmp to png
if ch1
  wb1.video.takeSnapshot()
return


mh3:
Gui,2:submit,nohide
F1=%f1%
f1:=f1

if ch1
  Extx:= "flv,mp4,vob,wma,avi,mp3,m4a,jpg,png,ico,bmp,ahk,ahl,avi,mpg"               ;- VLC
else
  Extx := "flv,mp4,vob,avi,wma,mp3,jpg,png,ico,bmp,txt,ini,ahk,bas,bat,avi,mpg,gif"  ;- txt/gif not for vlc

SplitPath,F1,name, dir, ext, name_no_ext, drive
if ext in %extx%
 {
 Fx:="file:///" RegExReplace(F1,"\\","/")
 if ch1
    {
    wb1.playlist.stop()
    wb1.playlist.items.clear()
    wb1.playlist.add(fx,"","""""")
    wb1.playlist.next()
    }
   else
    WB1.Navigate(Fx)
 return
 }
return
;============= end script =======================

Return to “Scripts and Functions”

Who is online

Users browsing this forum: No registered users and 42 guests