Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

VLC HTTP 2. Interface library for lastest VLC Media Player.


  • Please log in to reply
No replies to this topic
specter333
  • Members
  • 627 posts
  • Last active: Oct 07 2016 07:43 AM
  • Joined: 15 Jan 2007
VLC HTTP 2 Interface Library

The latest version of VLC media player changed the way the HTTP commands were called and added new commands. This is a complete (I believe) library of all available commands and a few custom ones.

New commands includd Play Faster, Play Slower and Resume Normal Speed.

The original VLCHTTP.ahk libaray is still available here.

VLCHTTP2.ahk
; VLC Media Player HTTP Functions Library.
; Developed by Richard Wells, AHK handle Specter333.
; 
; Most transport functions are one way, received by VLC.  They can be 
; Called using only the function name. 
; Example, VLCHTTP2_Pause() will toggle between pause and play.
; 
; Some of the one way functions, such as VLCHTTP2_VolumeChange(Val) or
; VLCHTTP2_PlaylistAdd(path), require a parameter. 
; Example, VLCHTTP2_VolumeUp(10) sets the volume 10% higher than it was.
;
; Functions that return data, such as VLCHTTP2_CurrentVol() or 
; VLCHTTP2_PlaylistTracks(), use the normal syntax. 
; Example, GetTrack:=VLCHTTP2_NowPlaying() puts the name 
; of the currently playing track into the variable %GetTrack%.
;
; For demo scripts see the AHK forum post,
; http://www.autohotkey.com/forum/viewtopic.php?t=69150

; Last updated November 24, 2011.

VLCHTTP2_Close() ; Closes VLC Media Player.
	{
	WinClose, VLC media player ahk_class QWidget
	}
VLCHTTP2_Pause() ; Toggles Play/Pause of currently playing media.
	{
	; cmd = http://127.0.0.1:8080/?control=pause
	cmd = http://127.0.0.1:8080/requests/status.xml?command=pl_pause
	UrlDownloadToVar(cmd)
	}
VLCHTTP2_Play() ; Play from currently select playlist item.
	{
	;cmd = http://127.0.0.1:8080/?control=play
	cmd = http://127.0.0.1:8080/requests/status.xml?command=pl_play
	UrlDownloadToVar(cmd)
	}
VLCHTTP2_Stop() ; Stop media playback.
	{
	;cmd = http://127.0.0.1:8080/?control=stop
	cmd = http://127.0.0.1:8080/requests/status.xml?command=pl_stop
	UrlDownloadToVar(cmd)
	}
VLCHTTP2_FullScreen() ; Toggle Full Screen 
	{
	cmd = http://127.0.0.1:8080/requests/status.xml?command=fullscreen
	UrlDownloadToVar(cmd)
	}

VLCHTTP2_PlayFaster(Val) ; Play Faster.
	{
	cmd = http://127.0.0.1:8080/requests/status.xml?command=rate&val=%Val%  
	UrlDownloadToVar(cmd)
	}
VLCHTTP2_NormalSpeed() ; Resume Normal Playback Speed.
	{
	cmd = http://127.0.0.1:8080/requests/status.xml?command=rate&val=1
	UrlDownloadToVar(cmd)
	}	
VLCHTTP2_PlaySlower(Val) ; Play Slower.
	{
	cmd = http://127.0.0.1:8080/requests/status.xml?command=rate&val=%Val%  
	UrlDownloadToVar(cmd)
	}
VLCHTTP2_Rate() ; Returns Current Play Rate.
	{
	Status := VLCHTTP2_Status()
	Loop, parse, Status, `n, `r  
		{
		IfInString, A_LoopField, <rate>
			Rate = %A_LoopField%
		}
	CurrentRate := UnHTM(Rate)
	Return, %CurrentRate%
	}	
VLCHTTP2_JumpForward(Val) ; Skip ahead in media the specified value.
	{
	cmd = http://127.0.0.1:8080/requests/status.xml?command=seek&val=`%2B%Val%  
	UrlDownloadToVar(cmd)
	}
VLCHTTP2_JumpBackward(Val) ; Skip back in media the specified value.  
	{
	cmd = http://127.0.0.1:8080/requests/status.xml?command=seek&val=-%Val%  
	UrlDownloadToVar(cmd)
	}
VLCHTTP2_VolumeUp(Val) ; Volume up relative, a value of 10 is typical
	{
	;depending or your settings range is either 1-512 or 1-1024
	cmd = http://127.0.0.1:8080/requests/status.xml?command=volume&val=`%2B%Val%
	UrlDownloadToVar(cmd)
	}
