Code: Select all
// NOTE v8.prg
#include "FiveWin.ch"
#define HKEY_LOCAL_MACHINE 2147483650
Function Main()
Local oWnd, oBar, oFont, oActiveX, oCombo, nCombo := 1
INTER_APP_WEB_CONFIG()
DEFINE FONT oFont NAME "Arial" SIZE 0, -12
DEFINE WINDOW oWnd TITLE "ISS live ustream TESTE"
DEFINE BUTTONBAR oBar SIZE 33, 33 OF oWnd
DEFINE BUTTON OF oBar FILE "..\bitmaps\window.bmp" ;
MESSAGE "ISS live ustream" ;
ACTION ( oActiveX:Do("Navigate2", Link(1) ), ;
oWnd:SetText("ISS live ustream"), ;
oWnd:Refresh() )
DEFINE BUTTON OF oBar FILE "..\bitmaps\window.bmp" ;
MESSAGE "ISS live ustream cam2" ;
ACTION ( oActiveX:Do("Navigate2", Link(6)), ;
oWnd:SetText("ISS live ustream"), ;
oWnd:Refresh())
DEFINE BUTTON OF oBar FILE "..\bitmaps\window.bmp" ;
MESSAGE "Tv Diário Ceará" ;
ACTION ( oActiveX:Do("Navigate2", Link(4)), ;
oWnd:SetText("Tv Diário On line do Ceará-BR"), ;
oWnd:Refresh())
DEFINE BUTTON OF oBar FILE "..\bitmaps\Exit.bmp" ;
MESSAGE "Sair" GROUP ACTION ( oWnd:End() )
@ 0.5, 20 COMBOBOX oCombo VAR nCombo ;
ITEMS { "ISS live ustream", "youtube1", "youtube2", "tv diario", ;
"Escuta Aérea GALEÃO Rio", "ISS live ustream cam2" } ;
OF oBar SIZE 160, 200 FONT oFont ;
ON CHANGE (oActiveX:Do("Navigate2", Link(nCombo)), ;
oWnd:SetText("stream No.: "+Alltrim(str(nCombo))), oWnd:Refresh())
oActiveX := TActiveX():New( oWnd, "Shell.Explorer.2" )
oActivex:Silent := .t.
oWnd:oClient := oActiveX
SET MESSAGE OF oWnd TO FWVERSION NOINSET CLOCK DATE KEYBOARD
ACTIVATE WINDOW oWnd ON INIT oActiveX:Do("Navigate2", Link(1))
oFont:End()
Return nil
//------------------------------------------------------------------------------------
Function Link(nlink)
Local cPath, cFile, cHtml := ''
cPath := cFilePath(GetModuleFileName(GetInstance()))
cFile := cPath + "v8.html"
fErase(cFile)
If nlink = 1
cHtml := '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" height="100%" width="100%"><param name="wmode" value="transparent"> '+;
'<param name="flashvars" value="cid=17074538&autoplay=true"><param name="allowfullscreen" value="true"> '+;
'<param name="allowscriptaccess" value="always"><param name="src" value="http://www.ustream.tv/flash/viewer.swf"> '+;
'<embed flashvars="cid=17074538&autoplay=true" allowfullscreen="true" allowscriptaccess="always" src="http://www.ustream.tv/flash/viewer.swf" type="application/x-shockwave-flash" height="100%" width="100%"></object>'
Elseif nLink = 2
cHtml := '<iframe width="100%" height="100%" src="https://www.youtube.com/embed/LcEE8gML8Lg?autoplay=1"></iframe>'
ElseIf nLink = 3
cHtml := '<iframe width="100%" height="100%" src="https://www.youtube.com/embed/lLuc6rtWkrM?autoplay=1"></iframe>'
ElseIf nLink = 4
cHtml := '<iframe allowfullscreen="true" msallowfullscreen="true" webkitallowfullscreen="true" mozallowfullscreen="true" width="100%" height="100%" frameborder="0" src="http://fast.player.liquidplatform.com/pApiv2/embed/7a683b067e5eee5c8d45e1e1883f69b9?title=tvdiario&autoStart=true&enableShare=false&gaAccount=UA-24105952-6&alternateLive=http://slrp.sambavideos.sambatech.com/liveevent/tvdiario_7a683b067e5eee5c8d45e1e1883f69b9/livestream/playlist.m3u8" ></iframe>'
ElseIf nLink = 5
cHtml := '<H2>Escuta Aérea GALEÃO Rio'
cHtml += '<iframe width="100%" height="100%" frameborder="0" src="http://radio.server6.com.br:8282/stream"></iframe>'
Else
cHtml += '<iframe width="100%" height="100%" src="http://www.ustream.tv/embed/9408562?html5ui&autoplay=true" scrolling="no" allowfullscreen webkitallowfullscreen frameborder="0" style="border: 0 none transparent;"></iframe>'
Endif
MemoWrit(cFile, cHtml)
Return cFile
//------------------------------------------------------------------------------------
Function INTER_APP_WEB_CONFIG(nVersionIE)
Local oReg, oRegKey, cRegProgGet, lDeleteKey := .f., cNameProg, uIEver
oReg := TReg32():New( HKEY_LOCAL_MACHINE, "SOFTWARE\Microsoft\Internet Explorer\" )
uIEver := oReg:Get( "svcVersion" )
DEFAULT nVersionIE := If(Left(Alltrim(uIEver),2)="11", 11001, )
DEFAULT cNameProg := Alltrim(cFileName(HB_ARGV(0)))
If IsWow64()
oRegKey := TReg32():New( HKEY_LOCAL_MACHINE, "SOFTWARE\Wow6432Node\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION" )
oRegKey:Set(cNameProg, nVersionIE,4)
oRegKey:Close()
oRegKey := TReg32():New( HKEY_LOCAL_MACHINE, "SOFTWARE\Wow6432Node\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_AJAX_CONNECTIONEVENTS" )
oRegKey:Set(cNameProg,0,4) // Padrão 0
oRegKey:Close()
oRegKey := TReg32():New( HKEY_LOCAL_MACHINE, "SOFTWARE\Wow6432Node\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_ZONE_ELEVATION" )
oRegKey:Set(cNameProg,0,4) // Padrão 1
oRegKey:Close()
oRegKey := TReg32():New( HKEY_LOCAL_MACHINE, "SOFTWARE\Wow6432Node\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_READ_ZONE_STRINGS_FROM_REGISTRY" )
oRegKey:Set(cNameProg,1,4) // Padrão 0
oRegKey:Close()
oRegKey := TReg32():New( HKEY_LOCAL_MACHINE, "SOFTWARE\Wow6432Node\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_BEHAVIORS" )
oRegKey:Set(cNameProg,1,4)
oRegKey:Close()
oRegKey := TReg32():New( HKEY_LOCAL_MACHINE, "SOFTWARE\Wow6432Node\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_ENABLE_WEB_CONTROL_VISUALS" )
oRegKey:Set(cNameProg,1,4)
oRegKey:Close()
oRegKey := TReg32():New( HKEY_LOCAL_MACHINE, "SOFTWARE\Wow6432Node\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_SHOW_APP_PROTOCOL_WARN_DIALOG" )
oRegKey:Set(cNameProg,1,4) // Padrao 0
oRegKey:Close()
oRegKey := TReg32():New( HKEY_LOCAL_MACHINE, "SOFTWARE\Wow6432Node\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_GPU_RENDERING" )
oRegKey:Set(cNameProg,1,4) // Padrao 0
oRegKey:Close()
oRegKey := TReg32():New( HKEY_LOCAL_MACHINE, "SOFTWARE\Wow6432Node\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_NINPUT_LEGACYMODE" )
oRegKey:Set(cNameProg,0,4) // Padrao 1
oRegKey:Close()
Else
oRegKey := TReg32():New( HKEY_LOCAL_MACHINE, "Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION" )
oRegKey:Set(cNameProg, nVersionIE,4)
oRegKey:Close()
oRegKey := TReg32():New( HKEY_LOCAL_MACHINE, "SOFTWARE\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_BEHAVIORS" )
cRegProgGet := oRegKey:GetBinary(cNameProg)
If Empty(cRegProgGet)
oRegKey:Set(cNameProg,1,4)
EndIf
oRegKey:Close()
oRegKey := TReg32():New( HKEY_LOCAL_MACHINE, "SOFTWARE\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_ENABLE_WEB_CONTROL_VISUALS" )
oRegKey:Set(cNameProg,1,4)
oRegKey:Close()
EndIf
Return nil
Saludos.