CapeSoft.Com
Clarion Accessories
FileExplorer
Documentation
feMedia
CapeSoft Logo

CapeSoft File Explorer feMedia
Documentation

Download Latest Version
Installed Version Latest Version

File Explorer Classes - FeMedia

Formerly known as the Media file type / object, the FeMedia Object is used to display video files, and play sound files.

FeMedia - Methods

Quick Reference
EventCallback
GetInfo
HideControl
Init
Kill
Load
Navigate
Pause
Play
Reload
Stop
UnhideControl
Update

EventCallback

EventCallback ( long EventID, string Parm1, string Parm2, string Parm3, string Parm4 )

Description

( To do )

GetInfo

GetInfo (<string pPropertyName> )

Description

Example
Example
ThisViewer1.GetInfo()
ThisViewer1.GetInfo('MedDuration')

HideControl

HideControl ( )

Description
Example
Example
ThisViewer.HideControl ()

Init

Init ( long ParentControl, <string LoadPath>, long Handle1=0, long Handle2=0, byte SkipCallbacks=false ) ,byte,proc

Description
Example
Example
ThisViewer.Init (?feControl)
ThisViewer.Init (?feControl, 'www.CapeSoft.com',,,true)

Kill

 ( )

Description
Example
Example
Kill ThisViewer.Kill()

Load

Load ( string CurrentPath, <long CurrentControl> ) ,byte,proc

Description
Example
Example
ThisViewer.Load ('c:\test.avi')

Navigate

Navigate ( byte Location, <short PageNumber>, <string Optionals>)

Description
Example
Example
ThisViewer1.Navigate (1)   ! Goto first page
ThisViewer1.Navigate (5, 3)  ! Goto page 3
ThisViewer1.Navigate (3, 0, 50)

Pause

Pause ( ) ,byte,proc

Description
Example
Example
ThisViewer.Pause()

Play

Play ( ) ,byte,proc

Description
Example
Example
ThisViewer.Play()

Reload

Reload ( <long CurrentControl> )

Description
Example
Example
ThisViewer.Reload()

Stop

Stop ( ) ,byte,proc

Description
Example
Example
ThisViewer.Stop()

UnhideControl

UnhideControl ( )

Description
Example
Example
ThisViewer.UnhideControl ()

Update

Update ( string Property, string PropValue ) ,byte,proc

Description
Example
Example
ThisViewer.Update()

FeMedia - Properties (alphabetical)

