Youtube_Play ActiveX

Compartilhe seus scripts, funções, ferramentas e programas

Moderator: Gio

garry
Posts: 3758
Joined: 22 Dec 2013, 12:50

Youtube_Play ActiveX

31 Dec 2018, 15:48

EDIT script changed 20200425

Code: Select all

;- Youtube_Play ActiveX 
;- https://www.autohotkey.com/boards/viewtopic.php?f=70&t=60536

;- modified = 20200425
;- created  = 20181231
;- ActiveX example for YOUTUBE
;- Play Youtube-Video ( if allowed to embed )
;- https://www.autohotkey.com/boards/viewtopic.php?f=6&t=74482   ;- play youtube
;- https://www.autohotkey.com/boards/viewtopic.php?f=6&t=74484   ;- play video with vlc.exe
;------------------------------------------------------
setworkingdir,%a_scriptdir%
Filename1=Youtube-Play    ;- only videos allowed for embed
Gui,2:default
Gui,2:-border
GUI,2:Font,s14 cGray,Lucida Console
Gui,2: -DPIScale
Gui,2: Color, Black,Black 
id1=sraZaL6jylM;Lilian de Celis-El Relicario
stringsplit,c,id1,`;
url=https://www.youtube.com/embed/%c1%?autoplay=1
fp:="https://i.imgur.com/QiLP9qz.jpg"
pict=%a_scriptdir%\relicario_text.jpg
ifnotexist,%pict%
  urldownloadtofile,%fp%,%pict%
wa:=A_screenwidth
ha:=A_screenHeight
xx:=101
LW:=(wa*88)/xx,LH:=(ha*88)/xx,wm:=(wa*88.7)/xx,hm:=(ha*90)/xx,GW:=(wa*99.5)/xx,GH:=(ha*96)/xx  
x1:=(wa*1.5)/xx,y1:=(ha*2)/xx,x2:=(wa*1.2)/xx,y2:=(ha*1)/xx
;----------------
xxb=Shell.Explorer     ;- IExplorer
;xxb=Mozilla.Browser    ;- Mozilla Firefox
;-- picture -----
xp:=(wa*90.3)/xx,yp:=(ha* 1.8)/xx,wp:=(wa* 8.4)/xx,hp:=(ha*88.9)/xx
;----------------
Gui,2:Add,ActiveX, x%x1% y%y1% w%lw%  h%lh% vWB,%xxb%
;wb.Visible := true 
WB.Silent  := True
WB.Navigate(URL)
Gui,2:Add,Picture, x%xp% y%yp% w%wp%  h%hp% ,%pict%
Gui,2:add,GroupBox,x%x2% y%y2% w%WM% h%HM%
x:=(wa*30)/xx,y:=(ha*92)/xx,w:=(wa*5)/xx,h:=(ha*2.5)/xx  
;Gui,2:add,button,x%x% y%y% w%w% h%h%,GO
Gui,2:Add,Edit,x%x2% y%y% vURL, %url%
Gui,2:Show,x0 y0 w%gw% h%gh%,%filename1%
return
;----------------
2Guiescape:
2Guiclose:
WB.Document.close
WB := ""
exitapp
esc::exitapp
;======================= END SCRIPT YOUTUBE PLAY / BROWSER =========


1-st example NOT WORKS with VLC.exe
;- ActiveX example for videolan (vlc.exe)
;- Play Youtube-Video ( if allowed to embed )

Code: Select all

;- modified = 20190106  - added 2nd letras
;- created  = 20181231
;- ActiveX example for videolan (vlc.exe)
;- Play Youtube-Video ( if allowed to embed )
;------------------------------------------------------
setworkingdir,%a_scriptdir%
Filename1=VLCPlugin_Youtube-Play    ;- only videos allowed for embed
Gui,2:default
Gui,2:-border
Gui,2: -DPIScale
Gui,2: Color, Black,Black 

;id1=iCKMzrPy4t4;aquela janela virada pro mar
;id1=_b9R_x_imBM;ROMANIA Drumul Transfăgărășan 
id1=9KrYzzpHgrY;Dia da espiga / A Rua dos Meus Ciúmes - Anabela
;id1=sraZaL6jylM;Lilian de Celis-El Relicario
stringsplit,c,id1,`;
F1=https://www.youtube.com/watch?v=%c1%
gosub,text1

