Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all articles
Browse latest Browse all 12506

A simple script that demonstrates controlling Zoom Player via TCP

$
0
0

Pasted below is a short, simple AutoIt script that I wrote to test TCP control of Zoom Player Max (ZP) . The functions available are at this link.

 

May it help someone in the future.

 

Thank you to BrewManNH and TheSaint for their help in other threads I started. :thumbsup:

AutoIt         
  1. ;simple AutoIt script for controlling Zoom Player via TCP
  2.  
  3. HotKeySet("{ESC}", "Terminate") ;ESC to bail out
  4.  
  5. ;these will be used when I open the TCP socket
  6. $ip = "127.0.0.1"
  7. $port = "4769"
  8.  
  9. ;start TCP service
  10.  
  11. ;open TCP socket and see if it was successful
  12. $socket = TCPConnect( $ip, $port )
  13.  
  14. If $Socket = -1 Then
  15.       MsgBox(4096,"Error","Failed to connect to ZP via TCP on localhost at port 4769.")
  16.       Terminate()
  17.  
  18. ;now loop, presenting Text Input prompt for user to enter a ZP function and optional parameters.
  19.  
  20.     ;text entry prompt with Cancel button
  21.     $msg = InputBox("ZP TCP Controller","Enter text to send via TCP (default is play). Or Cancel to exit.): ", "5100 fnPlay" & @CRLF)
  22.     if @error = 1 then Terminate()
  23.  
  24.     ;@CRLF needed at end of text to be sent!
  25.     $msg = $msg & @CRLF
  26.  
  27.     ;the rubber meets the road here
  28.     $send = TCPSend($socket, $msg)
  29.  
  30.  
  31. Terminate()
  32.  
  33. Func Terminate() ;process ESC key and close TCP
  34.  
  35.     TCPCloseSocket($socket)
  36.     TCPShutdown()
  37.     Exit 0
  38.  

If anyone wants to add the ability to receive responses from Zoom Player I would welcome the addition.  Here's a link to a very clear explanation of communicating via TCP with ZP via Autohotkey, including receiving the info ZP sends back up the pipe.  Also, here's a link to download a neat TCP testing tool written in Delphi for the ZP community. Zoom Player is a great video player in my opinion, with inspiring depth AND incredible documentation.

 

 


Viewing all articles
Browse latest Browse all 12506

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>