PotPlayer x64 Function Library

Post your working scripts, libraries and tools
x32
Posts: 61
Joined: 25 Nov 2016, 16:44

PotPlayer x64 Function Library

09 Mar 2018, 23:27

Function library for the short list of available commands for the new(ish) PotPlayer media player. Updated with new functions 3/12/18.
https://potplayer.daum.net/

I prefer using SendMessage over Hotkeys because the player does not need to have focus or even be showing to receive the messages. This library is for the 64 bit version of the player. It can be modified for the 32 bit version by changing the AHK Class (ahk_class PotPlayer64) to however Window Spy detects it.

Basic messages are called with no other info needed.
Example:

Code: [Select all] [Download] GeSHi © Codebox Plus

play:
PotPlayer_Play()
Return


Other functions and functions added in the future can be called by passing the correct value. A chart at the bottom of the library list the value for each known function.
Example:

Code: [Select all] [Download] GeSHi © Codebox Plus

playlist:
PotPlayer(10011)
Return


Save script as PotPlayer.ahk and add to your function library folder.

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus

Last edited by x32 on 12 Mar 2018, 13:03, edited 6 times in total.
brutus_skywalker
Posts: 177
Joined: 24 Dec 2016, 13:16
Location: Antarctica

Re: PotPlayer x64 Function Library

10 Mar 2018, 14:44

But i think every thing here can be sent by using media keys, if there was rewind,fast forward,etc... that would be useful but as it is i prefer to use mediakeys,they work with any media player(for the most part)...

https://www.autohotkey.com/docs/KeyList.htm#Multimedia_keys
Outsourcing Clicks & Presses Since 2004.
x32
Posts: 61
Joined: 25 Nov 2016, 16:44

Re: PotPlayer x64 Function Library

10 Mar 2018, 17:14

brutus_skywalker wrote:But i think every thing here can be sent by using media keys, if there was rewind,fast forward,etc... that would be useful but as it is i prefer to use mediakeys,they work with any media player(for the most part)...\


The media keys won't work if the player doesn't have focus, which is why I prefer SendMessage. I have a hard time just sitting still and watching videos. I'm always working on something else on the other screen.

I suspect other functions will be added as development improves. For now there are not enough for PotPlayer to be useful for me but I thought I'd post this in case someone finds it useful.
vasili111
Posts: 747
Joined: 21 Jan 2014, 02:04
Location: Georgia

Re: PotPlayer x64 Function Library

12 Mar 2018, 00:40

Nice project! I love Potplayer :) Thank you :)
Is it possible to add a function that gets current time of played video?
DRAKON-AutoHotkey: Visual programming for AutoHotkey.
x32
Posts: 61
Joined: 25 Nov 2016, 16:44

Re: PotPlayer x64 Function Library

12 Mar 2018, 07:00

Guest wrote:

Code: [Select all] [Download] GeSHi © Codebox Plus

SendMessage, 0x0400, 0x5004,,, ahk_class PotPlayer64
MsgBox %ErrorLevel%


Nice. If it's not too much trouble, would you mind educating me on how this works? 0x0400 is WM_USER, what does this actually do? And I can't find anything on 0x5004 what is it's function?
Guest

Re: PotPlayer x64 Function Library

12 Mar 2018, 07:34

I'm sorry, I don't know, myself. I saw a list of messages like that for PotPlayer on a website some years back and kept that as a snippet as I thought I might need it one day.

Actually, searching for 0x5004 potplayer brings up the page I was talking about. Knock yourself out! :)
x32
Posts: 61
Joined: 25 Nov 2016, 16:44

Re: PotPlayer x64 Function Library

12 Mar 2018, 07:54

vasili111 wrote:Nice project! I love Potplayer :) Thank you :)
Is it possible to add a function that gets current time of played video?


Thanks. I just added the function provided by Guest and one to convert the milliseconds to h:m:s, provided by Odlanir, to the library in the original post. Now you can call the function PotPlayer_Current() and get the current position.
x32
Posts: 61
Joined: 25 Nov 2016, 16:44

Re: PotPlayer x64 Function Library

12 Mar 2018, 10:32

Guest wrote:Actually, searching for 0x5004 potplayer brings up the page I was talking about. Knock yourself out! :)


Yes, I found a page (in Japanese) with some more functions. I'm trying to add a few to the current library.

Trying to use the "get current position" and " set current position" functions to add "jump forward" and "jump backward" functions but I seem to get random results. i.e. if i add 10 seconds to the current time it seems to jump anywhere between 0 and 10 seconds.

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus


Any ideas as to why?
wolf_II
Posts: 1917
Joined: 08 Feb 2015, 20:55

Re: PotPlayer x64 Function Library

12 Mar 2018, 13:05

I have no real knowledge, but I think:
Video formats can be a series of all pictures, or a series of key-frames followed by instructions of how to calculate the frames in between.
In the latter case I guess the player can only jump to key-frames ???
brutus_skywalker
Posts: 177
Joined: 24 Dec 2016, 13:16
Location: Antarctica

Re: PotPlayer x64 Function Library

12 Mar 2018, 13:36

x32 wrote:
brutus_skywalker wrote:But i think every thing here can be sent by using media keys, if there was rewind,fast forward,etc... that would be useful but as it is i prefer to use mediakeys,they work with any media player(for the most part)...\


The media keys won't work if the player doesn't have focus, which is why I prefer SendMessage. I have a hard time just sitting still and watching videos. I'm always working on something else on the other screen.

