MediaPlayer#

Qualified name: delphivcl.MediaPlayer

class MediaPlayer#

Bases: CustomControl

TMediaPlayer controls devices that provide a Media Control Interface (MCI) driver. The TMediaPlayer component includes a set of buttons (Play, Stop, Eject, and so on) that control a multimedia device such as a CD-ROM drive, MIDI sequencer, or VCR. A multimedia device may be hardware or software. The media player component contains of multiple buttons. These buttons can be clicked with the mouse, but are not separate objects or button components.

Button

Value

Action

Play

btPlay

Plays the media player

Pause

btPause

Pauses playing or recording. If already paused when clicked, resumes playing or recording.

Stop

btStop

Stops playing or recording

Next

btNext

Skips to the next track, or to the end if the medium doesn’t use tracks

Prev

btPrev

Skips to the previous track, or to the beginning if the medium doesn’t use tracks

Step

btStep

Moves forward a number of frames

Back

btBack

Moves backward a number of frames

Record

btRecord

Starts recording

Eject

btEject

Ejects the medium

The multimedia device is played, paused, stopped, and so on when the user clicks the corresponding button on the TMediaPlayer component. The device can also be controlled by the control methods that correspond to the buttons (Play, Pause, Stop, Next, Previous, Step, Back, StartRecording, and Eject). The type of multimedia device (such as dtWaveAudio or dtVideodisc) is specified by the DeviceType property. If the device stores its media in a file, the name of the media file is specified by the FileName property. If DeviceType is dtAutoSelect, the media player attempts to determine the type of device from the extension of the file specified by FileName. To have the media player attempt to open the device specified by DeviceType automatically when the media player component is created at runtime, set the AutoOpen property to true.

Methods

Back

Steps backward a number of frames (determined by the value of the Frames property) in the currently loaded medium.

BringToFront

Puts the control in front of all other controls in its parent control.

ClientToScreen

Translates a given point from client area coordinates to global screen coordinates.

Close

Closes the open multimedia device.

Create

Creates a media player object.

Destroy

Destroys an instance of the media player.

Eject

Releases the loaded medium from the open multimedia device.

Hide

Hides the wrapped Control

Invalidate

Completely repaint control.

Next

Moves to the beginning of the next track of the currently loaded medium.

Open

Opens a multimedia device.

Pause

Toggles the open multimedia device on or off.

PauseOnly

Pauses the open multimedia device.

Play

Plays the media loaded in the open multimedia device.

Previous

Sets the current position to the beginning of the previous track if the position was at the beginning of a track when Previous was called.

Repaint

Forces the control to repaint its image on the screen.

Resume

Resumes playing or recording the currently paused multimedia device.

Rewind

Sets the current position to the beginning of the the medium, which is stored in the Start property.

Save

Saves the currently loaded medium to the file specified in the FileName property.

ScreenToClient

Converts the screen coordinates of a specified point on the screen to client coordinates.

SendToBack

Puts a windowed control behind all other windowed controls, or puts a non-windowed control behind all other non-windowed controls.

SetBounds

Sets the Left, Top, Width, and Height properties all at once.

Show

Shows the wrapped Control

StartRecording

Begins recording from the current Position or from the position specified in StartPos.

Step

Moves forward a number of frames (determined by the Frames property) in the currently loaded medium.

Stop

Halts playing or recording.

Update

Processes any pending paint messages immediately.

Attributes

Action

Specifies the action associated with the control.

Align

Determines how the control aligns within its container (parent control).

AlignDisabled

Indicates child control realignment disabled.

AlignWithMargins

Specifies whether a control should be constrained by margins.

Anchors

Specifies how the control is anchored to its parent.

AutoEnable

Determines whether the media player automatically enables and disables individual buttons in the component.

AutoOpen

Determines if the media player is opened automatically when the application is run.

AutoRewind

Determines if the media player control rewinds before playing or recording.

BiDiMode

Specifies the bidirectional mode for the control.

BoundsRect

Specifies the bounding rectangle of the control, expressed in the coordinate system of the parent control.

Brush

Determines the color and pattern used for painting the background of the control.

Capabilities

Determines the capabilities of the open multimedia device.

ClassName

Returns the TObject.ClassName

ClientHeight

Specifies the height of the control's client area in pixels.

ClientOrigin

Specifies the screen coordinates (in pixels) of the upper-left corner of a control's client area.

ClientRect

Specifies the size of a control's client area in pixels.

ClientWidth

Specifies the horizontal size of the control's client area in pixels.

ColoredButtons

Determines which buttons on the media player control have color.

ComObject

Specifies the interface reference implemented by the component.

ComponentCount

Indicates the number of components owned by the component.

ComponentIndex

Indicates the position of the component in its owner's Components property array.

ComponentState

Describes the current state of the component, indicating when a component needs to avoid certain actions.

ComponentStyle

Governs the behavior of the component.

Components

<Delphi indexed property Components of type TComponent at 21141642500>

Constraints

Specifies the size constraints for the control.

ControlCount

Returns the number of child controls.

ControlState

Specifies the current state of a control at run time.

ControlStyle

