Jump to content

Recommended Posts

Posted (edited)

<p>Hi again ive been messing about with Live flash streams using AutoIt and i was just wondering if i was doing it the right way? Or if anyone has any suggestions or improvements.

Edited by evol
Posted

Sorry im using chrome and its stewing my posts up when i tried to edit my post. Here it is again

#include <GUIConstantsEx.au3>
HotKeySet('{ESC}', '_Close')
Opt('GUIOnEventMode', 1)
Global $hGUI, $FlashCtrl
Global $oFlash
Global $fError = False
$hGUI = GUICreate('Live Flash(RTMP) Stream Test', 645, 485)
$oFlash = ObjCreate("ShockwaveFlash.ShockwaveFlash.11")
$oAutoItError = ObjEvent("AutoIt.Error", "COMError")
$FlashCtrl = GUICtrlCreateObj($oFlash, 0, 0, 645, 485)
GUISetOnEvent($GUI_EVENT_CLOSE, '_Close')
With $oFlash
; live tv stream string here......
.movie = "http://www.price-drop.tv/jwplayer/player.swf?" & _ ; A random flash SWF Player borrowed from price drop tv.
   "file=dave_22272.sdp"          ; Live UK TV channel Dave.
.flashvars = "streamer=rtmp://rtsp-02.g-box.tv/tv2mobile&" & _ ; RTMP Stream.
   "autostart=true&" & _
   "fullscreen=true&" & _
   "smoothing=false&" & _
   "backcolor=0x000000&" & _
   "frontcolor=0xF8F8FF&" & _
   "lightcolor=0xE0E0E0"
.wmode = "opaque"
.allowScriptAccess = "Always"
.Playing = True
EndWith
GUISetState()
While 1
Sleep(10)
WEnd
Func _Close()
$oFlash.Stop()
$oFlash = 0
GUIDelete()
Exit
EndFunc   ;==>_Close
Func COMError()
$fError = True
EndFunc   ;==>COMError
Posted

As with all objects, you should test they exist first.

I got the error and had to modify the script

So for example I changed one line to this.

$oFlash = ObjCreate("ShockwaveFlash.ShockwaveFlash.10")
If Not IsObj($oFlash) Then
    Exit MsgBox(0,"Object Error",@ScriptLineNumber)
EndIf

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Posted

As with all objects, you should test they exist first.

I got the error and had to modify the script

So for example I changed one line to this.

$oFlash = ObjCreate("ShockwaveFlash.ShockwaveFlash.10")
If Not IsObj($oFlash) Then
    Exit MsgBox(0,"Object Error",@ScriptLineNumber)
EndIf

Thanks for the tip, funny thing is i was going to do exactly that but it worked for me so i just left it at that.will do than now though from now on. ;)

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
×
×
  • Create New...