Jump to content

Embedded media player


ajit
 Share

Recommended Posts

; 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")
    Exit
EndIf
#cs
Global $colCDROMs = $oRP.cdromCollection; DVD collection function
if $colCDROMs.Count >= 1 then
        For $i = 0 to $colCDROMs.Count - 1
                $colCDROMs.Item($i).Eject
        Next
EndIf
#ce
Local $WS_OVERLAPPEDWINDOW,$WS_VISIBLE,$WS_CLIPSIBLINGS, $SS_CENTER
$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)
GuiCtrlSetFont(-1,9,400,4)
GuiCtrlSetColor(-1,0x0000ff)
GuiCtrlSetCursor(-1,0)

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
EndWith


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
    
    
    Select
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
        Case $msg = $TagsPageC
            Run(@ComSpec & ' /c start http://www.myplugins.info/guids/typeinfo/typeinfo.php?clsid={6BF52A52-394A-11d3-B153-00C04F79FAA6}','', @SW_HIDE)
    EndSelect
WEnd

GUIDelete ()
$oRP = 0; Free the compoment
Exit

; 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
    Else
        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 
        EndWith
    Endif
EndFunc

Hi:

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

Regards

Ajit

Link to comment
Share on other sites

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)



460px-Thief-4-temp-banner.jpg
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.

 
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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...