Determines style characteristics of the control.

Controls

<Delphi indexed property Controls of type TWinControl at 211416EE760>

CurrentPPI

Embarcadero Technologies does not currently have any additional information.

Cursor

Specifies the image used to represent the mouse pointer when it passes into the region covered by the control.

CustomHint

CustomHint is a custom hint for the control.

DesignInfo

Contains information used by the Form designer.

DeviceID

Specifies the device ID for the currently open multimedia device.

DeviceType

Specifies a multimedia device type to open with the media player.

Display

Specifies the display window for a multimedia device that uses a window for output.

DisplayRect

Specifies a rectangular area in the control specified by the Display property that is used to display output from a multimedia device.

DockClientCount

Specifies the number of controls that are docked on the windowed control.

DockClients

<Delphi indexed property DockClients of type TWinControl at 211416EE520>

DockManager

Specifies the control's docking manager interface.

DockOrientation

DockOrientation specifies how the control is docked relative to other controls docked in the same parent.

DockSite

Specifies whether the control can be the target of drag-and-dock operations.

DoubleBuffered

Determines whether the control's image is rendered directly to the window or painted to an in-memory bitmap first.

Enabled

Controls whether the control responds to mouse, keyboard, and timer events.

EnabledButtons

Determines which buttons on the media player are usable.

EndPos

Specifies the position within the currently loaded medium at which to stop playing or recording.

Error

Specifies the MCI error code returned by the media control method.

ErrorMessage

Describes the error code stored in the Error property.

ExplicitHeight

Specifies the explicit vertical size of the control in pixels.

ExplicitLeft

Specifies the explicit horizontal pixel coordinate of the left edge of a component relative to its parent.

ExplicitTop

Specifies the explicit vertical pixel coordinate of the top edge of a component relative to its parent.

ExplicitWidth

Specifies the explicit horizontal size of the control in pixels.

FileName

Specifies the opened or saved media file.

Floating

Specifies whether the control is floating.

FloatingDockSiteClass

Specifies the class of the temporary control that hosts the control when it is floating.

Frames

Specifies the number of frames moved forward or backward.

Handle

Provides access to the underlying Windows screen object for the control.

Height

Specifies the vertical size of the control in pixels.

HelpContext

The HelpContext property contains the numeric context ID that identifies the Help topic for the control.

HelpKeyword

The HelpKeyword property contains the keyword string that identifies the Help topic for the control.

HelpType

Specifies whether the control's context-sensitive Help topic is identified by a context ID or by keyword.

Hint

Hint contains the text string that appears when the user moves the mouse over the control.

HostDockSite

Specifies the control in which the control is docked.

IsDrawingLocked

IsDrawingLocked property returns True when redrawing for this control is locked.

LRDockWidth

Specifies the width of the control when it is docked horizontally.

Left

Specifies the horizontal coordinate of the left edge of a component relative to its parent.

Length

Specifies the length of the medium in the open multimedia device.

Margins

Specifies the margins of the control.

Mode

Indicates the state of the currently open multimedia device.

MouseInClient

Indicates whether the mouse pointer is currently in the client area of the control.

Name

Specifies the name of the component as referenced in code.

Notify

Determines whether an OnNotify event is generated.

NotifyValue

Indicates the result of the last media control method that requested a notification.

Observers

Indicates the TObservers object added to the TComponent.

OnClick

<Delphi property OnClick of type TMediaPlayer at 21141BF6A70>

OnContextPopup

<Delphi property OnContextPopup of type TMediaPlayer at 21141BF6B40>

OnEnter

<Delphi property OnEnter of type TMediaPlayer at 21141BF6C10>

OnExit

<Delphi property OnExit of type TMediaPlayer at 21141BF6CE0>

OnGesture

<Delphi property OnGesture of type TControl at 211418EC500>

OnMouseEnter

<Delphi property OnMouseEnter of type TMediaPlayer at 21141BF6DB0>

OnMouseLeave

<Delphi property OnMouseLeave of type TMediaPlayer at 21141BF6E80>

OnNotify

<Delphi property OnNotify of type TMediaPlayer at 21141BF7020>

OnPostClick

<Delphi property OnPostClick of type TMediaPlayer at 21141BF6F50>

Owner

Indicates the component that is responsible for streaming and freeing this component.

Padding

Specifies the padding of a control.

Parent

Returns/Sets the Control Parent

ParentCustomHint

Specifies where a control looks for its custom hint.

ParentDoubleBuffered

ParentDoubleBuffered defers the DoubleBuffered property of this component to the value of the parent's DoubleBuffered property.

ParentShowHint

Specifies where a control looks to find out if its Help Hint should be shown.

ParentWindow

Reference to parent's underlying control.

PixelsPerInch

Embarcadero Technologies does not currently have any additional information.

PopupMenu

Specifies the pop-up menu associated with the control.

Position

Specifies the current position within the currently loaded medium.

RedrawDisabled

RedrawDisabled property returns True when redrawing for this control is locked.

ScaleFactor

Embarcadero Technologies does not currently have any additional information.

Shareable

Determines whether more than one application can share a multimedia device.

