AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Remove comercials from video stream with COM (+COMSkip)

 
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
BoBoł
Guest





PostPosted: Tue Sep 22, 2009 6:54 am    Post subject: Remove comercials from video stream with COM (+COMSkip) Reply with quote

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 Smile)
Unfortunately its above my head Sad

Help would be much appreciated. Thx Cool
Back to top
YMP



Joined: 23 Dec 2006
Posts: 418
Location: Russia

PostPosted: Tue Sep 22, 2009 11:21 am    Post subject: Reply with quote

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
View user's profile Send private message
BoBoł
Guest





PostPosted: Tue Sep 22, 2009 11:36 am    Post subject: Reply with quote

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) Shocked

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

Question
Back to top
YMP



Joined: 23 Dec 2006
Posts: 418
Location: Russia

PostPosted: Tue Sep 22, 2009 12:54 pm    Post subject: Reply with quote

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
View user's profile Send private message
BoBoł
Guest





PostPosted: Tue Sep 22, 2009 1:22 pm    Post subject: Reply with quote

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





PostPosted: Tue Sep 22, 2009 1:48 pm    Post subject: Reply with quote

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 ! Very Happy and failed immediately afterwards Crying or Very sad ...

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

Question Sad
Back to top
YMP



Joined: 23 Dec 2006
Posts: 418
Location: Russia

PostPosted: Tue Sep 22, 2009 3:45 pm    Post subject: Reply with quote

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. Rolling Eyes
Back to top
View user's profile Send private message
BoBoł
Guest





PostPosted: Wed Sep 23, 2009 7:49 am    Post subject: Reply with quote

Quote:
who knows.
I guess SEAN. (100% chance that he does). Looks like he's left the scene Shocked
Back to top
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group