Code
Procedure.l StreamPlay(URL.s) ;- Start RadioStream-Output
Protected Browser.IWebBrowser2
Protected Document.IHTMLDocument2
Protected DocumentDispatch.IDispatch
Protected result.l, Busy.l, Unicode.s, bstr_string.l, *sfArray, *varParam.VARIANT
Protected Html.s, WebGad
;erstmal HTML-Steuerung aufbauen:
Html + "<object id='VIDEO' width='0' height='0'"
Html + "style='position:absolute; left:0; top:0;'"
Html + "classid='clsid:6BF52A52-394A-11d3-B153-00C04F79FAA6'" ;normal video
Html + "type='application/x-oleobject'>"
Html + "<param name='URL' value='" + URL + "'>"
; Html + "<param name='volume' value='" + Str(GetGadgetState(#Volume)) + "'>"
Html + "<param name='StretchToFit' value='true'>"
Html + "<param name='UiMode' value='mini'>"
Html + "<param name='EnableContextMenu' value='false'>"
Html + "</object>"
WebGad=WebGadget(#PB_Any,0,0,0,0,"about:blank",#PB_Web_Mozilla) ;gadget aufbauen...
HideGadget(WebGad,1) ;... und gleich verstecken
Browser = GetWindowLong_(GadgetID(WebGad), #GWL_USERDATA)
Repeat ;warten, bis browser bereit...
While WindowEvent(): Wend
Browser\get_Busy(@Busy)
If Busy : Delay(10) : EndIf
Until Not Busy
If Browser
If Browser\get_document(@DocumentDispatch) = #S_OK And DocumentDispatch
If DocumentDispatch\QueryInterface(?IID_IHTMLDocument2, @Document) = #S_OK
If Document
Unicode = Space(Len(Html) * 2 + 2)
PokeS(@Unicode, Html, - 1, #PB_Unicode)
bstr_string = SysAllocString_(@Unicode)
*sfArray = SafeArrayCreateVector_(#VT_VARIANT, 0, 1)
If *sfArray
If SafeArrayAccessData_(*sfArray, @*varParam) = #S_OK
*varParam\vt = #VT_BSTR
*varParam\bstrVal = bstr_string
If SafeArrayUnaccessData_(*sfArray) = #S_OK
Document\write(*sfArray)
result = #True ;Document written
EndIf
EndIf
SafeArrayDestroy_(*sfArray)
EndIf
SysFreeString_(bstr_string)
EndIf
Document\close()
Document\Release()
EndIf
DocumentDispatch\Release()
EndIf
EndIf
ProcedureReturn result
DataSection
IID_IHTMLDocument2: ;{332C4425-26CB-11D0-B483-00C04FD90119}
Data.l $332C4425
Data.w $26CB, $11D0
Data.b $B4, $83, $00, $C0, $4F, $D9, $01, $19
EndDataSection
EndProcedure
WinID=OpenWindow(0,0,0,0,0,"Radio",#PB_Window_SystemMenu|#PB_Window_ScreenCentered)
CreateGadgetList(WinID)
StreamPlay("http://ice.streaming.spacenet.de:80/dieneue1077_80er")
Repeat : Until WaitWindowEvent()=#PB_Event_CloseWindow