ShowHint

ShowHint specifies whether to show the Help Hint when the mouse pointer moves over the control.

Showing

Indicates whether the control is showing on the screen.

Start

Specifies the starting position within the currently loaded medium.

StartPos

Specifies the position within the currently loaded medium from which to begin playing or recording.

StyleElements

Specifies the style elements that are used by the control.

StyleName

Embarcadero Technologies does not currently have any additional information.

TBDockHeight

Specifies the height of the control when it is docked vertically.

TabOrder

Indicates the position of the control in its parent's tab order.

TabStop

Determines whether the user can tab to a control.

Tag

Stores a NativeInt integral value as a part of a component.

TimeFormat

Determines the format used to specify position information.

Top

Specifies the Y coordinate of the upper-left corner of a control, relative to its parent or containing control in pixels.

Touch

Specifies the touch manager component associated with the control.

TrackLength

<Delphi indexed property TrackLength of type TMediaPlayer at 21141267EF0>

TrackPosition

<Delphi indexed property TrackPosition of type TMediaPlayer at 21141267FB0>

Tracks

Specifies the number of playable tracks on the open multimedia device.

UndockHeight

Specifies the height of the control when it is floating.

UndockWidth

Specifies the width of the control when it is floating.

UseDockManager

Specifies whether the docking manager is used in drag-and-dock operations.

VCLComObject

Represents information used internally by components that support COM.

Visible

Specifies whether the component appears onscreen.

VisibleButtons

Indicates which of the buttons on the media player are visible.

VisibleDockClientCount

Specifies the number of visible controls that are docked on the windowed control.

Wait

Determines whether a media control method returns control to the application only after it has been completed.

Width

Specifies the horizontal size of the control or form in pixels.

WindowProc

<Delphi property WindowProc of type TControl at 211418EC1C0>

Align#

Determines how the control aligns within its container (parent control). Use Align to align a control to the top, bottom, left, or right of a form or panel and have it remain there even if the size of the form, panel, or component that contains the control changes. When the parent is resized, an aligned control also resizes so that it continues to span the top, bottom, left, or right edge of the parent. For example, to use a panel component with various controls on it as a tool palette, change the panel’s Align value to alLeft. The value of alLeft for the Align property of the panel guarantees that the tool palette remains on the left side of the form and always equals the client height of the form. The default value of Align is alNone, which means a control remains where it is positioned on a form or panel.

Tip: If Align is set to alClient, the control fills the entire client area so that it is impossible to select the parent form by clicking it. In this case, select the parent by selecting the control on the form and pressing ESC, or by using the Object Inspector. Any number of child components within a single parent can have the same Align value, in which case they stack up along the edge of the parent. The child controls stack up in z-order. To adjust the order in which the controls stack up, drag the controls into their desired positions.

Note: To cause a control to maintain a specified relationship with an edge of its parent, but not necessarily lie along one edge of the parent, use the Anchors property instead.

Anchors#

Specifies how the control is anchored to its parent. Use Anchors to ensure that a control maintains its current position relative to an edge of its parent, even if the parent is resized. When its parent is resized, the control holds its position relative to the edges to which it is anchored. If a control is anchored to opposite edges of its parent, the control stretches when its parent is resized. For example, if a control has its Anchors property set to [akLeft, akRight], the control stretches when the width of its parent changes. Anchors is enforced only when the parent is resized. Thus, for example, if a control is anchored to opposite edges of a form at design time and the form is created in a maximized state, the control is not stretched because the form is not resized after the control is created.

Note: If a control should maintain contact with three edges of its parent (hugging one side of the parent and stretching the length of that side), use the Align property instead. Unlike Anchors, Align allows controls to adjust to changes in the size of other aligned sibling controls as well as changes to the parent’s size.

AutoEnable#

Determines whether the media player automatically enables and disables individual buttons in the component. Use AutoEnable to automatically enable or disable the control buttons on the media player. If AutoEnable is true, the media player automatically enables or disables its control buttons. The media player determines which buttons to enable or disable by the current mode specified in the Mode property, and the current multimedia device type specified in the DeviceType property. AutoEnable overrides the EnabledButtons property. The buttons enabled or disabled automatically by the media player supersede any buttons enabled or disabled with EnabledButtons. If AutoEnable is false, the media player does not enable or disable buttons. The buttons must enabled or disabled with the EnabledButtons property. The following table shows whether buttons are automatically enabled or disabled for each device mode:

Button

Play

Record

Pause

Stop

Not Open

Back

Enabled

Enabled

Enabled

Enabled

Disabled

Eject

Enabled

Enabled

Enabled

Enabled

Disabled

Next

Enabled

Enabled

Enabled

Enabled

Disabled

Pause

Enabled

Enabled

Enabled

Disabled

Disabled

Play

Disabled

Disabled

Enabled

Enabled

Disabled

Prev

Enabled

Enabled

Enabled

Enabled

Disabled

Record

Disabled

Disabled

Enabled

Enabled

Disabled

Step

Enabled

Enabled

Enabled

Enabled

Disabled

Stop

Enabled

Enabled

