点击或拖拽改变大小

MediaPlayer 属性

MediaPlayer 类型公开以下成员。

属性
  名称说明
公共属性AspectRatio
Get/set current video aspect ratio. Set to null to reset to default Invalid aspect ratios are ignored.
公共属性AudioDelay
Get current audio delay (microseconds).
公共属性AudioOutputDeviceEnum
Gets a list of potential audio output devices

Not all audio outputs support enumerating devices. The audio output may be functional even if the list is empty (NULL). The list may not be exhaustive. Some audio output devices in the list might not actually work in some circumstances.

By default, it is recommended to not specify any explicit audio device.

公共属性AudioTrack
Get current audio track ID or -1 if no active input.
公共属性AudioTrackCount
Get the number of available audio tracks (int), or -1 if unavailable
公共属性AudioTrackDescription
Retrive the audio track description
公共属性CanPause
True if the media player can pause
公共属性Channel
Get current audio channel.
公共属性Chapter
Set movie chapter (if applicable).

Get the movie chapter number currently playing, or -1 if there is no media.

公共属性ChapterCount
Get the number of chapters in movie, or -1.
公共属性CropGeometry
Get/Set current crop filter geometry. Empty string to unset
公共属性EnableHardwareDecoding
Enable/disable hardware decoding in a crossplatform way.
公共属性EnableKeyInput
Enable or disable key press events handling, according to the LibVLC hotkeys configuration. By default and for historical reasons, keyboard events are handled by the LibVLC video widget. Note On X11, there can be only one subscriber for key press and mouse click events per window. If your application has subscribed to those events for the X window ID of the video widget, then LibVLC will not be able to handle key presses and mouse clicks in any case. Warning This function is only implemented for X11 and Win32 at the moment. true to handle key press events, false to ignore them.
公共属性EnableMouseInput
Enable or disable mouse click events handling. By default, those events are handled. This is needed for DVD menus to work, as well as a few video filters such as "puzzle". Warning This function is only implemented for X11 and Win32 at the moment. true to handle mouse click events, false to ignore them.
公共属性FileCaching
Caching value for local files, in milliseconds [0 .. 60000ms]
公共属性Fps
Get the frames per second (fps) for this playing movie, or 0 if unspecified
公共属性Fullscreen
Enable or disable fullscreen. Warning, TL;DR version : Unless you know what you're doing, don't use this. Put your VideoView inside a fullscreen control instead, refer to your platform documentation.

Warning, long version : With most window managers, only a top-level windows can be in full-screen mode. Hence, this function will not operate properly if libvlc_media_player_set_xwindow() was used to embed the video in a non-top-level window. In that case, the embedding window must be reparented to the root window before fullscreen mode is enabled. You will want to reparent it back to its normal parent when disabling fullscreen.

return the fullscreen status (boolean)

公共属性Hwnd
Set a Win32/Win64 API window handle (HWND) where the media player should render its video output. If LibVLC was built without Win32/Win64 API output support, then this has no effects.

Get the Windows API window handle (HWND) previously set

公共属性IsPlaying
return true if the media player is playing, false otherwise
公共属性IsSeekable
True if the media player can seek
公共属性Length
The movie length (in ms), or -1 if there is no media.
公共属性Media
Get the media used by the media_player. Set the media that will be used by the media_player. If any, previous md will be released. Note: It is safe to release the Media on the C# side after it's been set on the MediaPlayer successfully
公共属性Mute
Get current mute status. Set mute status. Warning This function does not always work. If there are no active audio playback stream, the mute status might not be available. If digital pass-through (S/PDIF, HDMI...) is in use, muting may be unapplicable. Also some audio output plugins do not support muting at all. Note To force silent playback, disable all audio tracks. This is more efficient and reliable than mute.
公共属性NativeReference
The pointer to the native code representation of this object
(继承自 Internal。)
公共属性NetworkCaching
Caching value for network resources, in milliseconds [0 .. 60000ms]
公共属性NsObject
Get the NSView handler previously set return the NSView handler or 0 if none where set

