Sign in to follow this  
Followers 0

Embedded media player

3 posts in this topic

; Author:   Kåre Johansson
; Description: Very Simple example: Embedding "WMPlayer.OCX.7" => "wmp.dll" Latest rev, 11
; Date: 2.9.07
; The application automatically grows/shrinks to fit the specified object width and height, although
; the video itself will not automatically grow beyond 100%.

#include <GUIConstants.au3>
;#include <words.au3>

Global $oRP = ObjCreate("WMPlayer.OCX.7")
If Not IsObj($oRP) Then; check component
    MsgBox(48,"ERROR...","object failed")
Global $colCDROMs = $oRP.cdromCollection; DVD collection function
if $colCDROMs.Count >= 1 then
        For $i = 0 to $colCDROMs.Count - 1
$GUI = GUICreate ("Embedded Medieplayer control Test", 570, 500, -1, -1,BitOr($WS_OVERLAPPEDWINDOW,$WS_VISIBLE,$WS_CLIPSIBLINGS))
;Guisetbkcolor(0, $GUI )
$TagsPageC = GuiCtrlCreateLabel('Visit Commands Page', 5, 405, 150, 15, $SS_CENTER)

Global $GUIActiveX  = GUICtrlCreateObj( $oRP, 10, 10 , 600 , 385 )
Global $oRPEvt = ObjEvent($oRP,"MediaPlayer_")

With $oRP; Object tag pool
    .fullScreen = True
    .windowlessVideo = True
    .stretchToFit = True
    .URL = "C:\Documents and Settings\user\Desktop\Test.wav" ;"Test.wmv"; example: 'g:\Video\Madrid.wmv'
    .enableContextMenu = True
    ;.enabled = False
    .Controls.currentPosition = 0; move to location in movie
    If .controls.isAvailable("fastForward") Then .controls.fastForward
    If .controls.isAvailable("fastReverse") Then .controls.fastReverse
    ;.Controls.Play ;/ pause and Stop
    ;.Controls.Pause ;/ pause and Stop
    .Controls.Stop;/ pause and Stop
    .uiMode = "Full"; none / mini full
    ;.uiMode = "invisible"; to make invisible
    .settings.autostart = True
    .settings.mute = False
    .settings.volume = 50; 0 - 100
    .settings.Balance = 0; -100 to 100

GUISetState();Show GUI
While 1
    $msg = GUIGetMsg()
    Consolewrite($oRP.controls.currentPosition & @CRLF); display current position in movie
    Consolewrite($oRP.currentMedia.duration & @CRLF); duration of movie
    Consolewrite($oRP.controls.currentPositionString & @CRLF); Returns HH:MM:SS
    Consolewrite($oRP.currentMedia.durationString & @CRLF); Returns HH:MM:SS
        Case $msg = $GUI_EVENT_CLOSE
        Case $msg = $TagsPageC
            Run(@ComSpec & ' /c start{6BF52A52-394A-11d3-B153-00C04F79FAA6}','', @SW_HIDE)

GUIDelete ()
$oRP = 0; Free the compoment

; Event function tricks when double click the mouse
Func MediaPlayer_DoubleClick($Button, $ShiftState, $fX, $fY) ;MediaPlayer_Click
    If $oRP.playState = 3 Then
        $oRP.Controls.Pause; pause
        With $oRP
            .Controls.Play; Play
            If .settings.IsAvailable('Rate') Then .settings.rate = 1; check settings and speedup movie if this is an option
            ;.Controls.currentPosition = 60 


This is a script from the forum which uses ObjCreate("WMPlayer.OCX.7")

No matter what I do I cannot increase the size of the player in my GUI. Is it not possible to increase its size.

Another question is whether it is possible to hide the video or visualization window and show only the controls.

Link to uiMode property My link

Please help me someone



Share this post

Link to post
Share on other sites

I assume by now it is not possible.


Share this post

Link to post
Share on other sites

#3 ·  Posted (edited)

just a thought, first try to start some movie before you try to change size of the screen

There is one nice example on WMP that maby can help you

Windows Media Player udf

Edited by bogQ

TCP server and client - Learning about TCP servers and clients connection
Au3 oIrrlicht - Irrlicht project
Au3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related)

There are those that believe that the perfect heist lies in the preparation.
Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost.


Share this post

Link to post
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
Sign in to follow this  
Followers 0