Disabled

Disabled

Disabled

AutoOpen#

Determines if the media player is opened automatically when the application is run. Use AutoOpen to have the media player automatically open at runtime. If AutoOpen is true, the media player attempts to open the multimedia device specified by the DeviceType property (or FileName if DeviceType is dtAutoSelect) when the form containing the media player component is created at runtime. If AutoOpen is false, the device must be opened with a call to the Open method. If an error occurs when opening the device, an exception of type EMCIDeviceError exception is raised that contains the error message. Upon completion, a numerical error code is stored in the Error property, and the corresponding error message is stored in the ErrorMessage property. The Wait property determines whether control is returned to the application before opening the multimedia device. The Notify property determines whether opening the device generates an OnNotify event.

AutoRewind#

Determines if the media player control rewinds before playing or recording. If AutoRewind is true and the current position is at the end of the medium, Play or StartRecording moves the current position to the beginning of the medium before playing or recording. If AutoRewind is false, the user must click the Prev button or write code to call Previous to move to the beginning. If values have been assigned to StartPos or EndPos or if the multimedia device uses tracks, AutoRewind has no effect on playing or recording. When calling Play or StartRecording, the current position remains at the end of the medium.

Back()#

Steps backward a number of frames (determined by the value of the Frames property) in the currently loaded medium. Back is called when the Back button on the media player control is clicked at runtime. Upon completion, Back stores a numerical error code in the Error property and the corresponding error message in the ErrorMessage property. The Wait property determines whether control is returned to the application before the Back method has been completed. The Notify property determines whether Back generates an OnNotify event.

BringToFront()#

Puts the control in front of all other controls in its parent control.

Capabilities#

Determines the capabilities of the open multimedia device. The various capabilities specified in Capabilities are determined when the device is opened with the Open method.

Note: Currently, there is no way to check whether a device can step forward or backward. Capabilities includes mpCanStep only if the device type (specified in the DeviceType property) is Animation, AVI Video, Digital Video, Overlay, or VCR.

ClientToScreen()#

Translates a given point from client area coordinates to global screen coordinates.

Close()#

Closes the open multimedia device. Upon completion, Close stores a numerical error code in the Error property, and the corresponding error message in the ErrorMessage property. The Wait property determines whether control is returned to the application before the Close method is completed. The Notify property determines whether Close generates an OnNotify event. Close is called automatically when the application is terminated.

ColoredButtons#

Determines which buttons on the media player control have color. ColoredButtons controls which buttons on the media player are colored. If a button is not colored with ColoredButtons, it appears in black-and-white when visible. All media player control buttons are colored by default.

Constraints#

Specifies the size constraints for the control. Use Constraints to specify the minimum and maximum width and height of the control. When Constraints contains maximum or minimum values, the control cannot be resized to violate those constraints.

Note: Constraints apply to the height of the form. However, the height of the form depends on how large Windows makes the title bar. For example, Windows XP uses much larger title bars than other windowing systems. To work around this, note the ClientHeight when you design your form and set the constraints in the FormCreate event. In the following example, ClientHeight is represented by x: Constraints.MinHeight?:= x + Height - ClientHeight. Warning: Do not set up constraints that conflict with the value of the Align or Anchors property. When these properties conflict, the response of the control to resize attempts is not well-defined.

Create(AOwner: Component)#

Creates a media player object. Call Create to instantiate a media player at runtime. For media players created at design time, Create is called automatically. Create allocates memory for a media player and calls the inherited Create. Then it loads the bitmaps for the media player’s buttons and initializes its properties, setting AutoEnable, AutoRewind, Colored, Enabled, and Visible to true, AutoOpen to false, and DeviceType to dtAutoSelect.

Destroy()#

Destroys an instance of the media player. Do not call Destroy directly in an application. Call Free instead. Free checks that the TMediaPlayer reference is not nil before it calls Destroy. Destroy first verifies that no device is open, then destroys the bitmaps used for the media player’s buttons and calls the inherited Destroy.

DeviceID#

Specifies the device ID for the currently open multimedia device. The value of DeviceID is determined when a device is opened with the Open method. If no device is open, DeviceID is 0.

DeviceType#

Specifies a multimedia device type to open with the media player. DeviceType specifies a multimedia device type to open with the Open method. The default is dtAutoSelect. If DeviceType is dtAutoSelect, the device type is determined by the file extension specified in the FileName property. If no device type is associated with the extension, the correct device type must be explicitly specified by setting DeviceType to a value other than dtAutoSelect. A multimedia device is typically associated with an appropriate file name extension when the device is installed. Associations are specified in the registry or SYSTEM.INI file. See the documentation for the specific device for instructions about how to associate file name extensions with the device.

Display#

Specifies the display window for a multimedia device that uses a window for output. To use Display, assign the name of a windowed control such as a form or panel to Display to display output in that control. The default value of Display is nil (Delphi) or NULL (C++), meaning that the device creates its own window to display output. Also, by freeing the control assigned to Display after the device has been opened, video output will be in its own default window. Examples of multimedia devices that use a window to display output are Animation, AVI Video, Digital Video, Overlay, and VCR.

