Clipper On Line • Ver Tópico - Execute um vídeo incorporado do YouTube com o ActiveX

Execute um vídeo incorporado do YouTube com o ActiveX

Discussão sobre a biblioteca Fivewin - O Clipper para Windows.

Moderador: Moderadores

 

Execute um vídeo incorporado do YouTube com o ActiveX

Mensagempor Kapiaba » 07 Dez 2017 14:52

#include "fivewin.ch"

STATIC oWnd

#define  HKEY_LOCAL_MACHINE      2147483650

FUNCTION Ejemplo()

   local oWndChild, oActiveX
   local cFile, cPath, cHtml

   cHtml := ''
   cHtml += '<html>' + CRLF
   cHtml += '<body>' + CRLF
   cHtml += '<div id="vid" align="center">' + CRLF
   cHtml += '<iframe width="560" height="315" src="https://www.youtube.com/embed/i93Z7zljQ7I" frameborder="0" gesture="media" allow="encrypted-media" allowfullscreen></iframe>' + CRLF
   cHtml += '</div>' + CRLF
   cHtml += '</body>' + CRLF
   cHtml += '</html>' + CRLF
   cHtml += CRLF

   cPath := cFilePath(GetModuleFileName(GetInstance()))

   cFile := cPath + "video.html"

   FErase(cFile)
   MemoWrit( cFile, cHtml )

   /*
   http://fivewin.com.br/index.php?/topic/27339-problema-na-busca-do-cnpj-site-da-receita/

   http://forums.fivetechsupport.com/viewtopic.php?f=6&t=34901
   */
   INTER_APP_WEB_CONFIG("VIDEOAC.exe",11001)

   DEFINE WINDOW oWnd TITLE "Video"

   oActiveX := TActiveX():New( oWnd, "Shell.Explorer.2" )

   oActivex:Silent := .T.
   oActivex:SetFocus()

   oWnd:oClient := oActiveX
   oWnd:Resize()

   oActiveX:Do( "Navigate2", cFile )

   ACTIVATE WINDOW oWnd

RETURN NIL
/*
Parametrize seu programa com a versão do seu navegador atual.

Ex: se seu navegador for iexplorer 11 coloque assim

INTER_APP_WEB_CONFIG("SeuPrograma.exe",11001)
*/

FUNCTION INTER_APP_WEB_CONFIG(f_cNameProg,f_nVersion_IE)

   Local oRegKey, cRegProgGet, lDeleteKey := .f.
 
   Default f_nVersion_IE := 11001

   if IsWow64()
   
      oRegKey := TReg32():New( HKEY_LOCAL_MACHINE,;
           "SOFTWARE\Wow6432Node\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION" )
      oRegKey:Set(f_cNameProg,f_nVersion_IE,4)
      oRegKey:Close()

      oRegKey := TReg32():New( HKEY_LOCAL_MACHINE,;
           "SOFTWARE\Wow6432Node\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_AJAX_CONNECTIONEVENTS" )
      oRegKey:Set(f_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(f_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(f_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(f_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(f_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(f_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(f_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(f_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(f_cNameProg,f_nVersion_IE,4)
      oRegKey:Close()

      oRegKey := TReg32():New( HKEY_LOCAL_MACHINE,;
           "SOFTWARE\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_BEHAVIORS" )
      cRegProgGet := oRegKey:GetBinary(f_cNameProg)
      //? cRegProgGet
      If Empty(cRegProgGet)
        oRegKey:Set(f_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(f_cNameProg,1,4)
      oRegKey:Close()

   EndIf

RETURN NIL
Kapiaba
Colaborador

Colaborador
 
Mensagens: 1475
Data de registro: 07 Dez 2012 15:14
Cidade/Estado: São Paulo
Curtiu: 284 vezes
Mens.Curtidas: 89 vezes

Execute um vídeo incorporado do YouTube com o ActiveX

Mensagempor Kapiaba » 07 Dez 2017 15:21

Kapiaba
Colaborador

Colaborador
 
Mensagens: 1475
Data de registro: 07 Dez 2012 15:14
Cidade/Estado: São Paulo
Curtiu: 284 vezes
Mens.Curtidas: 89 vezes

Execute um vídeo incorporado do YouTube com o ActiveX

Mensagempor Kapiaba » 18 Dez 2017 10:40

// Very good, many thanks!

New Version:

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


Abs.
Kapiaba
Colaborador

Colaborador
 
Mensagens: 1475
Data de registro: 07 Dez 2012 15:14
Cidade/Estado: São Paulo
Curtiu: 284 vezes
Mens.Curtidas: 89 vezes




Retornar para FiveWin

Quem está online

Usuários vendo este fórum: Google [Bot] e 1 visitante


Faça uma doação para o forum
v
Olá visitante, seja bem-vindo ao Fórum Clipper On Line!
Efetue o seu login ou faça o seu Registro