Set the NSView handler where the media player should render its video output. Use the vout called "macosx".

The drawable is an NSObject that follow the VLCOpenGLVideoViewEmbedding protocol: VLCOpenGLVideoViewEmbedding NSObject Or it can be an NSView object. If you want to use it along with Qt4 see the QMacCocoaViewContainer. Then the following code should work: { NSView *video = [[NSView alloc] init]; QMacCocoaViewContainer *container = new QMacCocoaViewContainer(video, parent); libvlc_media_player_set_nsobject(mp, video); [video release]; } You can find a live example in VLCVideoView in VLCKit.framework.

公共属性OutputDevice
Get the current audio output device identifier. This complements SetOutputDevice(String, String) warning The initial value for the current audio output device identifier may not be set or may be some unknown value.A LibVLC application should compare this value against the known device identifiers (e.g.those that were previously retrieved by a call to AudioOutputDeviceEnum or AudioOutputDevices(String)) to find the current audio output device. It is possible that the selected audio output device changes(an external change) without a call to SetOutputDevice(String, String).That may make this method unsuitable to use if a LibVLC application is attempting to track dynamic audio device changes as they happen.
公共属性Position
Set movie position as percentage between 0.0 and 1.0. This has no effect if playback is not enabled. This might not work depending on the underlying input format and protocol.

Get movie position as percentage between 0.0 and 1.0.

公共属性ProgramScambled
True if the current program is scrambled

LibVLC 2.2.0 or later

公共属性Rate
Get the requested movie play rate. warning

Depending on the underlying media, the requested rate may be different from the real playback rate.

公共属性Role
Gets the media role.

version LibVLC 3.0.0 and later.

公共属性Scale
Get/Set the current video scaling factor. See also MediaPlayer::setScale() . That is the ratio of the number of pixels on screen to the number of pixels in the original decoded video in each dimension.Zero is a special value; it will adjust the video to the output window/drawable(in windowed mode) or the entire screen. Note that not all video outputs support scaling.
公共属性Spu
The current video subtitle track
公共属性SpuCount
Get the number of available video subtitles.
公共属性SpuDelay
Get the current subtitle delay.
公共属性SpuDescription
Retrieve SpuDescription in a TrackDescription struct
公共属性State
Get the current state of the media player (playing, paused, ...)
公共属性Teletext
Get current teletext page requested. Set new teletext page to retrieve.
公共属性Time
Set the movie time (in ms). This has no effect if no media is being played. Not all formats and protocols support this.

Get the movie time (in ms), or -1 if there is no media.

公共属性Title
Set movie title number to play

Get movie title number currently playing, or -1

公共属性TitleCount
The title number count, or -1
公共属性TitleDescription
Get the description of available titles.
公共属性VideoTrack
Get current video track ID (int) or -1 if no active input.
公共属性VideoTrackCount
Get number of available video tracks.
公共属性VideoTrackDescription
Get the description of available video tracks.
公共属性Viewpoint
Current 360 viewpoint of this mediaplayer.

Update with UpdateViewpoint(Single, Single, Single, Single, Boolean)

公共属性Volume
Get/Set the volume in percents (0 = mute, 100 = 0dB)
公共属性VoutCount
Get the number of video outputs
公共属性WillPlay
True if the player is able to play
公共属性XWindow
Set an X Window System drawable where the media player should render its video output. The call takes effect when the playback starts. If it is already started, it might need to be stopped before changes apply. If LibVLC was built without X11 output support, then this function has no effects. By default, LibVLC will capture input events on the video rendering area. Use libvlc_video_set_mouse_input() and libvlc_video_set_key_input() to disable that and deliver events to the parent window / to the application instead. By design, the X11 protocol delivers input events to only one recipient.

Warning: The application must call the XInitThreads() function from Xlib before libvlc_new(), and before any call to XOpenDisplay() directly or via any other library.Failure to call XInitThreads() will seriously impede LibVLC performance. Calling XOpenDisplay() before XInitThreads() will eventually crash the process. That is a limitation of Xlib. uint: X11 window ID

Top
参见