DisplayRect#

Specifies a rectangular area in the control specified by the Display property that is used to display output from a multimedia device. To display output in a specific rectangle area on a form assign a TRect record to DisplayRect. The Rect function can be used to create a TRect record. Media that use a rectangle to display output usually perform best if the default DisplayRect size is used. To set DisplayRect to the default size, position the rectangle in the upper left corner and use 0, 0 for the lower right corner. DisplayRect is ignored if Display is nil (Delphi) or NULL (C++). Examples of multimedia devices that use a window to display output are Animation, AVI Video, Digital Video, Overlay, and VCR.

Note: DisplayRect can be set only after the media device is opened.

DoubleBuffered#

Determines whether the control’s image is rendered directly to the window or painted to an in-memory bitmap first. When DoubleBuffered is false, the windowed control paints itself directly to the window. When DoubleBuffered is true, the windowed control paints itself to an in-memory bitmap that is then used to paint the window. Double buffering reduces the amount of flicker when the control repaints, but is more memory intensive. When a windowed control is a dock site and has an associated dock manager, it must be double-buffered.

Note: Some controls, such as TRichEdit, can’t paint themselves into a bitmap. For such controls, DoubleBuffered must be set to false.

Eject()#

Releases the loaded medium from the open multimedia device. Eject is called when the Eject button on the media player control is clicked at runtime. It ejects the loaded medium from the open multimedia device. Upon completion, Eject stores a numerical error code in the Error property, and the corresponding error message in the ErrorMessage property. The Wait property determines whether control is returned to the application before the Eject method has been completed. The Notify property determines whether Eject generates an OnNotify event.

Enabled#

Controls whether the control responds to mouse, keyboard, and timer events. Use Enabled to change the availability of the control to the user. To disable a control, set Enabled to False. Some disabled controls appear dimmed (for example: buttons, check boxes, labels), while others (container controls) simply lose their functionality without changing their appearance. If Enabled is set to False, the control ignores mouse, keyboard, and timer events. To re-enable a control, set Enabled to True.

Note: This property applies to all TControl descendants.

EnabledButtons#

Determines which buttons on the media player are usable. EnabledButtons controls which buttons on the media player are enabled and usable. An enabled button is colored and usable. A disabled button is dimmed and not usable. If a button is not enabled with EnabledButtons, it is disabled. By default, all buttons are enabled. If the AutoEnable property is true, AutoEnable supersedes EnabledButtons. The buttons automatically enabled or disabled by the media player override any buttons enabled or disabled with the EnabledButtons property.

EndPos#

Specifies the position within the currently loaded medium at which to stop playing or recording. EndPos is specified using the current time format, which is specified in the TimeFormat property. The EndPos property affects only the next Play or StartRecording method called after setting EndPos. Reset EndPos to affect any subsequent calls to Play or StartRecording.

Error#

Specifies the MCI error code returned by the media control method. Error specifies the MCI error code returned by the most recent media control method (Back, Close, Eject, Next, Open, Pause, PauseOnly, Play, Previous, StartRecording, Resume, Rewind, Step, or Stop). The ErrorMessage property describes the Error. The error code returned by media control methods are the same error code returned by the mciSendCommand function. The message describing the error code is stored in the ErrorMessage property. The value of Error is zero if the most recent media control method didn’t cause an error. If a method results in an error, a value other than zero is stored in Error. If the error occurs during the opening of the device, an EMCIDeviceError exception occurs.

ErrorMessage#

Describes the error code stored in the Error property. ErrorMessage specifies the error message that describes the error code returned from the most recent media control method (Back, Close, Eject, Next, Open, Pause, PauseOnly, Play, Previous, StartRecording, Resume, Rewind, Step, or Stop). The error code described by the message is stored in the Error property.

FileName#

Specifies the opened or saved media file. FileName specifies the media file to be opened by the Open method, or the file to save by the Save method. At design time, use a file open dialog box to specify the FileName property by clicking the ellipsis button (…) in the Object Inspector.

Frames#

Specifies the number of frames moved forward or backward. Frames specifies the number of frames the Step method steps forward or the Back method steps backward. Frames defaults to ten percent of the length of the currently loaded medium, which is specified by the Length property. The definition of a frame varies by multimedia device. For display media, a frame is one still image.

Hide()#

Hides the wrapped Control

Invalidate()#

Completely repaint control.

Length#

Specifies the length of the medium in the open multimedia device. Length is specified using the current time format, which is specified by the TimeFormat property.

Mode#

Indicates the state of the currently open multimedia device. Mode specifies the current state or mode of the currently open multimedia device. The TMPModes type defines the modes for a multimedia device used with a TMediaPlayer.

Next()#

Moves to the beginning of the next track of the currently loaded medium. If the current position is at the last track when Next is called, Next makes the current position the beginning of the last track. If the multimedia device doesn’t use tracks, Next goes to the end of the medium. Next is called when the Next button on the media player control is clicked at runtime. Upon completion, Next stores a numerical error code in the Error property, and the corresponding error message in the ErrorMessage property. The Wait property determines whether control is returned to the application before the Next method has completed. The Notify property determines whether Next generates an OnNotify event.