VLCHTTP2_VolumeDown(Val) ; Volume down relative, a value of 10 is typical
	{
	;depending or your settings range is either 1-512 or 1-1024
	cmd = http://127.0.0.1:8080/requests/status.xml?command=volume&val=-%Val%
	UrlDownloadToVar(cmd)
	}
VLCHTTP2_VolumeChange(Val) ; Sets volume to val, 
	{
	;depending or your settings range is either 0-512 or 0-1024
	cmd = http://127.0.0.1:8080/requests/status.xml?command=volume&val=%Val%
	UrlDownloadToVar(cmd)
	}
VLCHTTP2_ToggleMute(resetvol) ; Call with - MuteStatus:=VLCHTTP2_ToggleMute(MuteStatus)
; This does not invoke the mute button on VLC but remembers the current volume then set
; the volume to 0.  When called again it restores the previous volume. 
	{
	Status := VLCHTTP2_Status()
	Loop, parse, Status, `n, `r  
		{
		IfInString, A_LoopField, <volume>
			Volume = %A_LoopField%
		}
	CurrentVolume := UnHTM(Volume)
		
	If CurrentVolume = 0
		{
		cmd = http://127.0.0.1:8080/requests/status.xml?command=volume&val=%resetvol%
		UrlDownloadToVar(cmd)
		Return
		}
	cmd =  http://127.0.0.1:8080/requests/status.xml?command=volume&val=0
	UrlDownloadToVar(cmd)
	Return, %CurrentVolume%
	}
VLCHTTP2_CurrentVol() ; Retrieve current volume
	{
	Status := VLCHTTP2_Status()
	Loop, parse, Status, `n, `r  
		{
		IfInString, A_LoopField, <volume>
			Volume = %A_LoopField%
		}
	CurrentVolume := UnHTM(Volume)
	Return, %CurrentVolume%
	}
VLCHTTP2_NowPlaying() ; Retrieves the name of the current media in VLC status.
	{
	Status := VLCHTTP2_Status()
	Loop, parse, Status, `n, `r  
		{
		IfInString, A_LoopField, <title>
			NowPlaying = %A_LoopField%
		}
	StringReplace, NowPlaying, NowPlaying, <![CDATA[, , A
	StringReplace, NowPlaying, NowPlaying, ]]>, , A
	NowPlaying := UnHTM(NowPlaying)
	Return, %NowPlaying%
	}
VLCHTTP2_Status() ;Get information on current playing media.
	{
	VLCStatus = http://127.0.0.1:8080/requests/status.xml
	Status := UrlDownloadToVar(VLCStatus)
	Return, Status
	}
;;;;;;;;;;;;;;;;;;;;        Playlist Functions     ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
VLCHTTP2_PlayList() ; Retrieve the playlist data.
	{
	VLCPlayList = http://127.0.0.1:8080/requests/playlist.xml
	OutFile := UrlDownloadToVar(VLCPlayList)
	Return, %OutFile%
	}
VLCHTTP2_PlayListNext() ;Next item in the playlist
	{
	cmd = http://127.0.0.1:8080/requests/status.xml?command=pl_next
	UrlDownloadToVar(cmd)
	}
VLCHTTP2_PlayListPrevious() ;Previous item in the playlist
	{
	cmd = http://127.0.0.1:8080/requests/status.xml?command=pl_previous
	UrlDownloadToVar(cmd)
	}
VLCHTTP2_PlayListClear() ; Delete all items in the playlist
	{
	cmd = http://127.0.0.1:8080/requests/status.xml?command=pl_empty
	UrlDownloadToVar(cmd)
	}
VLCHTTP2_PlayListRandom() ; Toggle (On, Off) random playback order
	{
	cmd = http://127.0.0.1:8080/requests/status.xml?command=pl_random
	UrlDownloadToVar(cmd)
	}
VLCHTTP2_PlayListIsRandom() ; Returns 1 if random is on, 0 if not.
	{
	Status := VLCHTTP2_Status()
	Loop, parse, Status, `n, `r  
		{
		IfInString, A_LoopField, <random>
			Random = %A_LoopField%
		}
	IsRandom := UnHTM(Random)
	Return, %IsRandom%
	}
VLCHTTP2_PlayListLoop() ; Toggle loop playback
	{
	cmd = http://127.0.0.1:8080/requests/status.xml?command=pl_loop
	UrlDownloadToVar(cmd)
	}
