Jump to content

Search the Community

Showing results for tags 'embedded wmp'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Announcements and Site News
    • Administration
  • AutoIt v3
    • AutoIt Help and Support
    • AutoIt Technical Discussion
    • AutoIt Example Scripts
  • Scripting and Development
    • Developer General Discussion
    • Language Specific Discussion
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • AutoIt Team
    • Beta
    • MVP
  • AutoIt
    • Automation
    • Databases and web connections
    • Data compression
    • Encryption and hash
    • Games
    • GUI Additions
    • Hardware
    • Information gathering
    • Internet protocol suite
    • Maths
    • Media
    • PDF
    • Security
    • Social Media and other Website API
    • Windows
  • Scripting and Development
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Location


WWW


Interests

Found 2 results

  1. Hi there! I wish every one of you to be healthy and happy. I made the following code borrowing mainly from @dragan's post. #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <IE.au3> Global $mainGUI = GUICreate("Load and play a video file", 400, 200, -1, -1) Global $inputFile = GUICtrlCreateInput("", 20, 50, 280, 20) Global $btnLoad = GUICtrlCreateButton("Load", 300, 48, 80, 23) Global $btnPlay = GUICtrlCreateButton("Play", 160, 100, 80, 23) GUISetState() Global $videoHeight = @DesktopHeight/2, $videoWidth = $videoHeight, $videoLeft = @DesktopWidth-$videoWidth, $IEControl Global $videoGUI = GUICreate("Video Control", $videoWidth, $videoHeight, $videoLeft, 0, $WS_OVERLAPPEDWINDOW) Global $oIE = _GUICtrl_CreateWMPlayer() GUISetState (@SW_HIDE, $videoGUI) GUIRegisterMsg($WM_SIZE, "WM_SIZE") Global $oPlayer = _IEGetObjById($oIE, "objWMPlayer") Global $aMsg While 1 $aMsg = GUIGetMsg(1) If $aMsg[1] = $mainGUI Then If $aMsg[0] = $GUI_EVENT_CLOSE Then Exit ElseIf $aMsg[0] = $btnLoad Then Local $sFile = FileOpenDialog("Open Videos", @UserProfileDir, "Movies (*.3gp;*.mp4;*.avi;*.wmv;*.flv)") GUICtrlSetData($inputFile, $sFile) If @error Then Exit ElseIf $aMsg[0] = $btnPlay Then GUISetState(@SW_SHOW, $videoGUI) $oPlayer.URL = $sFile $oPlayer.Controls.Play While $oPlayer.playState <> 3 Sleep(10) WEnd Local $sWidth = $oPlayer.currentMedia.imageSourceWidth, $sHeight = $oPlayer.currentMedia.imageSourceHeight If $sWidth > 0 Then Local $iWidth = $videoHeight*$sWidth/$sHeight WinMove($videoGUI, "", @DesktopWidth-$iWidth, 0, $iWidth+16, $videoHeight+39) EndIf EndIf ElseIf $aMsg[1] = $videoGUI And $aMsg[0] = $GUI_EVENT_CLOSE Then $oPlayer.Controls.Stop GUISetState (@SW_HIDE, $videoGUI) ContinueLoop ElseIf $oPlayer.playState = 1 Or $oPlayer.playState = 8 Then GUISetState (@SW_HIDE, $videoGUI) ContinueLoop EndIf WEnd Func WM_SIZE($hWnd, $iMsg, $iwParam, $ilParam) #forceref $hWnd, $iMsg, $iwParam, $ilParam Local $xClient, $yClient $xClient = BitAND($ilParam, 0x0000FFFF) $yClient = BitShift($ilParam, 16) GUICtrlSetPos($IEControl, 0, 0, $xClient, $yClient) if NOT @error Then if IsObj($oPlayer) Then $oPlayer.width = $xClient; if IsObj($oPlayer) Then $oPlayer.height = $yClient; EndIf Return $GUI_RUNDEFMSG EndFunc Func _GUICtrl_CreateWMPlayer() Local $myIE_Obj = _IECreateEmbedded () $IEControl = GUICtrlCreateObj($myIE_Obj, 0, 0, $videoWidth, $videoHeight) _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="' & $videoWidth & '"' _ & @CR & 'HEIGHT="' & $videoHeight & '"' _ & @CR & 'CLASSID="clsid:6BF52A52-394A-11D3-B153-00C04F79FAA6"' _ & @CR & 'STANDBY="Loading Windows Media Player components..."' _ & @CR & 'TYPE="application/x-ms-wmp">' _ & @CR & '<PARAM NAME="enableContextMenu" VALUE="true">' _ & @CR & '<PARAM NAME="enableFullScreenControls" VALUE="true">' _ & @CR & '<PARAM NAME="enabled" VALUE="true">' _ & @CR & '<PARAM NAME="playCount" VALUE="1">' _ & @CR & '<PARAM NAME="stretchToFit" VALUE="true">' _ & @CR & '<PARAM NAME="uiMode" VALUE="none">' _ & @CR & '<PARAM NAME="videoBorderWidth" VALUE="5">' _ & @CR & '<PARAM NAME="volume" VALUE="100">' _ & @CR & '<PARAM NAME="windowlessVideo" VALUE="false">' _ & @CR & '</OBJECT>' _ & @CR & '</body>' _IEDocWriteHTML ($myIE_Obj, $htmlWMP) _IEAction ($myIE_Obj, "refresh") $myIE_Obj.document.body.scroll = "no" $myIE_Obj.document.body.style.borderColor = "#000000" Return $myIE_Obj EndFunc ;==>_GUICtrl_CreateWMPlayer This works usually OK, but the embedded WMP behaves abnormally when the 2 windows are minimized and restored depending on which one is minimized and restored first. While video is playing: 1. Minimize $mainGUI, then the $videoGUI becomes blank. 2. Minimize both and restore $videoGUI first and then the $mainGUI, then the video size in the $videoGUI is changed to it's original source image size. Please help me to understand what is the cause of this behaviour and how I can prevent it. Thnaks in advance.
  2. I'm having a issue loading new media to the embedded wmp. on line 127 GUI code.zip
×
×
  • Create New...