 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
BoBoł Guest
|
Posted: Tue Sep 22, 2009 6:54 am Post subject: Remove comercials from video stream with COM (+COMSkip) |
|
|
I've to point to [SEANs thread here] where I've already posted.
Looks like a minor issue (missing parameter or something).
(The real) pros will need half a minute (in average) to get it (lets place a bet )
Unfortunately its above my head
Help would be much appreciated. Thx  |
|
| Back to top |
|
 |
YMP
Joined: 23 Dec 2006 Posts: 418 Location: Russia
|
Posted: Tue Sep 22, 2009 11:21 am Post subject: |
|
|
| You probably confused CreateObject with COM_CreateObject. As for WMPlayer.OCX, it's a ProgID, not a file name. You can find it in the registry. |
|
| Back to top |
|
 |
BoBoł Guest
|
Posted: Tue Sep 22, 2009 11:36 am Post subject: |
|
|
| Quote: | | You probably confused CreateObject with COM_CreateObject. As for WMPlayer.OCX, it's a ProgID, not a file name | Well, I used it without any change made. A steal from SEANs thread 'as-is' (I linked to it above, btw)
| Code: | #Include IEControl.ahk
sUrl := "C:\WINDOWS\clock.avi" ; Replace it with your media file.
GoSub, GuiStart
Gui, +Resize +LastFound
Gui, Show, w800 h600 Center, WMP
hGui := WinExist()
pwmp := CreateObject("WMPlayer.OCX")
AtlAxAttachControl(pwmp, hGui)
Invoke(pwmp, "URL=", sUrl)
Invoke(pwmp, "Play")
Sleep, 1000
pmda := Invoke(pwmp, "CurrentMedia")
name := Invoke(pmda, "Name")
duration := Invoke(pmda, "durationString")
Sleep, 2000
pctl := Invoke(pwmp, "controls")
Position := Invoke(pctl, "currentPosition")
Invoke(pctl, "currentPosition=", Position+6)
Return
GuiStart:
CoInitialize()
AtlAxWinInit()
Return
GuiClose:
Gui, Destroy
Release(pctl)
Release(pmda)
Release(pwmp)
AtlAxWinTerm()
CoUninitialize()
ExitApp |
 |
|
| Back to top |
|
 |
YMP
Joined: 23 Dec 2006 Posts: 418 Location: Russia
|
Posted: Tue Sep 22, 2009 12:54 pm Post subject: |
|
|
Well, I could not find IEControl.ahk.
| Sean wrote: | This is a standard library for IE/WebBrowser controls.
REDIRECT. IE.ahk is now retired. Code it using COM Standard Library. |
And COM Standard Library (COM.ahk) has the function COM_CreateObject, not CreateObject. |
|
| Back to top |
|
 |
BoBoł Guest
|
Posted: Tue Sep 22, 2009 1:22 pm Post subject: |
|
|
I'll check this out. Me myself & I have each of those libraries* available, so this shouldn't have been a show-stopper (there was no error message about a false OR missing function!)?
*
IE.ahk
IEControl.ahk
CoHelper.ahk
COM.ahk
ACC.ahk
... |
|
| Back to top |
|
 |
BoBoł Guest
|
Posted: Tue Sep 22, 2009 1:48 pm Post subject: |
|
|
Changing to COM.ahk ...
| Code: | #Include IEControl.ahk ; looks like still necessary otherwise it throws out an 'Release(pctl)' error ???
; #Include CoHelper.ahk
#Include COM.ahk
sUrl := "C:\WINDOWS\clock.avi" ; Replace it with your media file.
GoSub, GuiStart
Gui, +Resize +LastFound
Gui, Show, w800 h600 Center, WMP
hGui := WinExist()
pwmp := COM_CreateObject("WMPlayer.OCX")
COM_AtlAxAttachControl(pwmp, hGui)
COM_Invoke(pwmp, "URL=", sUrl)
COM_Invoke(pwmp, "Play")
Sleep, 1000
pmda := COM_Invoke(pwmp, "CurrentMedia")
name := COM_Invoke(pmda, "Name")
duration := COM_Invoke(pmda, "durationString")
Sleep, 2000
pctl := COM_Invoke(pwmp, "controls")
Position := COM_Invoke(pctl, "currentPosition")
COM_Invoke(pctl, "currentPosition=", Position+6)
Return
GuiStart:
COM_CoInitialize()
COM_AtlAxWinInit()
Return
GuiClose:
Gui, Destroy
Release(pctl)
Release(pmda)
Release(pwmp)
COM_AtlAxWinTerm()
COM_CoUninitialize()
ExitApp |
Made it run ! and failed immediately afterwards ...
| Code: | ---------------------------
COM Error Notification
---------------------------
Function Name: "Play"
ERROR: Unknown name.
(0x80020006)
Will Continue?
---------------------------
Yes No
--------------------------- |
| Code: | ---------------------------
COM Error Notification
---------------------------
Function Name: "currentPosition"
ERROR: Does not support a collection.
(0x80020011)
ERROR2: Type mismatch.
(0x80020005)
Will Continue?
---------------------------
Yes No
--------------------------- |
 |
|
| Back to top |
|
 |
YMP
Joined: 23 Dec 2006 Posts: 418 Location: Russia
|
Posted: Tue Sep 22, 2009 3:45 pm Post subject: |
|
|
Why not COM_Release? As for the notifications, I also receive them, however clock.avi seems to show up ok.
Perhaps this script is not fully compatible with COM.ahk, who knows.  |
|
| Back to top |
|
 |
BoBoł Guest
|
Posted: Wed Sep 23, 2009 7:49 am Post subject: |
|
|
I guess SEAN. (100% chance that he does). Looks like he's left the scene  |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|