VLCHTTP2_PlayListIsLoop() ; Returns 1 is loop is on, 0 if not.
	{
	Status := VLCHTTP2_Status()
	Loop, parse, Status, `n, `r  
		{
		IfInString, A_LoopField, <loop>
			Loop = %A_LoopField%
		}
	IsLoop := UnHTM(Loop)
	Return, %IsLoop%
	}
VLCHTTP2_PlayListRepeat() ; Toggle between repeat 1 or repeat all when looping. 
	{
	cmd = http://127.0.0.1:8080/requests/status.xml?command=pl_repeat
	UrlDownloadToVar(cmd)
	}
VLCHTTP2_PlayListIsRepeat() ; Returns 0 for repeat all or 1 for repeat current media.
	{
	Status := VLCHTTP2_Status()
	Loop, parse, Status, `n, `r  
		{
		IfInString, A_LoopField, <repeat>
			Repeat = %A_LoopField%
		}
	IsRepeat := UnHTM(Repeat)
	Return, %IsRepeat%
	}
VLCHTTP2_PlaylistPlayID(id) ; Play the entry coresponding the the Playlist id number.
	{
	cmd = http://127.0.0.1:8080/requests/status.xml?command=pl_play&id=%id%
	UrlDownloadToVar(cmd)
	}
VLCHTTP2_PlaylistDeleteID(id)  ; Delete the entry coresponding the the Playlist id number.
	{
	cmd = http://127.0.0.1:8080/requests/status.xml?command=pl_delete&id=%id%
	UrlDownloadToVar(cmd)
	}