MedAllowZoomChange (Byte) If the user right-clicks on a media file while it is playing, he is presented with a number of options which he can set (run-time). One of these options is the current "zoom" setting. This property (MedAllowZoomChange) sets whether the user can change the zoom setting from that popup window at run-time. A value of '1' enables setting the zoom property, and a value of '2' disables it (for reasons I won't go into). If you do not set any value it defaults to enabled. See the GetInfo and Update methods.
MedAutoResize (Byte) If you set this to true (1), then the Media Viewer object will resize itself each time you load a file, so that the object (ocx) is only large enough to "fit" the file. The top-left corner remains constant. By default this is set to 0. You can either set this property "directly" before you call the Load method, or once the file has loaded using the Update method. Also works with the GetInfo method.
MedAutoRewind (Byte) Set this to True (1) to automatically rewind Media files once they have finished playing. Set it "directly" before calling the Load method, or set it once a file is open using the Update method. Also works with the GetInfo method.
MedAutoStart (Byte) Set this to True (1) to automatically start playing media files once you load them. Set it "directly" before calling the Load method, or set it once a file is open using the Update method. Also works with the GetInfo method.
MedCurrentPosition (Long) Holds the current "position" within the playing file. For a 15 second clip this starts with 0.0 and ends on 15.0. Use the GetInfo and Update methods.
MedDuration (String) Holds the expected duration (in seconds to 1 decimal place). Note, if you are playing the file at anything other than a PlayRate of 100%, the MedDuration property will need to be adjusted in your calculations, as it returns the duration assuming the PlayRate will be 100%. See the GetInfo method.
MedEnableSlideBar (Byte) Sets whether the SlideBar is enabled or disabled for the control. Use the Update or GetInfo methods. Valid values are true (1) or false (0).
MedEnableToolbar (Byte) Sets whether the Toolbar is enabled or disabled for the control.  Use the Update or GetInfo methods. Valid values are true (1) or false (0).
MedEndPosition (Long) The default end position for a clip of 15 seconds would be 15.0 (i.e. the end of the track). You can set this to a lesser value if you want to end before then. Use the GetInfo or Update methods.
MedFileName (String) Use the GetInfo or Update methods. It returns something like "c:\files\file1.avi", being the name of the file currently loaded.
MedInfo_Author (String) This property holds the name of the author for the loaded file, if available. Use the GetInfo method.
MedInfo_Copyright (String) This property holds copyright info for the loaded file, if available. Use the GetInfo method.
MedInfo_Description (String) This property holds a description of the loaded media file, if available. Use the GetInfo method.
MedInfo_FileName (String) This property holds the current filename (including path) of the loaded file. Use the GetInfo method.
MedInfo_Rating (String) This property holds rating information for the loaded file, if available. Use the GetInfo method.
MedInfo_Title (String) This property holds the title of the loaded media file, if available. Use the GetInfo method.
MedMute (Byte) A value of 1 mutes the sound, 0 "un-mutes" it. If unset, defaults to 0. Use the GetInfo or Update methods.
MedPlayRate (Long) Set the playback rate for media files. 100 is normal speed (i.e. 100%), 50 is 50%, and so on. Set it "directly" (ThisViewer1.MedPlayRate = 50) before calling the Load method, or after loading a file using the Update method. Also works with the GetInfo method.
MedRepeatTimes (Byte) Holds the number of times a file will be played / looped before stopping. A value of 0 or 1 indicates the file will play through once and then stop. Use the GetInfo or Update methods.
MedRightClick (Byte) By default, if the user right-clicks on the Viewer control a popup menu appears. Setting this property to false (0) disables that popup window from appearing. Use the Update or GetInfo methods.
Example:
ThisViewer1.Load ('c:\mydoc.avi')
ThisViewer1.Update('MedRightClick', false)
MedShowGotoBar (Byte) Determines whether the 'Goto Bar' drop list is hidden or not. Use the Update or GetInfo methods - valid values are true (1) or false (0).
MedShowInfoWindow (Byte) Determines whether the 'Clip', 'Author', and 'Copyright' information is hidden or not. Use the Update or GetInfo methods - valid values are true (1) or false (0).
MedShowPositionControls (Byte) Determines whether the 'Skip Back', 'Rewind', 'Fast Forward', 'Skip Forward', and 'Preview each clip in Playlist' buttons are hidden or not. Use the Update or GetInfo methods - valid values are true (1) or false (0).
MedShowSlideBar (Byte) Determines whether the 'Slide Bar' ('Tracker Bar') is hidden or not. This is the bar which you can use to 'move around' in the clip by dragging the locator on the bar. Use the Update or GetInfo methods - valid values are true (1) or false (0).
MedShowToolbar (Byte)Set to True (1) to display the native Media toolbar, or False (0) to hide it. Either set this "directly" before calling the Load method, or after a file has loaded using the Update method. Also works with the GetInfo method.
MedSoundCard (Byte)Use the GetInfo method. A value of 1 means that a soundcard is present on the PC.
MedStartPosition (Long)The default start position for a clip is at 0.0 (i.e. the beginning of the track). You can set this to any value though, to start playing the clip at a point other than at the beginning. Use the Update or GetInfo methods.
MedVolume (Long)This property holds the current playback volume. This can be any value from -1 (max volume) to -9640 (min volume). If unset this defaults to -600. Use the Update or GetInfo methods.
MedZoom (Byte)This property determines the visual "size" of the movie clip which you load. It can hold one of 8 possible values, as outlined below:
  • 100 - 100%, or the default size
  • 50 - 50%, or half the default size
  • 200 - 200%, or double the default size
  • 1 - Full screen
  • 2 - Fit to size
  • 3 - 1/16th of the screen size
  • 4 - 1/4 of the screen size
  • 5 - 1/2 of the screen size
If unset, this property defaults to 100.  Use the Update or GetInfo methods.  Note that some settings only work with certain file formats, such as Full Screen works with Mpeg, but not AVI.

Example:
ThisViewer1.Load ( 'c:\MyFile.mpg' )       ! Load the clip
ThisViewer1.Wait(2)      ! Gives the ocx time to finish loading
ThisViewer1.Update('MedZoom', 1)     ! Shows video at full screen
ThisViewer1.Play()     ! Start playing the clip
Class Properties
feMedia.MPVersionNumber
The version of Windows Media Player to load
MPVersionNumber long
The version of Windows Media Player to Load. You need to set this before the call to the Init method.

Information:
There are currently two allowed values for MPVersionNumber. Setting this to 6 will use the old Windows Media Player 6/7 control. Setting this to 10 will use the new Windows Media player 9 and newer control. Please note that using the new control is currently a Beta feature, in testing it works very well, however there is a known issue with multiple controls on a single window causing a GPF when the window is closed. You may have both old and new controls in your application, and you can even have old and new controls on the same window/thread.

Example

	! Use the old version of Windows Media Player
	ThisViewer1.MPVersionNumber = 6
ThisViewer1.Init (?feControl, , , , 1)
! Use the new version of Windows Media Player ThisViewer3.MPVersionNumber = 10
ThisViewer3.Init (?feControl, , , , 1)
Information:
The same technique is used regardless of whether the Init method call is being done manually or populated by the template.

FeMedia - Templates

At this time there is quite an overlap in terms of multiple File Explorer classes being implemented by the same templates. In the future we may revisit this, but for now all templates are covered in the main (FileExplorer.htm) help document, please click here.

Summary of callback events

See the FeMedia_SoundCallbacks and FeMedia_VideoCallbacks procedures in the feabc.app example application for more info.
Event Name: Equate: Description:
Bufferingfe:MedEvt_BufferingOccurs when the control begins or ends buffering.
Clickfe:MedEvt_ClickOccurs when a user clicks the mouse with the cursor in the image window.
DblClickfe:MedEvt_DblClickOccurs when a user double clicks the mouse with the cursor in the image window.
Disconnectfe:MedEvt_DisconnectOccurs when the control is disconnected from the server.
DisplayModeChangefe:MedEvt_DisplayModeChangeOccurs when the DisplayMode property changes.
DVDNotifyfe:MedEvt_DVDNotify( none )
EndOfStreamfe:MedEvt_EndOfStreamOccurs when the end of the title is reached.
Errorfe:MedEvt_ErrorOccurs when the control has an error condition.
KeyDownfe:MedEvt_KeyDownOccurs when a key is pressed.
KeyPressfe:MedEvt_KeyPressOccurs when a key is pressed and released.
KeyUpfe:MedEvt_KeyUpOccurs when a key is released.
MarkerHitfe:MedEvt_MarkerHitOccurs when a marker is reached.
MouseDownfe:MedEvt_MouseDownOccurs when a mouse button is pressed.
MouseMovefe:MedEvt_MouseMoveOccurs when the mouse pointer is moved.
MouseUpfe:MedEvt_MouseUpOccurs when a mouse button is released.
NewStreamfe:MedEvt_NewStreamOccurs when a new stream is started in a station.
OpenStateChangefe:MedEvt_OpenStateChangeOccurs when the control changes its open state.
PlayStateChangefe:MedEvt_PlayStateChangeOccurs when the control changes its play state.
PositionChangefe:MedEvt_PositionChangeOccurs when the current media position moves to a new position.
ReadyStateChangefe:MedEvt_ReadyStateChangeOccurs when the control's state of readiness changes.
ScriptCommandfe:MedEvt_ScriptCommandOccurs when a synchronized command or URL is received.
Warningfe:MedEvt_WarningOccurs when the control encounters a possible problem.

More Info: ( work in progress )

OpenStateChange ( OldState, NewState )
OldState indicates the previous OpenState value.
NewState indicates the new (current) OpenState value.
Possible OpenState values are:
0 - Content file is closed
1 - Loading an .asx redirector file
2 - Loading an .nsc station file
3 - Locating the server
4 - Connecting to the server
5 - Opening or listening for the stream
6 - Content file is open

PlayStateChange( OldState, NewState )
OldState indicates the previous PlayState value.
NewState indicates the new (current) PlayState value.
Possible PlayState values are:
0 - Playback is stopped
1 - Playback is paused
2 - Stream is playing
3 - Waiting for stream to begin
4 - Stream is scanning forward
5 - Stream is scanning in reverse
6 - Skipping to next
7 - Skipping to previous
8 - Stream is not open


PositionChange( OldPosition, NewPosition )
OldPosition indicates the position before it changed, in seconds.
NewPosition indicates the current position, in seconds, after the position change occurred