Jump to content

How to show movie in autoit window?


E1M1
 Share

Recommended Posts

Form1: AutoIt3.exe - Bad Image

D:\downloads\movie\p.avi is either not designed to run on Windows or it contains an error. Try installing the program again using the original installation media or contact your system administrator or the software vendor for support.

but windows media player can play it well.

How I can run that video in autoit window?

or how I can load 2 media players at same once?

I have tried following code but it's too slow. my idea is draw movie not transparent window and another window that plays same movie, then set another window's transparency to 128, and move it to 1st windows's location but with offset. I just thought I could create 3D effect like in chinema..

Run($vlc & " " & $hamlet)

Run($vlc & " " & $hamlet)

edited

Link to comment
Share on other sites

but windows media player can play it well.

How I can run that video in autoit window?

or how I can load 2 media players at same once?

I have tried following code but it's too slow. my idea is draw movie not transparent window and another window that plays same movie, then set another window's transparency to 128, and move it to 1st windows's location but with offset. I just thought I could create 3D effect like in chinema..

Run($vlc & " " & $hamlet)

Run($vlc & " " & $hamlet)

i found this

you can add a WinSetTrans($MyGUI,"",50) and to get the transparency you want, it works rather well.

#include-once

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

#Region Test
Opt('MustDeclareVars', 1); no required
_IEErrorHandlerRegister (); optional error handler
Global $movie = FileOpenDialog("Open a movie or playlist", @MyDocumentsDir, "Movies (*.wpl;*.mpg;*.mpeg;*.wmv;*.avi)", 3)
Global $MyGUI = GUICreate("WMPlayer Control", 330, 250)
Global $oIE = _GUICtrl_CreateWMPlayer($movie, 5, 5, 320, 240)
GUISetState (@SW_SHOW, $MyGUI)

Global $playerOBJ = _IEGetObjById($oIE, "objWMPlayer")
While 1
Sleep(40)
If GUIGetMsg() = $GUI_EVENT_CLOSE Then ExitLoop
Wend
$oIE = ""
#EndRegion Test

;===================================================================================================
; Function: _GUICtrl_CreateWMPlayer
; Purpose: Embed Windows Media Player and play one file or one playlist only.
; Notes: PARAM NAME="url" is ReadOnly
; Authors: squirrely1
; borderless IE embed example: GaryFrost
; Kudos - Kåre Johansson, CFire
; References:
; http://msdn2.microsoft.com/en-us/library/ms930698.aspx
; media/media_playerref.asp' class='bbc_url' title='External link' rel='external'>http://www.w3schools.com/media/media_playerref.asp
; clsid:6BF52A52-394A-11d3-B153-00C04F79FAA6 - wmplayer latest installed version
; clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95 - wmp 6.4
;===================================================================================================





Func _GUICtrl_CreateWMPlayer($movieURL, $playerLeft, $playerTop, $playerWidth, $playerHeight, _
$insetBorders = 0, $fullscreenMode = False, $showControls = False, $enableContextMenu = True, _
$LoopMode = True, $playCount = 1, $playVolume = 100, $playBalance = 0, $enableFullScreenControls = True)

If $fullscreenMode Then
$fullscreenMode = "true"
Else
$fullscreenMode = "false"
EndIf
If $showControls Then
$showControls = "true"
Else
$showControls = "false"
EndIf
If $enableContextMenu Then
$enableContextMenu = "true"
Else
$enableContextMenu = "false"
EndIf
If $LoopMode Then
$playCount = 999
EndIf
If $enableFullScreenControls Then
$enableFullScreenControls = "true"
Else
$enableFullScreenControls = "false"
EndIf

