Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 03/15/2022 in all areas

  1. MattyD

    Media Player Embedding

    Hi all, Not to encroach on CYCho's zPlayer - I've just gove to upload this and found another example at the top. (looks good by the way!) Mine is just a proof of concept anyhow. The main problem here is that when you load a video with the WMP control, there is no obvoius way to scale the video down from its native resoultion. After a lot of searching I found you can use SetObjectRects fuction on the IOleInPlaceObj interface - but in AutoIt we first need to create this. $oWMP = ObjCreate("WMPlayer.OCX") GUICtrlCreateObj($oWMP, 0, 0, 400, 400) $oIInPlaceObj = _CreateInPlaceObjInterface($oWMP) $oIInPlaceObj.SetObjectRects($pRect1, $pRect2) ;Resizes the control Func _CreateInPlaceObjInterface($oObject) Local $oIInPlaceObj, $tagIOleInPlaceObj $tagIOleInPlaceObj = _ "ContextSensitiveHelp none(int); " & _ "GetWindow none(ptr); " & _ "InPlaceDeactivate none(); " & _ "ReactivateAndUndo none(); " & _ "SetObjectRects none(ptr; ptr;); " & _ "UIDeactivate none();" $oIInPlaceObj = ObjCreateInterface($oObject, "{00000113-0000-0000-C000-000000000046}", $tagIOleInPlaceObj) If Not IsObj($oIInPlaceObj) Then Return SetError(1, False) Return $oIInPlaceObj EndFunc Hope this saves someone a bit of pain! Just for completeness, it looks like some people have solved the resizing problem by embedding the player in HTML. I haven't really looked at this method but it does seem to work! Anyway, here's a bare bones build-your-own media player example. (use the WMP_v1.au3 like a UDF) Function List: Limitations onEventMode is forced. only one instance of the player is supported. WMP ActiveX Control... _MP_Create($ix, $iy, $iw, $ih) _MP_Resize($ix, $iy, $iw, $ih) load a single media item _MP_LoadMedia($sPath) playlist _MP_PlaylistSelItem($iIndex) _MP_PlaylistAdd($sPath) GUI Controls.... _MP_CtrlCreatePlayPause($ix, $iy, $iw, $ih) _MP_CtrlCreateStop($ix, $iy, $iw, $ih) _MP_CtrlCreateRewind($ix, $iy, $iw, $ih) _MP_CtrlCreateFastFwd($ix, $iy, $iw, $ih) _MP_CtrlCreatePrevious($ix, $iy, $iw, $ih) _MP_CtrlCreateNext($ix, $iy, $iw, $ih) _MP_CtrlCreateShuffle($ix, $iy, $iw, $ih) _MP_CtrlCreateLoop($ix, $iy, $iw, $ih) _MP_CtrlCreateMute($ix, $iy, $iw, $ih) _MP_CtrlCreateVolume($ix, $iy, $iw, $ih) _MP_CtrlCreateFullScreen($ix, $iy, $iw, $ih) _MP_CtrlCreateTransport($ix, $iy, $iw, $ih) _MP_CtrlCreatePlayList($ix, $iy, $iw, $ih) Otherwise just call these... _MP_PlayPause() _MP_Stop() _MP_Rewind() _MP_FastFwd() _MP_Previous() _MP_Next() _MP_Shuffle() _MP_Loop() _MP_Mute() _MP_FullScreen() Demo.au3 WMP_v1.au3
    1 point
  2. You're right, my blindness. Sorry.
    1 point
  3. Use code tags when you post code. Post console error messages. Take a look few post back, we was discuss the same things, and there are examples.
    1 point
  4. Why not just use <a> tag + <img> tag for example: $oIE.document.write('<body style="margin:0;border:none"><a href="https://www.autoitscript.com/" target="_blank"><img width="100%" height="100%" src="' & $sGIF & '" alt="AutoIt" style="border:none"></a></body>') The issue is that you're trying to display the image within iframe, the iframe is outside the scope of your pages css, if you open the image in a browser you'll notice that it's rendered with margin + border.
    1 point
  5. I am needing help with 3 errors I am getting in my code. Cannot read properties of undefined (reading 'inCart' ) I have attached Screenshots of the error codes and the text of code for site. . . Please help............................. main1.js Script.txt
    1 point
  6. @BalanceOfPower Why would you post in an AutoIt forum, for a javascript question?
    1 point
  7. The summum of cleanestery : Local $aListList[4] = [$aFileList1, $aFileList2, $aFileList3, $aFileList4] For $aArray In $aListList For $sText In $aArray ConsoleWrite($sText) Next Next
    1 point
  8. For your reference I would take the approach with a function as was given You do not have to give a dimension for your arrays You do not have to put a separate variable $aFilelist on a separate line ($aListList[$iList])[$iFile] with opening/closing brace will do the trick See full example below #include <Array.au3> ;File List One - Four Local $aFileList1[]= ["A" ,"B" ,"C" ,"D"] Local $aFileList2[] = ["E" ,"F" ,"G"] Local $aFileList3[] = ["H" ,"I"] Local $aFileList4[] = ["J" ,"K" ,"L" ,"M" ,"N" ,"O" ,"P" ,"Q" ,"R" ,"S" ,"T" ,"U"] local $aListList[]=[$aFileList1,$aFileList2,$aFileList3, $aFileList4] example1() example2() func example1() ; Option 1: ; For each list For $iList=0 To UBound($aListList) - 1 ; For each file in the list For $iFile = 0 To UBound($aListList[$iList]) - 1 $sFile = ($aListList[$iList])[$iFile] ConsoleWrite($sFile & @CRLF) Next ConsoleWrite("Save Book" & @CRLF) Next EndFunc func example2() ;~ Option 2 with function ; For each list For $iList=0 To UBound($aListList) - 1 mergeMyArray($aListList[$iList]) Next EndFunc func mergeMyArray($aFileList) ; For each file in the list For $iFile = 0 To UBound($aFileList) - 1 $sFile = $aFileList[$iFile] ConsoleWrite($sFile & @CRLF) Next ConsoleWrite("Save Book" & @CRLF) EndFunc
    1 point
  9. @ARPFre You could also set the default startup tab for taskmanager in its' Options menu, or manipulate the registry where it saves it's options: in HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\TaskManager Modify the REG_DWORD named StartUpTab Values range from 0 to 6 for tabs from left to right. (checked this on Win 10 21H2)
    1 point
×
×
  • Create New...