Notify#

Determines whether an OnNotify event is generated. Notify determines whether the next call to a media control method (Back, Close, Eject, Next, Open, Pause, PauseOnly, Play, Previous, StartRecording, Resume, Rewind, Step, or Stop) generates an OnNotify event when the method has completed. If Notify is true, the next media control method generates OnNotify event upon completion and stores the notification message in the NotifyValue property. If Notify is false, the method does not generate an OnNotify event and NotifyValue remains unchanged. Notify affects only the next call to a media control method. After an OnNotify event, Notify must be reset to affect any subsequent media control methods. By default, Play and StartRecording function as if Notify is true. Set Notify to false before calling Play or StartRecording to prevent an OnNotify event from being generated when playing or recording has finished. By default, all other media control methods function as if Notify is false.

Tip: Set Notify to true if the next media control is expected to take a long time, so the application is notified when the media control method has completed. If Notify is set to true, it is recommended to set Wait to false so that control returns to the application before the media control method is finished. Note: When trying to resume a device that doesn’t support Resume, the device is resumed as if the Play method was called. If Notify was assigned true before calling Resume (or any other media control method), Notify doesn’t affect the call to Resume. Resume does not generate an OnNotify event upon completion, and NotifyValue remains unchanged.

NotifyValue#

Indicates the result of the last media control method that requested a notification. NotifyValue reports the result of the last media control method (Back, Close, Eject, Next, Open, Pause, PauseOnly, Play, Previous, StartRecording, Resume, Rewind, Step, or Stop) that requested a notification. To request notification, set Notify to true before calling a media control method.

OnClick#

<Delphi property OnClick of type TMediaPlayer at 21141BF6A70>

OnContextPopup#

<Delphi property OnContextPopup of type TMediaPlayer at 21141BF6B40>

OnEnter#

<Delphi property OnEnter of type TMediaPlayer at 21141BF6C10>

OnExit#

<Delphi property OnExit of type TMediaPlayer at 21141BF6CE0>

OnMouseEnter#

<Delphi property OnMouseEnter of type TMediaPlayer at 21141BF6DB0>

OnMouseLeave#

<Delphi property OnMouseLeave of type TMediaPlayer at 21141BF6E80>

OnNotify#

<Delphi property OnNotify of type TMediaPlayer at 21141BF7020>

OnPostClick#

<Delphi property OnPostClick of type TMediaPlayer at 21141BF6F50>

Open()#

Opens a multimedia device. Use Open to open a multimedia device. The multimedia device type must be specified in the DeviceType property before a device can be opened. Upon completion, Open stores a numerical error code in the Error property, and the corresponding error message in the ErrorMessage property. The Wait property determines whether control is returned to the application before the Open method is completed. The Notify property determines whether Open generates an OnNotify event.

Parent#

Returns/Sets the Control Parent

ParentDoubleBuffered#

ParentDoubleBuffered defers the DoubleBuffered property of this component to the value of the parent’s DoubleBuffered property. ParentDoubleBuffered is a boolean indicating that the DoubleBuffered property of this component is overridden by the value of the parent’s DoubleBuffered property.

ParentShowHint#

Specifies where a control looks to find out if its Help Hint should be shown. Use ParentShowHint to ensure that all the controls on a form either uniformly show their Help Hints or uniformly do not show them. If ParentShowHint is True, the control uses the ShowHint property value of its parent. If ParentShowHint is False, the control uses the value of its own ShowHint property. To provide Help Hints only for selected controls on a form, set the ShowHint property for those controls that should have Help Hints to True, and ParentShowHint becomes False automatically.

Note: Enable or disable all Help Hints for the entire application using the ShowHint property of the application object.

Pause()#

Toggles the open multimedia device on or off. If the device is already paused when Pause is called, the device resumes playing or recording by calling the Resume method. Pause is called when the Pause button on the media player control is clicked at runtime. Upon completion, Pause stores a numerical error code in the Error property and the corresponding error message in the ErrorMessage property. The Wait property determines whether control is returned to the application before the Pause method has completed. The Notify property determines whether Pause generates an OnNotify event.

PauseOnly()#

Pauses the open multimedia device. If the device is already paused when PauseOnly is called, the device will remain paused. Upon completion, PauseOnly stores a numerical error code in the Error property and the corresponding error message in the ErrorMessage property. The Wait property determines whether control is returned to the application before the PauseOnly method has completed. The Notify property determines whether PauseOnly generates an OnNotify event.

Play()#

Plays the media loaded in the open multimedia device. Play is called when the Play button on the media player control is clicked at runtime. Upon completion, Play stores a numerical error code in the Error property and the corresponding error message in the ErrorMessage property. The Wait property determines whether control is returned to the application before the Play method has completed. The Notify property determines whether Play generates an OnNotify event. If the StartPos property is set, playing starts at the position specified in StartPos. Otherwise, playing starts at the current position, specified in the Position property. Similarly, if the EndPos property is set, playing stops at the position specified in EndPos. Otherwise, playing stops at the end of the medium. Whether the medium (specified in the Position property) is rewound before playing starts depends on the AutoRewind property.

