Page 1 of 1

HINT: Activex with media player

Posted: Mon Mar 17, 2008 4:51 pm
by Rochinha
Hello friends:

The code for fwplayer.PRG:

Code: Select all

#include "FiveWin.ch"

function Main(filme)
   local oWnd, oActiveX
   DEFINE WINDOW oWnd TITLE "FiveWin ActiveX Support"

   oActiveX = TActiveX():New( oWnd, "MediaPlayer.MediaPlayer.1" )
   oActiveX:SetProp( "FileName"     , filme )
   oActiveX:SetProp( "ShowStatusBar", "True" )
   oActiveX:SetProp( "ShowControls" , "False" )
   oActiveX:SetProp( "AutoStart"    , "False" )
   oActiveX:SetProp( "width"        , 295 ) 
   oActiveX:SetProp( "height"       , 239 )
   oActiveX:SetProp( "ShowStatusBar", 001 )
   oActiveX:SetProp( "ShowControls" , 001 )
   oActiveX:SetProp( "AutoStart"    , 000 )
   oWnd:oClient := oActiveX

   ACTIVATE WINDOW oWnd
   return nil

function EventInfo( event, aParams )
   local cMsg := "Event: " + cValToChar( event ) + CRLF + CRLF 
   local n
   cMsg += "Params: " 
   for n = 1 to Len( aParams )
      cMsg += cValToChar( aParams[ n ] ) + CRLF
   next
   MsgInfo( cMsg )
   return nil
The code for filme.PRG

Code: Select all

<Asx Version = "3.0" > 
	<Title>Playlist1</Title>
	<Param Name = "AllowShuffle" Value = "yes" />
	<Entry> 
		<Param Name = "Bitrate" Value = "96002" />
			<Duration value = "00:02:29.500" />
		<Param Name = "FileSize" Value = "1925021" />
		<Param Name = "FileType" Value = "wmv" />
		<Param Name = "Is_Protected" Value = "False" />
		<Param Name = "Is_Trusted" Value = "false" />
		<Param Name = "MediaType" Value = "video" />
		<Param Name = "SourceURL" Value = "mms://www.itmnetworks.com.br/suporte/videos/muppets.wmv" />
		<Title>Muppets</Title>
		<Param Name = "type" Value = "downloaded" />
		<Param Name = "WM/MediaClassPrimaryID" Value = "{DB9830BD-3AB3-4FAB-8A37-1A995F7FF74B}" />
		<Param Name = "WM/MediaClassSecondaryID" Value = "{00000000-0000-0000-0000-000000000000}" />
		<Param Name = "WMFSDKNeeded" Value = "0.0.0.0000" />
		<Param Name = "WMFSDKVersion" Value = "7.01.00.3055" />
		<Ref href = "mms://www.itmnetworks.com.br/suporte/videos/muppets.wmv"/>
	</Entry>
</Asx>

Posted: Mon Mar 17, 2008 7:46 pm
by Antonio Linares
Rochina,

Does it work ? How ? :-)

Is filme the name of that XML file ?

Posted: Tue Mar 18, 2008 3:27 pm
by Rochinha
Antonio,

Excuse-me.

The code name of video file is media.ASX

To run this samples uses:

fwplayer.exe filme.asx

Posted: Tue Mar 18, 2008 5:52 pm
by Antonio Linares
Thanks! :-)