I suspect other functions will be added as development improves. For now there are not enough for PotPlayer to be useful for me but I thought I'd post this in case someone finds it useful.



U sir have swayed me,useful indeed,my scripts for vlc use the 'http' interface, so that didn't occur to me,
Outsourcing Clicks & Presses Since 2004.
x32
Posts: 61
Joined: 25 Nov 2016, 16:44

Re: PotPlayer x64 Function Library

12 Mar 2018, 14:51

Unfortunately VLC doesn't respond to SendMessage commands. I made a HTTP interface library for VLC a few years ago, as user Specter333, but I can't get it to work with the latest version. If yours is working can you post it?
vasili111
Posts: 747
Joined: 21 Jan 2014, 02:04
Location: Georgia

Re: PotPlayer x64 Function Library

12 Mar 2018, 21:13

x32 and Guest

Thanks :thumbup:
DRAKON-AutoHotkey: Visual programming for AutoHotkey.
brutus_skywalker
Posts: 177
Joined: 24 Dec 2016, 13:16
Location: Antarctica

Re: PotPlayer x64 Function Library

16 Mar 2018, 23:15

x32 wrote:Unfortunately VLC doesn't respond to SendMessage commands. I made a HTTP interface library for VLC a few years ago, as user Specter333, but I can't get it to work with the latest version. If yours is working can you post it?



Mines' a tad obsolete as well,the old http interface was more or less plain http, but you can check out my other script https://autohotkey.com/boards/viewtopic.php?f=6&t=32336&hilit=Media+Remote which basically allows you to control for the MOST PART,(see features below), ALTHOUGH IT NEEDS VLC TO BE ACTIVE to control playback(only draw back), and has a premitive html ONLY interface for speed(and because i was too lazy to figure out how to modify AHKHTTP server to accept images).

Here's a list of features,note some might be missing, such as OSD for currently playing media,because it merely uses active window title and i thought it inadequate to include as a 'feature'


Features:

Previous,Pause/Play,Stop,Next

VLC/KMPlayer only Forward/Rewind with Multiplier in config.

VolumeUp/Down/MuteToggle AND 20/50/80/100% Presets //20-30-30-20 increments//|//VolumeUp/Down Dec/Increments by 5%//.

standby/hibernate with a timer,timer default is '0',timer can be inc/decreased by 30min inc/decrements or reset,if timer is reset any timer delayed standby/hibernate action will be reset.

Monitor_On/Off.

mrcexit hotstring to kill the server.

VLC Bring To Front/Turn off VLC/FullScreen Toggle.

VLC/KMPlayer/MPlayer Display NowPlaying File Notification on browserInterface.

VLC - Continue to resume playback. If it is enabled in vlc settings & the 'continue playback' floating panel is active,i.e If The 'Continue' Notification is visible.

Quick launch media folders,Each media folder is assigned a button on the browser interface. Media folders can be added using config section on browserInterface or manually in the iniFile. Quick Launch folders are run with an always-on-top,qt-minimal-view vlc instance.

Bi-directional AUTOSKIP, skips file automatically with respect to Next/Previous button press. Also actively checks if NowPlaying file is flagged for autoSkip,for when playback ends & next file comes up.

Search And Play Files/Paths button, to allow input of search string in browser UI,to only play files/paths that match search string.Preserves Search history for 20 of the last search strings. Up to three space delimited strings can be provided where each space is considered an 'AND' logical operator,if more than three spaces are in given search string,entire sequence will be considered a single search term.

Un/Bookmark now playing file, to play back only bookmarked files at a later time.

Config - section/button for easy addition of media folders,monitor switching buttons on/off,fwd/rwd multiplier settings,demo folders on/off,error message suppression on/off & quick access to config file/working dir.

OSD for on-screen notification.

Browser Interface NowPlaying notification, with context sensitive CurrentVolume notification only when volume is in/decreased.

Monitor Switching,buttons appear only when two monitors are detected,can be manually enabled from config,if display is not automatically detected.

VLC Error Message automatic suppression,can be disable or enabled in config. Includes suppression of 'Broken AVI Index files',tries to play the file with out building index.
Outsourcing Clicks & Presses Since 2004.
User avatar
jeeswg
Posts: 4488
Joined: 19 Dec 2016, 01:58
Location: UK

Re: PotPlayer x64 Function Library

17 Mar 2018, 05:23

- Media Player Classic is one of most powerful media players out there, and plays very nicely with AutoHotkey for automation, anybody who uses a media player or AutoHotkey should try it out.
jeeswg's Media Player Classic tutorial - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=74&t=41683
- Also, when automating media players, consider Acc. If AccViewer can retrieve info about the control/element, then you should be able to retrieve it via Acc. Also you can 'click' buttons by using Acc.ahk and accDoDefaultAction.
Acc library (MSAA) and AccViewer download links - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=6&t=26201
x32
Posts: 61
Joined: 25 Nov 2016, 16:44

Re: PotPlayer x64 Function Library

17 Mar 2018, 08:11

jeeswg wrote:- Media Player Classic is one of most powerful media players out there, and plays very nicely with AutoHotkey for automation, anybody who uses a media player or AutoHotkey should try it out.


I do have MPC HC but still prefer VLC. I wrote a MPCHC library quite a while back and just reposted on these forums.
https://autohotkey.com/boards/viewtopic.php?f=6&t=45755

Return to “Scripts and Functions”

Who is online

Users browsing this forum: IOrot and 13 guests