PopupMenu#

Specifies the pop-up menu associated with the control. Assign a value to PopupMenu to make a pop-up menu appear when the user selects the control and clicks the right mouse button. If the TPopupMenu’s AutoPopup property is True, the pop-up menu appears automatically. If the menu’s AutoPopup property is False, display the menu with a call to its Popup method from the control’s OnContextPopup event handler.

Position#

Specifies the current position within the currently loaded medium. The value of Position is specified according to the current time format, which is specified in the TimeFormat property. Position defaults to the beginning of the medium. If the medium supports multiple tracks, Position defaults to the beginning of the first track.

Previous()#

Sets the current position to the beginning of the previous track if the position was at the beginning of a track when Previous was called. If the position is at the first track or somewhere other than the beginning of a track when Previous was called, Previous sets the current position to the beginning of the current track. If the device doesn’t use tracks, Previous sets the current position to the beginning of the medium, which is specified in the Start property. Previous is called when the Previous button on the media player control is clicked at runtime. Upon completion, Previous stores a numerical error code in the Error property and the corresponding error message in the ErrorMessage property. The Wait property determines whether control is returned to the application before the Previous method has completed. The Notify property determines whether Previous generates an OnNotify event.

Repaint()#

Forces the control to repaint its image on the screen.

Resume()#

Resumes playing or recording the currently paused multimedia device. Resume is called when the Pause button on the media player control is clicked at runtime, when the device is paused. Upon completion, Resume stores a numerical error code in the Error property, and the corresponding error message in the ErrorMessage property. The Wait property determines whether control is returned to the application before the Resume method has completed. The Notify property determines whether Resume generates an OnNotify event.

Rewind()#

Sets the current position to the beginning of the the medium, which is stored in the Start property. Upon completion, Rewind stores a numerical error code in the Error property, and the corresponding error message in the ErrorMessage property. The Wait property determines whether control is returned to the application before the Rewind method has completed. The Notify property determines whether Rewind generates an OnNotify event.

Save()#

Saves the currently loaded medium to the file specified in the FileName property. Save is ignored for devices that don’t use media stored in files (videodiscs, for example). Upon completion, Save stores a numerical error code in the Error property, and the corresponding error message in the ErrorMessage property. The Wait property determines whether control is returned to the application before the Save method has completed. The Notify property determines whether Save generates an OnNotify event.

ScreenToClient()#

Converts the screen coordinates of a specified point on the screen to client coordinates.

SendToBack()#

Puts a windowed control behind all other windowed controls, or puts a non-windowed control behind all other non-windowed controls.

SetBounds(Left, Top, Width, Height)#

Sets the Left, Top, Width, and Height properties all at once.

Shareable#

Determines whether more than one application can share a multimedia device. If Shareable is false, no other components or applications can access the device. If Shareable is true, more than one component or application can access the device. Shareable defaults to false. Be sure to set Shareable before opening a device. Some devices are not shareable. If Shareable is set to true for a device that isn’t shareable, the Open method fails and the error code is returned to the Error property.

Show()#

Shows the wrapped Control

ShowHint#

ShowHint specifies whether to show the Help Hint when the mouse pointer moves over the control. ShowHint determines whether the Help Hint appears for the control. The Help Hint is the value of the TControl.Hint property. The Help Hint appears in a box just beneath the control when the mouse pointer moves over the control. To enable Help Hints for a particular control, two conditions must be satisfied:

The application’s ShowHint property must be True. Either the control’s own ShowHint property must be True, or the control’s ParentShowHint property must be True and its parent’s ShowHint property must be True. For example, imagine a check box within a group box. If the ShowHint property of the group box is True and the ParentShowHint property of the check box is True, but the ShowHint property of the check box is False, the check box still displays its Help Hint. Changing the ShowHint value automatically sets the ParentShowHint property to False.

Start#

Specifies the starting position within the currently loaded medium. Start is the beginning of the medium for devices that don’t use tracks, or the beginning of the first track for devices that use tracks. Start is defined when a multimedia device is opened with the Open method. Start is specified according to the current time format, which is stored in the TimeFormat property. Start is read-only at runtime and is unavailable at design time.

StartPos#

Specifies the position within the currently loaded medium from which to begin playing or recording. StartPos is specified using the current time format, which is specified in the TimeFormat property. The StartPos property affects only the next Play or StartRecording method called after setting StartPos. Reset must be set to StartPos to affect any subsequent calls to Play or StartRecording. StartPos does not affect the current position of the medium (specified in the Position property) until the next Play or StartRecording method is called.

StartRecording()#

Begins recording from the current Position or from the position specified in StartPos. StartRecording is called when the Record button on the media player control is clicked at runtime. Upon completion, StartRecording stores a numerical error code in the Error property and the corresponding error message in the ErrorMessage property. The Wait property determines whether control is returned to the application before the StartRecording method has completed. The Notify property determines whether StartRecording generates an OnNotify event. By default, the Notify property becomes true, and the Wait property becomes false upon completion of the StartRecording method. However, if these properties have been set to specific values prior to calling StartRecording, they remain unchanged.

