File Explorer :: feMedia2 Class reference | |||
|
![]() |
||
Version
|
|||
Note: The old feMedia documentation is available here.
The feMedia2 class extends the feMedia class, and provides support for both the older Windows Media Player 6.4 and earlier control, as well as the new control and interface provided from Windows Media Player 7 and upwards. The object will automatically try use the newest interfaces available and fall back to the previous interfaces if they are not available. The new methods will only work with Windows Media Player 7 and later. The old methods are the feMedia class are still supported, and provide support for the old Media Player interface, as well as providing backward compatibility to allow existing code to work with the new interfaces.
These methods provide the functionality that existed in the feMedia class, and call the correct code for the specific version of Windows Media Player that is being used. When using the old Windows Media 6.4 and earlier interfaces the functionality remains unchanged, and all existing code work. The object will automatically try use the newest interfaces available and fall back to the previous interfaces if they are not available.
When using the new Media Player 7 and later interfaces, as much as possible we have maintained transparent backward compatibility, however some code may cease to work, in all cases where deprecated functionality is used with the new control the method will call the ErrorTrap() method with the warning or error.
To display ErrorTrap messages set the .logging property of the class to 1 and the .level property to the level of logging required (0 for errors only, 1 to include warnings and 2 for all messages including errors, warnings and information). The output can then be viewed using the free DebugView utility from Microsoft (www.sysinternals.com).
ErrorTrap Procedure (string errorMesssage, string methodName, long level=0)
The ErrorTrap() method is called each time an error occurs, or a warning is issued, or there is additional information available that can be helpful for debugging and diagnostic purposes. The Level parameter is set dependant on the type of message. The .logging property of the class determines whether these messages are logged to the system debug output (.logging =1) and the .level property of the class determines which messages are logged (.level=0 logs only errors, .level=1 logs errors and warnings, .level=2 logs all messages.
Parameters
errorMessage
The text of the error, warning or informational message.
methodName
The name of the method that called ErrorTrap.
level
The level of the of message, indicating the type of message that this is:
Notes
The passed level parameter is checked against the .level property of the class. If the level is passed is less than or equal to .level the error is logged (if the .logging property is set to a no zero value). By default the .level property is zero, and hence only error messages are logged. To also log warning messages set .logging to 1 and to log all messages set .logging to 2.
Cleans up, deallocates all memory, and disposes of all interfaces. Kill should always be called for every object where the Init() method has been called. This method should only be called once, and because of the nature of the interface it is strongly recommend that Init() and Kill() are only called once, and not repeatedly. It is also recommended that the template generated code for Init() and Kill() is used (the Init() method is called when the Window is opened and Kill() is called when the Windows is closing).
Load procedure (string mediaFile)
Loads the specified file into the Media Player control. The default behaviour is for the file to begin playback once it is loaded. This can also be the URL of a media file, or the URL of a media stream.
Notes
All additional parameters are deprecated, only the name of the media to load needs to be passed. The name can be a full path name or an URL that points to the media to be loaded by the player. The following version of this procedure are deprecated, additional parameters are simply ignored:
Init procedure (long ParentControl, <string LoadPath>, long Handle1=0, long
Handle2=0, byte SkipCallbacks=false), byte, proc
Load procedure (string CurrentPath, <long CurrentControl>), byte, proc
Load procedure (string CurrentPath, long CurrentControl, string TreatUnknownsAs,
<byte ExplorerControl>)
Update procedure (string Property, string PropValue), byte, proc
This Method is Deprecated. This method is deprecated, and should only be used when using the old Media Player interface for Windows Media Player 6.4 and earlier. The new methods to put the property values directly should be used for the new Media Player interface. For backward compatibility purposes this method will still work, but those properties that have no analogues in the new Media Player will cause the method to call ErrorTrap with a warning for those properties whose behaviour has changed, and an error for those properties that no longer exist and have no equivilents.
Use this method to update various properties of the Media object. These properties should not get update directly by changing associated class properties, as this will have no effect on the Media Player.
Parameters
Property parameter can be one of the following values:
Navigate
procedure (byte Location, <short
PageNumber>, <string Optionals>), byte, proc
This method is deprecated, This method is deprecated, and should only be used when using the old Media Player interface for Windows Media Player 6.4.
With the new Media Player control use the put_currentPosition() method
Use this method to navigate within a loaded file. The Location parameter can be one of the following:
Notes
If you are using location 2 or 3 for a Media Player object, the Navigate method will in effect take you to the previous or next frame of the loaded movie. In reality you actually jump forward or backward by a preset number of milliseconds, giving the impression that you are jumping frames. The default number of milliseconds is 100 (i.e. a tenth of a second). If you would rather use another time frame, you can pass the number of milliseconds as the Optionals third parameter. Example 3 shows how to jump forward to the next "frame", where the next frame is 50 milliseconds after the current frame, not the 100 millisecond default:
Examples
ThisViewer1.Navigate
(1) ! Goto first page
ThisViewer1.Navigate (5, 3) ! Goto page 3
ThisViewer1.Navigate (3, 0, 50)
LoadMedia procedure (string CurrentPath, long CurrentControl)
This method is deprecated, use the #Load() method.
GetInfo procedure (<string pPropertyName>)
This method is deprecated. This method is deprecated, and should only be used when using the old Media Player interface for Windows Media Player 6.4
Use the specific method to access the property value that you need. For backward compatibility purposes this method returns the equivilent values for the new media player interface as much as possible, and where there is no equivilent ErrorTrap() will be called.
This method retrieve the value for the requested property from the Media Player control. If you pass a property name in the optional pPropertyName parameter (see example), then only that property will be updated. If you do not pass a property name, then all properties will be updated.
Supported values for pPropertyName:
Reload procedure (<long CurrentControl>)
This method reloads the last document which you loaded into the object. If you omit the CurrentControl parameter, the same control which you used in the Init method is used.
This method is deprecated. This method is deprecated, and should only be used when using the old Media Player interface for Windows Media Player 6.4.
This is not supported at all by the new interfaces, however the get_versionInfo() method can be used to retrieve the version information for Windows Media Player. In addition the .MpVersionNumber property of the class is set to 6 for the old version, and 7 (or greater) for the new interface. The Init() method sets this property based on the control that is initialised. Thereafter it can be tested as follows:
if
MediaPlayer.MpVersionNumber < 7
! The old version of Windows
Media Player
else
! The new version of Windows Media
Player
end
TranslateEventID procedure (long EventID), string
This method is deprecated. This method is deprecated, and should only be used when using the old Media Player interface for Windows Media Player 6.4.
This method translates an event ID that was passed to the callback into a string that describes the event.
_EventCallback procedure (long EventID, string Parm1, string Parm2, string Parm3, string Parm4), long
Internal event callback mechanism, should not be used or called directly.
EventCallback procedure (long EventID, string Parm1, string Parm2, string Parm3, string Parm4), long
Main Callback method for handling events. This method will now call individual callback methods for each event, which is where code should be placed to handle event. This methods should not be used or called directly.
Hides the File Explorer viewer control.
Parameters
None
Return Value
None
Notes
Setting the control to hidden using the Clarion PROP syntax will
not work for example:
?feControl{prop:hide} = true
will not hide the control.
Examples
ThisViewer.HideControl()
Unhides (shows) the File Explorer viewer control if it has been hidden using the HideControl method.
Parameters
None
Return Value
None
Notes
Using the Clarion PROP syntax, such as:
?feControl{prop:hide} = false will
not work.
Examples
ThisViewer.HideControl()
These methods fetch the internal interfaces for each of the underlying Media Player objects. You should not typically call these methods in the normal course of use.
GetControls Procedure (), long
Retrieves the Controls interface
GetCurrentMedia Procedure (), long
Retrieves the Media interface
GetSettings Procedure (), long
Retrieves the Settings interface
Methods that relate to and control the Media Player object itself.
close Procedure (), long, proc
Closes the current digital media file, not Windows Media Player.
get_playState
Procedure (), long
Returns a WMPPlayState enumeration
put_URL Procedure (string URL), long, proc
Play a clip
get_openState Procedure (), long
Retrieves an WMPOpenState enumeration value indicating the state of the content source.
get_status Procedure (), string
Returns a value for the status of the control
Returns the URL of the current clip
get_versionInfo Procedure (), string
Returns the version information for Media Player
get_enableContextMenu Procedure (), long
Retrieves a value indicating whether to enable the context menu, which appears when the right mouse button is clicked.
get_enabled Procedure (), long
Retrieves a value indicating whether the Windows Media Player control is enabled.
get_fullScreen Procedure (), long
Retrieves a value indicating whether video content is played back in full-screen mode.
get_uiMode Procedure (), string
Retrieves a value indicating which controls are shown in the user interface when Windows Media Player is embedded in a Web page.
put_enableContextMenu Procedure (long enabled), long, proc
Specifies a value indicating whether to enable the context menu, which appears when the right mouse button is clicked.
put_enabled Procedure (long enabled), long, proc
Specifies a value indicating whether the Windows Media Player control is enabled.
put_fullScreen Procedure (long fullScreen), long, proc
Specifies a value indicating whether video content is played back in full-screen mode.
put_uiMode Procedure (string mode), long, proc
Specifies a value indicating which controls are shown in the user interface when Windows Media Player is embedded in a Web page.
These methods are not
currently implemented.
get_stretchToFit Procedure (), long
Retrieves a value indicating whether video will stretch to fit size of the Windows Media Player control video display.
get_windowlessVideo Procedure (), long
Retrieves a value indicating whether the Windows Media Player control renders video in windowless mode.
put_stretchToFit Procedure (), long, proc
Specifies whether video will stretch to fit the size of the Windows Media Player control video display.
put_windowlessVideo Procedure (), long, proc
Specifies whether the Windows Media Player control renders video in windowless mode.
These methods are members of the Control interface and provide control of Media Player and the loaded media, much the same as the actual controls on the standard Windows Media player do.
fastForward Procedure (), long, proc
Starts fast play of the media item in the forward direction.
fastReverse Procedure (), long, proc
Starts fast play of the media item in the reverse direction.
get_currentMarker Procedure (), long
Retrieves the current marker number.
get_currentPosition Procedure (), real
Retrieves the current position in the media item in seconds from the beginning.
get_currentPositionString Procedure (), string
Retrieves the current position in the media item as a string.
get_controlIsAvailable Procedure (string item), long
Retrieves a value indicating whether a specified type of information is available or a given action can be performed.
Sets the current item to the next item in the playlist.
pause Procedure (), byte, proc
Pauses the playback of the currently loaded media item
Begins playback of the currently loaded media item
previous Procedure (), long, proc
Sets the current item to the previous item in the playlist.
put_currentMarker Procedure (long marker), long, proc
Specifies the current marker number.
put_currentPosition Procedure (real currentPosition), long, proc
Specifies the current position in the media item in seconds from the beginning.
Stops playback of the currently loaded media item. Resets the media to the beginning (use Pause to halt playback and retain the position).
The following methods control the Settings interface that related to the Media Player control.
get_autoStart Procedure (), long
Retrieves a value indicating whether the current media item begins playing automatically.
get_balance Procedure (), long
Retrieves the current stereo balance.
get_baseURL Procedure (), string
Retrieves the base URL used for relative path resolution with URL-type script commands embedded in digital media content.
get_defaultFrame Procedure (), string
Retrieves the name of the frame used to display a URL received in a scriptCommand event.
get_enableErrorDialogs Procedure (), long
Retrieves a value indicating whether error dialog boxes are displayed automatically.
get_invokeURLs Procedure (), long
Retrieves a value indicating whether URL events should launch a Web browser.
get_settingIsAvailable Procedure (string item), long
Retrieves a value indicating whether a specified action can be performed.
Retrieves a value indicating whether audio is muted.
get_playCount Procedure (), long
Retrieves the number of times a media item will play.
Retrieves the current playback rate.
Retrieves the current playback volume.
getMode Procedure (string mode), long
Returns a value indicating whether loop mode or shuffle mode is active.
put_autoStart Procedure (long autoStart), long, proc
Specifies whether the current media item begins playing automatically.
put_balance Procedure (long balance), long, proc
Specifies the current stereo balance.
put_baseURL Procedure (string baseURL), long, proc
Specifies the base URL used for relative path resolution with URL script commands embedded in digital media files.
put_defaultFrame Procedure (string defaultFrame), long, proc
Specifies the name of the frame used to display a URL received in a scriptCommand event.
put_enableErrorDialogs Procedure (long enableDialogs), long, proc
Specifies whether error dialog boxes are displayed automatically.
put_invokeURLs Procedure (long invokeUrls), long, proc
Specifies whether URL events should launch a Web browser.
put_mute Procedure (long mute), long, proc
Specifies whether audio is muted.
put_playCount Procedure (long pCount), long, proc
Specifies the number of times a media item will play.
put_rate Procedure (real rate), long, proc
Specifies the current playback rate.
put_volume Procedure (long volume), long, proc
Specifies the current playback volume.
setMode Procedure (string mode, long enabled), long, proc
Sets the loop mode or shuffle mode to active or inactive.
The following methods belong to the Media object and provide information and control for the currenly loaded Media item. If no media is loaded all of the methods return an error code and call ErrorTrap()
get_attributeCount Procedure (), long
Retrieves the number of attributes that can be queried and/or set for the media item.
get_duration Procedure (), real
Retrieves the duration in seconds of the current media item.
get_durationString Procedure (), string
Retrieves a value indicating the duration of the current media item in HH:MM:SS format.
get_imageSourceHeight Procedure (), long
Retrieves the height of the current media item in pixels.
get_imageSourceWidth Procedure (), long
Retrieves the width of the current media item in pixels.
get_markerCount Procedure (), long
Retrieves the number of markers in the media item.
Retrieves the name of the media item.
get_sourceURL Procedure (), string, proc
Retrieves the URL of the media item.
getAttributeName Procedure (long item), string
Retrieves the name of the attribute corresponding to the specified index.
getItemInfo Procedure (string itemName), string
Retrieves the value of the specified attribute for the media item.
getItemInfoByAtom Procedure (long itemNum), string
Retrieves the value of the attribute with the specified index number.
getMarkerName Procedure (long markerNum), string
Retrieves the name of the marker at the specified index.
getMarkerTime Procedure (long markerNum), real
Retrieves the time of the marker at the specified index.
isReadOnlyItem Procedure (string itemName), long
Retrieves a value indicating whether the attributes of the specified media item can be edited.
put_name Procedure (string pName), long, proc
Sets the name of the media item.
setItemInfo Procedure (string itemName, string pValue), long, proc
Sets the value of the specified attribute for the media item.