wa:=A_screenwidth
ha:=A_screenHeight
xx:=101
LW:=(wa*88)/xx ,LH:=(ha*88)/xx,wm:=(wa*88.7)/xx,hm:=(ha*90)/xx,GW:=(wa*99.5)/xx,GH:=(ha*96)/xx  
x1:=(wa*1.5)/xx,y1:=(ha*2) /xx,x2:=(wa*1.2) /xx,y2:=(ha*1) /xx
;vlc1        =%A_programfiles%\VideoLAN\VLC\vlc.exe    ;- check path for vlc.exe
;xxa=Shell.Explorer     ;- IExplorer
;xxa=Mozilla.Browser    ;- Mozilla Firefox
xxb=VideoLAN.VLCPlugin.2
;-- picture/text --
xp:=(wa*90.3)/xx,yp:=(ha* 1.8)/xx,wp:=(wa* 8.4)/xx,hp:=(ha*88.9)/xx
GUI,2:Font,s11 cYellow,Lucida Console
   Gui,2:Add,ActiveX, x%x1% y%y1% w%lw%  h%lh% vVlcx,%xxb%
   Gui,2:Add,Edit, x%xp% y%yp% w%wp%  h%hp% -hscroll -vscroll vEd1,%e1%
   Gui,2:add,GroupBox,x%x2% y%y2% w%WM% h%HM%
GUI,2:Font,s14 cGray,Lucida Console
y:=(ha*92)/xx  
Gui,2:Add,Text,x%x2% y%y% , %c2%   ( use ESC to quit )
Gui,2:Add,text,x0 y0 h0 w0 vT1
Gui,2:Show,x0 y0 w%gw% h%gh%,%filename1%
GuiControl,2: Focus,T1
vlcx.playlist.add(F1,"","""""")
vlcx.playlist.next()
settimer,aas1,165000
return
2Guiclose:
exitapp
esc::exitapp
;--------------
aas1:
gosub,text2
Guicontrol,2:,ed1,%e2%
settimer,aas1,off
return
;-------------
text1:
e1=
(

Óh! Ih! Oh! Ai!
Esta vida é uma cantiga
E este dia d' alegria
Vale um ano d' aflição

Óh! Ih! Oh! Ai!
Porque este dia da espiga
É o arauto do dia
Em que o trigo há-de dar pão!

Jorra o vinho dos pichéis
Para os lábios das moçoilas
Mais vermelhas que papoilas
Co'as larachas dos Manéis

Há merendas pelos prados
Gargalhadas pelo ar
E à beirinha dos valados
Ouve a gente murmurar

Maria, são teus olhos azeitonas!
Cachopa, são teus lábios qual cereja!
E os teus seios, cachos d'uvas que abandonas
À vindima desta boca que os deseja!

Tomam todos os caminhos
Um sabor de romaria
E até mesmo os pobrezinhos
Fingem ter alegria

E, na volta, já sentindo
Que foi tudo um sonho em vão
Inda há ecos, repetindo
Pelo espaço esta canção

Maria, são teus olhos azeitonas!
Cachopa, são teus lábios qual cereja!
E os teus seios, cachos d'uvas que abandonas
À vindima desta boca que os deseja!
)
return

text2:
e2=
(


Na rua dos meus ciúmes
Onde eu morei e tu moras
Vi-te passar fora de horas
Com a tua nova paixão

De mim não esperes queixumes
Quer seja desta ou daquela
Pois sinto só pena dela
E até lhe dou o meu perdão
Na rua dos meus ciúmes
Deixei o meu coração

Saudades são fé perdida
São folhas mortas ao vento
E eu piso sem um lamento
Na tua rua ao passar
E ainda que me custe a vida
Não há-de-ver-me chorar
Na rua dos meus ciúmes

Deixei o meu coração.
)
return
;============ END script Youtube PLAY =====================================

Last edited by garry on 25 Apr 2020, 13:59, edited 1 time in total.
garry
Posts: 3758
Joined: 22 Dec 2013, 12:50

Re: Youtube_Play ActiveX

11 Apr 2020, 01:06

script changed
also examples :
;- https://www.autohotkey.com/boards/viewtopic.php?f=6&t=74482 ;- play youtube
;- https://www.autohotkey.com/boards/viewtopic.php?f=6&t=74484 ;- play video with vlc.exe

Return to “Scripts e Funções”

Who is online

Users browsing this forum: No registered users and 14 guests