Step()#

Moves forward a number of frames (determined by the Frames property) in the currently loaded medium. Step is called when the Step button on the media player control is clicked at runtime. Upon completion, Step stores a numerical error code in the Error property and the corresponding error message in the ErrorMessage property. The Wait property determines whether control is returned to the application before the Step method has completed. The Notify property determines whether Step generates an OnNotify event.

Stop()#

Halts playing or recording. Stop is called when the Stop button on the media player control is clicked at runtime. Upon completion, Stop stores a numerical error code in the Error property, and the corresponding error message in the ErrorMessage property. The Wait property determines whether control is returned to the application before the Stop method has completed. The Notify property determines whether Stop generates an OnNotify event.

StyleName#

Embarcadero Technologies does not currently have any additional information.

TabOrder#

Indicates the position of the control in its parent’s tab order. TabOrder is the order in which child windows are visited when the user presses the Tab key. The control with the TabOrder value of 0 is the control that has the focus when the form first appears. Initially, the tab order is always the order in which the controls were added to the form. The first control added to the form has a TabOrder value of 0, the second is 1, the third is 2, and so on. Change this by changing the TabOrder property. Each control has a unique tab-order value within its parent. If you change the TabOrder property value of one control to be the same as the value of a second control, the TabOrder value for all the other controls changes. For example, suppose a control is sixth in the tab order. If you change the control’s TabOrder property value to 3 (making the control fourth in the tab order), the control that was originally fourth in the tab order now becomes fifth, and the control that was fifth becomes sixth. Assigning TabOrder a value greater than the number of controls contained in the parent control moves the control to the end of the tab order. The control does not take on the assigned value of TabOrder, but instead is given the number that assures the control is the last in the tab order.

Note: TabOrder is meaningful only if the TabStop property is True and if the control has a parent. (The TabOrder property of a form is not used unless the form is the child of another form.) A control with a TabOrder of -1 has no parent, and therefore cannot be reached by pressing the Tab key. To remove a parented control from the Tab order, set its TabStop property to False.

TabStop#

Determines whether the user can tab to a control. Use the TabStop to allow or disallow access to the control using the Tab key. If TabStop is True, the control is in the tab order. If TabStop is False, the control is not in the tab order and the user cannot press the TAB key to move to the control.

Note: TabStop is not meaningful for a form unless the form assigns another form to be its parent.

TimeFormat#

Determines the format used to specify position information. TimeFormat determines how the StartPos, Length, Position, Start, and EndPos properties are interpreted. For example, if Position is 180 and TimeFormat is tfMilliseconds, the current position is 180 milliseconds into the medium. If Position is 180 and TimeFormat is tfMSF, the current position is 180 minutes into the medium. Not all formats are supported by every device. When trying to set an unsupported format, the assignment is ignored. The current timing information is always passed in a 4-byte integer. In some formats, the timing information returned is not really one integer, but single bytes of information packed in the long integer.

TrackLength#

<Delphi indexed property TrackLength of type TMediaPlayer at 21141267EF0>

TrackPosition#

<Delphi indexed property TrackPosition of type TMediaPlayer at 21141267FB0>

Tracks#

Specifies the number of playable tracks on the open multimedia device. Tracks indicates how many of playable tracks are available on the open multimedia device. Tracks is undefined for devices that don’t use tracks.

Update()#

Processes any pending paint messages immediately.

Visible#

Specifies whether the component appears onscreen. Use the Visible property to control the visibility of the control at run time. If Visible is True, the control appears. If Visible is False, the control is not visible. Calling the Show method sets the control’s Visible property to True. Calling the Hide method sets it to False. For TCustomForm descendants, the Show and ShowModal methods set Visible to True and bring the form to the front of all open windows. For TTabSheet descendants, Visible does not control the visibility of the control at run time. For more information, see the description of the TabVisible property.

VisibleButtons#

Indicates which of the buttons on the media player are visible. VisibleButtons determines which buttons on the media player that are visible. If a button is not made visible with VisibleButtons, it does not appear on the media player control. By default, all buttons are visible when a media player component is added to a form.

Wait#

Determines whether a media control method returns control to the application only after it has been completed. Wait determines whether a media control method (Back, Close, Eject, Next, Open, Pause, PauseOnly, Play, Previous, StartRecording, Resume, Rewind, Step, or Stop) returns control to the application only after it has been completed. Wait is unavailable at design time. If Wait is true, the media player component waits until the next media control method has completed before returning control to the application. If Wait is false, the application won’t wait for the next media control method to finish before continuing. Wait affects only the next media control method called after setting Wait. Wait must be reset to affect any subsequent call to a media control method. By default, Play and StartRecording function as if Wait is false. Wait must be set to true before calling Play or StartRecording to prevent control from returning to the application before playing or recording has finished. By default, all other media control methods function as if Wait is true.

Note: Wait is usually set to false only if the next media control is expected to take a long time, so that the application can execute other code before the media control method has completed. If Wait is set to false, you should set Notify to true so the application is notified when the media control method completes.