Histórico da Página
Composition Setup |
---|
import.css=/download/attachments/3279126062824/newLayouttecnologia.css |
|
Pagetitle |
---|
...
|
...
...
|
Cria um objeto para reprodução de vídeos e áudios.
Hierarquia
- TControl
- TMediaPlayer
Construtores
Inclusão de trecho | ||||||
---|---|---|---|---|---|---|
|
Propriedades
Inclusão de trecho | ||||||
---|---|---|---|---|---|---|
|
Métodos
Inclusão de trecho | ||||||
---|---|---|---|---|---|---|
|
Observações
Este componente utiliza tecnologia ActiveX, através do Windows Media Player®, desta forma estando homologado apenas para os sistema operacionas da Microsoft®, dentre eles:
Windows XP
Windows Vista
Windows 7
Windows 8
O Windows Media
...
Player® pode depender de Codecs específicos para reprodução dos arquivos MP4, como teste basta executar este arquivo diretamente na ferramenta da
...
Microsoft®, caso funcione nesta, a reprodução ocorrera sem problemas no TMediaPlayer.
...
Importante:
...
Este componente está disponível em versões superiores à 120420A.
Nota | ||||
---|---|---|---|---|
| ||||
SmartClient HTML |
Exemplos
Bloco de código | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
#INCLUDE "TOTVS.CH"
USER FUNCTION TMediaPlayer()
TSrvObject -> TControl -> TMediaPlayer
NewMétodo construtor da classe.TMediaPlayer(): New ( [ nRow], [ nCol], [ nWidth], [ nHeight], [ oWnd], [ cFile], [ nVolume], [ lShowBar] ) --> oObjeto
oObjeto
oMedia := TMediaPlayer():New(1, 1, 200, 200, oDlg, "c:/dir/file.mp4", 70, .T.) OpenFile
SetShowBarHabilita a exibição da barra de ferramentas do Windows Media Player®.TMediaPlayer(): SetShowBar( <lShow> ) -->
oMedia:SetShowBar(.T.)
PlayInicia reprodução.
TMediaPlayer():Play() --> oMedia:Play()
StopPara a reprodução.
TMediaPlayer():Stop() --> oMedia:Stop()
PausePausa a reprodução.
TMediaPlayer(): Pause() --> oMedia:Pause() User Function TMedia() local nLeft := 1 local nTopBtn := 202 local lShowBar local showBar := .F. localnVolume isMute :=70 .F. localcFile nVolume :="c:/dir/file.mp3" 70 SetStyle(5) DEFINE MSDIALOG oDlg TITLE "TMediaPlayer" FROM 0,0 TO 424,404 510 PIXEL oMedia := TMediaPlayer():New(1,nLeft,200 255,200,oDlg,cFile "c:/garbage/file.mp4",nVolume,lShowBar) showBar) TButton():New( nTopBtn, nLeft, "Open", oDlg,; {|| oMedia:openFile( FWInputBox("Escolha o arquivo", "c:/garbage/") ) },; 28,010,,,.F.,.T.,.F.,,.F.,,,.F. ) TButton():New( nTopBtn, nLeft+=28, "Play", oDlg,; {|| oMedia:play() },; 28,010,,,.F.,.T.,.F.,,.F.,,,.F. ) TButton():New( nTopBtn, nLeft+=28, "Pause", oDlg,; {|| oMedia:pause() },; 28,010,,,.F.,.T.,.F.,,.F.,,,.F. ) TButton():New( nTopBtn, nLeft+=28, "Stop", oDlg,; {|| oMedia:stop() },; 28,010,,,.F.,.T.,.F.,,.F.,,,.F. ) TButton():New( nTopBtn, nLeft+=28, "SetVolume", oDlg,; {|| oMedia:setVolume( Val( FWInputBox("Escolha a altura do volume [0-100]", cValToChar(oMedia:nVolume)) ) ) },; 28,010,,,.F.,.T.,.F.,,.F.,,,.F. ) TButton():New( nTopBtn, nLeft+=28, "GetVolume", oDlg,; {|| MsgAlert( oMedia:nVolume ) },; 28,010,,,.F.,.T.,.F.,,.F.,,,.F. ) TButton():New( nTopBtn, nLeft+=28, "ShowBar", oDlg,; {||lShowBar showBar:=!lShowBar showBar, oMedia:setShowBar( lShowBar ( showBar ) },; 28,010,,,.F.,.T.,.F.,,.F.,,,.F. ) TButton():New( nTopBtn, nLeft+=28, "nPlayCount", oDlg,; {|| oMedia:nPlayCount := ( Val( FWInputBox("Escolha o numero de repetições", cValToChar(oMedia:nPlayCount)) ) ) },; 28,010,,,.F.,.T.,.F.,,.F.,,,.F. ) TButton():New( nTopBtn, nLeft+=28, "SetMute", oDlg,; {|| isMute:=!isMute, oMedia:setMute( isMute ) },; 28,010,,,.F.,.T.,.F.,,.F.,,,.F. ) ACTIVATE MSDIALOG oDlg CENTERED returnExemplo da classe TMediaPlayer
RETURN
|
Resultado do Exemplo
Abrangência
Microsiga Protheus 8.11 , Microsiga Protheus 11 , Protheus 10 , TOTVS Application Server 10 , ByYou Application Server
...