Jump to content

MPV Player


Cipactli
 Share

Recommended Posts

Have anybody succesfully played around with libmpv for mpv player to embed the player in gui ?

Example of child gui.

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

Local $hGui, $mpv_pid
Local $sStream = "http://distribution.bbb3d.renderfarming.net/video/mp4/bbb_sunflower_1080p_60fps_normal.mp4"

$hGui = GUICreate("MPV Test", 640, 360, -1, -1)
GUISetState(@SW_SHOW)

$mpv_pid = Run(@ScriptDir & '\mpv.exe --wid="' & $hGui & '" "' & $sStream & '"')

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
WEnd

MPV Player and Libmpv can be downloaded at https://mpv.srsfckn.biz/

 

Best Regards

-C

Edited by Cipactli
Link to comment
Share on other sites

Your command Run.... Where is the path of the program that you try to run??? and try before with @SW_SHOW and to debug it add this on your script

While ProcessExists ( $mpv_pid)
                    $_StderrRead = StderrRead ( $mpv_pid )
                    If Not @error And $_StderrRead <> '' Then
                        consolewrite("Error : " & $_StderrRead & @Crlf)
                    EndIf
                    $_StdoutRead = StdoutRead ( $mpv_pid )
                    If Not @error And $_StdoutRead <> '' Then
                        consolewrite("Log: " & $_StdoutRead & @Crlf)
                    EndIf
                Wend

 

Link to comment
Share on other sites

On 15/12/2016 at 8:38 AM, rootx said:

Your command Run.... Where is the path of the program that you try to run??? and try before with @SW_SHOW and to debug it add this on your script

While ProcessExists ( $mpv_pid)
                    $_StderrRead = StderrRead ( $mpv_pid )
                    If Not @error And $_StderrRead <> '' Then
                        consolewrite("Error : " & $_StderrRead & @Crlf)
                    EndIf
                    $_StdoutRead = StdoutRead ( $mpv_pid )
                    If Not @error And $_StdoutRead <> '' Then
                        consolewrite("Log: " & $_StdoutRead & @Crlf)
                    EndIf
                Wend

 

Hello rootx

Thanks for the reply, but i cant use that since there is nothing to read, no console window.

mpv.exe (files) should be placed in script directory for code snippet to work.

--wid=<ID>
On win32, the ID is interpreted as HWND. Pass it as value cast to intptr_t. mpv will create its own window, and set the wid window as parent, like with X11.

 

Edited by Cipactli
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...