VLCHTTP2_PlaylistTracks() ; Retrieve the title of all media in the playlist seperated with ¥.
	{
	AllTitles = 
	cmd := VLCHTTP2_PlayList()
	StringReplace, cmd, cmd, <leaf, ¥, A
	StringReplace, cmd, cmd, ]]>, , A
	StringReplace, cmd, cmd, <![CDATA[, , A
	StringSplit, Section, cmd, ¥
	Loop, %Section0%
		{
		Sect := % Section%A_Index%
		Loop, parse, Sect, `n, `r
			{
			IfInString, A_LoopField, <title>
				title = %A_LoopField%
			StringReplace, title, title, <![CDATA[, , A
			StringReplace, title, title, ]]>, , A
			title := UnHTM(title)
			If AllTitles = 
				ReturnTitle = %title%
			Else, ReturnTitle = ¥%title%	
			
			}

		AllTitles = %AllTitles%%ReturnTitle%
		}
	Return, %AllTitles%
	}
VLCHTTP2_PlaylistArtist() ; Retrieve the artist of all media in the playlist seperated with ¥.
	{
	AllArtist= 
	cmd := VLCHTTP2_PlayList()
	StringReplace, cmd, cmd, <leaf, ¥, A
	StringReplace, cmd, cmd, ]]>, , A
	StringReplace, cmd, cmd, <![CDATA[, , A
	StringSplit, Section, cmd, ¥
	Loop, %Section0%
		{
		Sect := % Section%A_Index%
		Loop, parse, Sect, `n, 
			{
			IfInString, A_LoopField, <Artist>
				Artist = %A_LoopField%
			Artist := UnHTM(Artist)
			If AllArtist = 
				ReturnArtist = %Artist%
			Else, ReturnArtist = ¥%Artist%
			}
		AllArtist = %AllArtist%%ReturnArtist%
		}
	Return, %AllArtist%
	}	
VLCHTTP2_PlayListAlbum() ; Retrieve the album of all media in the playlist seperated with ¥.
	{
	AllAlbums = 
	cmd := VLCHTTP2_PlayList()
		StringReplace, cmd, cmd, <leaf, ¥, A
	StringReplace, cmd, cmd, ]]>, , A
	StringReplace, cmd, cmd, <![CDATA[, , A
	StringSplit, Section, cmd, ¥
	Loop, %Section0%
		{
		Sect := % Section%A_Index%
		Loop, parse, Sect, `n, `r
			{
			IfInString, A_LoopField, <album>
				Album = %A_LoopField%
			Album := UnHTM(Album)
			If AllAlbums = 
				ReturnAlbum = %Album%
			Else, ReturnAlbum = ¥%Album%
			}
		AllAlbums = %AllAlbums%%ReturnAlbum%
		
		}
	Return, %AllAlbums%
	}
VLCHTTP2_PlayListID() ; Retrieve the playlist ID of all media in the playlist seperated with ¥.
; Use this ID to play or delete a playist item.
	{
	AllIDs = 
	cmd := VLCHTTP2_PlayList()
		StringReplace, cmd, cmd, <leaf, ¥ µ, A
	StringReplace, cmd, cmd, ]]>, , A
	StringReplace, cmd, cmd, <![CDATA[, , A
	StringSplit, Section, cmd, ¥
	Loop, %Section0%
		{
		Sect := % Section%A_Index%
		Loop, parse, Sect, `n, `r
			{
			IfInString, A_LoopField,  µ id=
				ID = %A_LoopField%
			StringSplit, ID, ID, "
			ID := UnHTM(ID2)
			If AllIDs = 
				ReturnID = %ID%
			Else, ReturnID = ¥%ID%
			}
		AllIDs = %AllIDs%%ReturnID%
		
		}
	Return, %AllIDs%
	}
VLCHTTP2_PlaylistAdd(path) ; Add media to playlist.
	{
	StringReplace, path, path, \, /, All
	cmd = http://127.0.0.1:8080/requests/status.xml?command=in_enqueue&input=%path%
	UrlDownloadToVar(cmd)
	Return, %path%
	}
VLCHTTP2_PlaylistAddPlay(path) ; Add media to playlist and play it.
	{
	StringReplace, path, path, \, /, All
	;cmd = http://127.0.0.1:8080/requests/status.xml?command=in_play&input=%path%
	cmd = http://127.0.0.1:8080/requests/status.xml?command=in_play&input=%path%
	UrlDownloadToVar(cmd)
	Return, %path%
	}

;;; Sort functions seem to be disabled in latest version.  They are broken in VLC's HTML interface too.  	
VLCHTTP2_PlaylistSortID(order=0) ; Sort playlist by ID or how added, order = normal, order 1 = reverse.
	{
	cmd = http://127.0.0.1:8080/requests/status.xml?command=pl_sort&id=%order%&val=0
	UrlDownloadToVar(cmd)
	}
VLCHTTP2_PlaylistSortName(order=0) ; Sort playlist by name, order = normal, order 1 = reverse.
	{
	cmd = http://127.0.0.1:8080/requests/status.xml?command=pl_sort&id=%order%&val=1
	UrlDownloadToVar(cmd)
	}
VLCHTTP2_PlaylistSortAuthor(order=0) ; Sort playlist by author, order = normal, order 1 = reverse.
	{
	cmd = http://127.0.0.1:8080/requests/status.xml?command=pl_sort&id=%order%&val=3
	UrlDownloadToVar(cmd)
	}	
VLCHTTP2_PlaylistSortRandom(order=0) ; Sort playlist random, order = normal, order 1 = reverse.
	{
	cmd = http://127.0.0.1:8080/requests/status.xml?command=pl_sort&id=%order%&val=5
	UrlDownloadToVar(cmd)
	}	
VLCHTTP2_PlaylistSortTrackNum(order=0) ; Sort playlist by track number, order = normal, order 1 = reverse.
	{
	cmd = http://127.0.0.1:8080/requests/status.xml?command=pl_sort&id=%order%&val=7
	UrlDownloadToVar(cmd)
	}

;;;;;; Service discovery modules, untested.
VLCHTTP2_Sap() ; Toggles sap service discovery module On/Off.
	{
	cmd = http://127.0.0.1:8080/requests/status.xml?command=pl_sd&val=sap
	UrlDownloadToVar(cmd)
	}
VLCHTTP2_Shoutcast() ; Toggles shoutcast service discovery module On/Off.
	{
	cmd = http://127.0.0.1:8080/requests/status.xml?command=pl_sd&val=shoutcast
	UrlDownloadToVar(cmd)
	}
VLCHTTP2_Podcast() ; Toggles podcast service discovery module On/Off.
	{
	cmd = http://127.0.0.1:8080/requests/status.xml?command=pl_sd&val=podcast
	UrlDownloadToVar(cmd)
	}
VLCHTTP2_Hal() ; Toggles hal service discovery module On/Off.
	{
	cmd = http://127.0.0.1:8080/requests/status.xml?command=pl_sd&val=hal
	UrlDownloadToVar(cmd)
	}
VLCHTTP2_ServMod(Mod) ; Toggles a custom service discovery module On/Off.	
	{
	cmd = http://127.0.0.1:8080/requests/status.xml?command=pl_sd&val=%Mod%
	UrlDownloadToVar(cmd)
	}

;;;;;;;;;;;;;;;;;;;;;;      Time Functions ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
VLCHTTP2_Time() ;   Returns the elapsed time of the currently playing item.
	{
	Status := VLCHTTP2_Status()
	Loop, parse, Status, `n, `r  
		{
		IfInString, A_LoopField, <time>
			time = %A_LoopField%
		}
	NowTime := UnHTM(time)
	NowTime := FormatSeconds(NowTime)
	Return, %NowTime%	
	}
VLCHTTP2_Length() ;   Returns the total length of the currently playing item.
	{
	Status := VLCHTTP2_Status()
	Loop, parse, Status, `n, `r  
		{
		IfInString, A_LoopField, <length>
			length = %A_LoopField%
		}
	Duration := UnHTM(length)
	Duration := FormatSeconds(Duration)
	Return, %Duration%
	}
VLCHTTP2_Remaining() ;   Returns the difference between "Time" and "Length" of the currently playing item.
	{
	Status := VLCHTTP2_Status()
	Loop, parse, Status, `n, `r  
		{
		IfInString, A_LoopField, <length>
			length = %A_LoopField%
		}
	Duration := UnHTM(length)
	Loop, parse, Status, `n, `r  
		{
		IfInString, A_LoopField, <time>
			time = %A_LoopField%
		}
	NowTime := UnHTM(time)
	Remaining := Duration-NowTime
	Remaining := FormatSeconds(Remaining)
	Return, %Remaining%
	}
VLCHTTP2_Position() ;Returns the percent played of the currently playing item.
	{
	Status := VLCHTTP2_Status()
	Loop, parse, Status, `n, `r  
		{
		IfInString, A_LoopField, <position>
			cmd = %A_LoopField%
		}
	StringReplace, cmd, cmd, <![CDATA[, , A
	StringReplace, cmd, cmd, ]]>, , A
	cmd := UnHTM(cmd)
	Return, %cmd%
	}	
VLCHTTP2_State() ;Returns the state player, Playing or Stopped.
	{
	Status := VLCHTTP2_Status()
	Loop, parse, Status, `n, `r  
		{
		IfInString, A_LoopField, <state>
			cmd = %A_LoopField%
		}
	;StringReplace, cmd, cmd, <![CDATA[, , A
	;StringReplace, cmd, cmd, ]]>, , A
	cmd := UnHTM(cmd)
	Return, %cmd%
	}
;;;;;;;;;;;;;;;;;;;;;;  Video Size  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
VLCHTTP2_VidSize() ;   Returns the resolution of the currently playing item.
	{
	Status := VLCHTTP2_Status()
	Loop, parse, Status, `n, `r  
		{
		IfInString, A_LoopField, Resolution
		Resolution = %A_LoopField%
		}
	VidRes := UnHTM(Resolution)
	Return, %VidRes%	
	}	
	
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Format time from example in manual.
FormatSeconds(NumberOfSeconds)
   {
    time = 19990101 
    time += %NumberOfSeconds%, seconds
    FormatTime, mmss, %time%, mm:ss
    return NumberOfSeconds//3600 ":" mmss
   }

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;  UrlDownloadToVar by olfen 
; http://www.autohotkey.com/forum/viewtopic.php?p=64230#64230
UrlDownloadToVar(URL, Proxy="", ProxyBypass="") {
AutoTrim, Off
hModule := DllCall("LoadLibrary", "str", "wininet.dll")

If (Proxy != "")
AccessType=3
Else
AccessType=1
;INTERNET_OPEN_TYPE_PRECONFIG                    0   // use registry configuration
;INTERNET_OPEN_TYPE_DIRECT                       1   // direct to net
;INTERNET_OPEN_TYPE_PROXY                        3   // via named proxy
;INTERNET_OPEN_TYPE_PRECONFIG_WITH_NO_AUTOPROXY  4   // prevent using java/script/INS

io_hInternet := DllCall("wininet\InternetOpenA"
, "str", "" ;lpszAgent
, "uint", AccessType
, "str", Proxy
, "str", ProxyBypass
, "uint", 0) ;dwFlags

iou := DllCall("wininet\InternetOpenUrlA"
, "uint", io_hInternet
, "str", url
, "str", "" ;lpszHeaders
, "uint", 0 ;dwHeadersLength
, "uint", 0x80000000 ;dwFlags: INTERNET_FLAG_RELOAD = 0x80000000 // retrieve the original item
, "uint", 0) ;dwContext

If (ErrorLevel != 0 or iou = 0) {
DllCall("FreeLibrary", "uint", hModule)
return 0
}

VarSetCapacity(buffer, 512, 0)
VarSetCapacity(NumberOfBytesRead, 4, 0)
Loop
{
  irf := DllCall("wininet\InternetReadFile", "uint", iou, "uint", &buffer, "uint", 512, "uint", &NumberOfBytesRead)
  NOBR = 0
  Loop 4  ; Build the integer by adding up its bytes. - ExtractInteger
    NOBR += *(&NumberOfBytesRead + A_Index-1) << 8*(A_Index-1)
  IfEqual, NOBR, 0, break
  ;BytesReadTotal += NOBR
  DllCall("lstrcpy", "str", buffer, "uint", &buffer)
  res = %res%%buffer%
}
StringTrimRight, res, res, 2

DllCall("wininet\InternetCloseHandle",  "uint", iou)
DllCall("wininet\InternetCloseHandle",  "uint", io_hInternet)
DllCall("FreeLibrary", "uint", hModule)
AutoTrim, on
return, res
} 

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; UnHTM by SKAN
; http://www.autohotkey.com/forum/viewtopic.php?p=312001#312001

 UnHTM( HTM ) {   ; Remove HTML formatting / Convert to ordinary text   by SKAN 19-Nov-2009
 Static HT,C=";" ; Forum Topic: www.autohotkey.com/forum/topic51342.html  Mod: 16-Sep-2010
 IfEqual,HT,,   SetEnv,HT, % "ááââ´´ææàà&ååãã&au"
 . "mlä&bdquo„¦¦&bull•ç縸¢¢&circˆ©©¤¤&dagger†&dagger‡°"
 . "°÷÷ééêêèèððëë&euro€&fnofƒ½½¼¼¾¾>>&h"
 . "ellip…ííîî¡¡ìì¿¿ïï««&ldquo“&lsaquo‹&lsquo‘<<&m"
 . "acr¯&mdash—µµ··  &ndash–¬¬ññóóôô&oeligœòò&or"
 . "dfªººøøõõöö¶¶&permil‰±±££"""»»&rdquo”®"
 . "®&rsaquo›&rsquo’&sbquo‚&scaronš§§­ ¹¹²²³³ßßþþ&tilde˜&tim"
 . "es×&trade™úúûûùù¨¨üüýý¥¥ÿÿ"
 $ := RegExReplace( HTM,"<[^>]+>" )               ; Remove all tags between  "<" and ">"
 Loop, Parse, $, &`;                              ; Create a list of special characters
   L := "&" A_LoopField C, R .= (!(A_Index&1)) ? ( (!InStr(R,L,1)) ? L:"" ) : ""
 StringTrimRight, R, R, 1
 Loop, Parse, R , %C%                               ; Parse Special Characters
  If F := InStr( HT, L := A_LoopField )             ; Lookup HT Data
    StringReplace, $,$, %L%%C%, % SubStr( HT,F+StrLen(L), 1 ), All
  Else If ( SubStr( L,2,1)="#" )
    StringReplace, $, $, %L%%C%, % Chr(((SubStr(L,3,1)="x") ? "0" : "" ) SubStr(L,3)), All
Return RegExReplace( $, "(^\s*|\s*$)")            ; Remove leading/trailing white spaces
}

Here is a quick example script.
Gui, Add, Button, x10 y10 w50 gVolDn, VolDn
Gui, Add, Button, x+5 w50 gStop, Stop
Gui, Add, Button, x+5 gPlay, Play
Gui, Add, Button, x+5 gVolUp, VolUp
Gui, Show
Return

VolDn:
VLCHTTP2_VolumeDown(10)
; Turn volume down by 10 out of 1024.
Return

Stop:
VLCHTTP2_Stop()
Return

Play:
VLCHTTP2_Play()
Return

VolUp:
VLCHTTP2_VolumeUp(10)
; Turn volume Up by 10 out of 1024.
Return

Setting up VLC.
In VLC's option you will need to activate the http interface by checking the box in front of it. It's located in Interface/Main Interface. Then add this information to Interface/Main Interface/Http
Host Address-    127.0.0.1:8080
Source Directory-   C:\Program Files\VideoLAN\VLC\http

Note, I went through the new commands fairly quickly and did not test each one. Please let me know if you find one that does not work.
I you need new version of any scripts I haven't re-uploaded yet feel free to pm me.