Local $myIE_Obj = _IECreateEmbedded ()
Local $GUIActiveX = GUICtrlCreateObj($myIE_Obj, $playerLeft, $playerTop, $playerWidth, $playerHeight)
_IENavigate($myIE_Obj, "about:blank")
Local $htmlWMP
$htmlWMP = '' _
& @CR & '<body style="margin:0;padding:0">' _
& @CR & '<OBJECT' _
& @CR & 'ID="objWMPlayer"' _
& @CR & 'STYLE="margin:0;padding:0"' _
& @CR & 'HSPACE="0"' _
& @CR & 'VSPACE="0"' _
& @CR & 'BORDER="0"' _
& @CR & 'WIDTH="' & $playerWidth & '"' _
& @CR & 'HEIGHT="' & $playerHeight & '"' _
& @CR & 'CLASSID="clsid:6BF52A52-394A-11D3-B153-00C04F79FAA6"' _
& @CR & 'STANDBY="Loading Windows Media Player components..."' _
& @CR & 'TYPE="application/x-oleobject">' _
& @CR & '<PARAM NAME="allowHideControls" VALUE="true">' _
& @CR & '<PARAM NAME="autoStart" VALUE="true">' _
& @CR & '<PARAM NAME="audioStream" VALUE="false">' _
& @CR & '<PARAM NAME="autoSize" VALUE="true">' _
& @CR & '<PARAM NAME="balance" VALUE="' & $playBalance & '"><!-- -100 to 100 -->' _
& @CR & '<!-- <PARAM NAME="bufferingTime" VALUE="5"><!-- seconds -->' _
& @CR & '<PARAM NAME="clickToPlay" VALUE="false"><!-- has no effect -->' _
& @CR & '<PARAM NAME="currentPosition" VALUE="0"><!-- start position within video, in seconds -->' _
& @CR & '<PARAM NAME="enableContextMenu" VALUE="' & $enableContextMenu & '">' _
& @CR & '<PARAM NAME="enableFullScreenControls" VALUE="' & $enableFullScreenControls & '">' _
& @CR & '<PARAM NAME="enabled" VALUE="true"><!-- whether controls are enabled -->' _
& @CR & '<PARAM NAME="fullScreen" VALUE="' & $fullscreenMode & '">' _
& @CR & '<PARAM NAME="mute" VALUE="false">' _
& @CR & '<PARAM NAME="playCount" VALUE="' & $playCount & '">' _
& @CR & '<!-- <PARAM NAME="previewMode" VALUE="true"> -->' _
& @CR & '<PARAM NAME="rate" VALUE="1"><!-- play speed of -.5 to 2 increments of .1 -->' _
& @CR & '<PARAM NAME="sendPlayStateChangeEvents" VALUE="false">' _
& @CR & '<PARAM NAME="showCaptioning" VALUE="false">' _
& @CR & '<PARAM NAME="showControls" VALUE="' & $showControls & '">' _
& @CR & '<PARAM NAME="showGotoBar" VALUE="false">' _
& @CR & '<PARAM NAME="showPositionControls" VALUE="true"><!-- uiMode must = "full" -->' _
& @CR & '<PARAM NAME="showStatusBar" VALUE="false"><!-- has no effect -->' _
& @CR & '<PARAM NAME="showDisplay" VALUE="true"><!-- has no effect - reportedly shows filename -->' _
& @CR & '<PARAM NAME="stretchToFit" VALUE="true">' _
& @CR & '<PARAM NAME="uiMode" VALUE="none"><!-- invisible, none, mini, full -->' _
& @CR & '<PARAM NAME="url" VALUE="' & $movieURL & '">' _
& @CR & '<!-- <PARAM NAME="videoBorderWidth" VALUE="0"> -->' _
& @CR & '<PARAM NAME="volume" VALUE="' & $playVolume & '"><!-- volume percent setting of wmplayer.exe -->' _
& @CR & '<PARAM NAME="windowlessVideo" VALUE="false"><!-- must be the default (false) for function to work in wmp 9.0, otherwise might renders video directly in the client area -->' _
& @CR & '</OBJECT>' _
& @CR & '</body>'
_IEDocWriteHTML ($myIE_Obj, $htmlWMP)
_IEAction ($myIE_Obj, "refresh")
$myIE_Obj.document.body.scroll = "no"
$myIE_Obj.document.body.style.border = $insetBorders
Return $myIE_Obj
EndFunc ;==>_GUICtrl_CreateWMPlayer
Link to comment
Share on other sites

Thanks, how to make this script load windows mediaplayer with movie so that it won't start playing it? and then how tell script start play already loaded wmp?

Edit: Or how to set set time when movie is started?

Edited by E1M1

edited

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...