### Capture Device URI Examples Source: https://unosquare.github.io/ffmediaelement/index.html Examples of URI strings used to open capture devices such as microphones, webcams, and screen capture via GDI. ```text device://dshow/?audio=Microphone (Vengeance 2100):video=MS Webcam 4000 device://gdigrab?title=Command Prompt device://gdigrab?desktop ``` -------------------------------- ### Install FFME NuGet Package Source: https://unosquare.github.io/ffmediaelement/index.html Command to install the FFME.Windows package via the Package Manager Console. ```powershell PM> Install-Package FFME.Windows ``` -------------------------------- ### Position property Source: https://unosquare.github.io/ffmediaelement/api/Unosquare.FFME.MediaElement.html Gets or sets the current playback position. ```APIDOC ## Position ### Description Gets/Sets the Position property on the MediaElement. ### Declaration ```csharp public TimeSpan Position { get; set; } ``` ### Property Value | Type | Description | |---|---| | TimeSpan | | ``` -------------------------------- ### Balance property Source: https://unosquare.github.io/ffmediaelement/api/Unosquare.FFME.MediaElement.html Gets or sets the audio balance on the MediaElement. ```APIDOC ## Balance ### Description Gets/Sets the Balance property on the MediaElement. ### Declaration ```csharp public double Balance { get; set; } ``` ### Property Value | Type | Description | |---|---| | Double | | ``` -------------------------------- ### LoopingBehavior property Source: https://unosquare.github.io/ffmediaelement/api/Unosquare.FFME.MediaElement.html Gets or sets the behavior when the media ends. ```APIDOC ## LoopingBehavior ### Description Specifies how the media should behave when it has ended. The default behavior is to Pause the media. ### Declaration ```csharp public MediaPlaybackState LoopingBehavior { get; set; } ``` ### Property Value | Type | Description | |---|---| | MediaPlaybackState | | ``` -------------------------------- ### SpeedRatio property Source: https://unosquare.github.io/ffmediaelement/api/Unosquare.FFME.MediaElement.html Gets or sets the speed ratio of playback. ```APIDOC ## SpeedRatio ### Description Gets/Sets the SpeedRatio property on the MediaElement. ### Declaration ```csharp public double SpeedRatio { get; set; } ``` ### Property Value | Type | Description | |---|---| | Double | | ``` -------------------------------- ### LoadedBehavior property Source: https://unosquare.github.io/ffmediaelement/api/Unosquare.FFME.MediaElement.html Gets or sets the state the media element should enter when it is loaded. ```APIDOC ## LoadedBehavior ### Description Specifies the action that the media element should execute when it is loaded. The default behavior is that it is under manual control (i.e. the caller should call methods such as Play in order to play the media). If a source is set, then the default behavior changes to to be playing the media. If a source is set and a loaded behavior is also set, then the loaded behavior takes control. ### Declaration ```csharp public MediaPlaybackState LoadedBehavior { get; set; } ``` ### Property Value | Type | Description | |---|---| | MediaPlaybackState | | ``` -------------------------------- ### GetForeground(MediaElement) Source: https://unosquare.github.io/ffmediaelement/api/Unosquare.FFME.Subtitles.html Gets the text foreground associated with the specified MediaElement. ```APIDOC ## GetForeground(MediaElement) ### Description Gets the text foreground. ### Method GetForeground ### Parameters - **element** (MediaElement) - The object. ### Returns - **Brush** - The value. ``` -------------------------------- ### Volume property Source: https://unosquare.github.io/ffmediaelement/api/Unosquare.FFME.MediaElement.html Gets or sets the volume of the media (valid range 0 to 1). ```APIDOC ## Volume ### Description Gets/Sets the Volume property on the MediaElement. Note: Valid values are from 0 to 1. ### Declaration ```csharp public double Volume { get; set; } ``` ### Property Value | Type | Description | |---|---| | Double | | ``` -------------------------------- ### GetText(MediaElement) Source: https://unosquare.github.io/ffmediaelement/api/Unosquare.FFME.Subtitles.html Gets the text associated with the specified MediaElement. ```APIDOC ## GetText(MediaElement) ### Description Gets the text. ### Method GetText ### Parameters - **element** (MediaElement) - The object. ### Returns - **String** - The value. ``` -------------------------------- ### Stretch property Source: https://unosquare.github.io/ffmediaelement/api/Unosquare.FFME.MediaElement.html Gets or sets the stretch setting that determines how the media is drawn. ```APIDOC ## Stretch ### Description Gets/Sets the Stretch on this MediaElement. The Stretch property determines how large the MediaElement will be drawn. ### Declaration ```csharp public Stretch Stretch { get; set; } ``` ### Property Value | Type | Description | |---|---| | Stretch | | ``` -------------------------------- ### GetEffect(MediaElement) Source: https://unosquare.github.io/ffmediaelement/api/Unosquare.FFME.Subtitles.html Gets the effect associated with the specified MediaElement. ```APIDOC ## GetEffect(MediaElement) ### Description Gets the effect. ### Method GetEffect ### Parameters - **element** (MediaElement) - The object. ### Returns - **Effect** - The value. ``` -------------------------------- ### RenderingAudioEventArgs.GetBufferData() Source: https://unosquare.github.io/ffmediaelement/api/Unosquare.FFME.Common.RenderingAudioEventArgs.html Gets the raw data buffer going into the audio device. Samples are provided in PCM 16-bit signed, interleaved stereo. ```APIDOC ## GetBufferData() ### Description Gets the raw data buffer going into the audio device. Samples are provided in PCM 16-bit signed, interleaved stereo. ### Method GetBufferData ### Return Type Byte[] ### Returns The buffer data as an array. ``` -------------------------------- ### GetOutlineWidth(MediaElement) Source: https://unosquare.github.io/ffmediaelement/api/Unosquare.FFME.Subtitles.html Gets the width of the outline associated with the specified MediaElement. ```APIDOC ## GetOutlineWidth(MediaElement) ### Description Gets the width of the outline. ### Method GetOutlineWidth ### Parameters - **element** (MediaElement) - The object. ### Returns - **Thickness** - The value. ``` -------------------------------- ### GetOutlineBrush(MediaElement) Source: https://unosquare.github.io/ffmediaelement/api/Unosquare.FFME.Subtitles.html Gets the outline brush associated with the specified MediaElement. ```APIDOC ## GetOutlineBrush(MediaElement) ### Description Gets the outline brush. ### Method GetOutlineBrush ### Parameters - **element** (MediaElement) - The object. ### Returns - **Brush** - The value. ``` -------------------------------- ### IsMuted property Source: https://unosquare.github.io/ffmediaelement/api/Unosquare.FFME.MediaElement.html Gets or sets whether the media is muted. ```APIDOC ## IsMuted ### Description Gets/Sets the IsMuted property on the MediaElement. ### Declaration ```csharp public bool IsMuted { get; set; } ``` ### Property Value | Type | Description | |---|---| | Boolean | | ``` -------------------------------- ### RendererOptions property Source: https://unosquare.github.io/ffmediaelement/api/Unosquare.FFME.MediaElement.html Gets access to internal renderer options. Advanced feature. ```APIDOC ## RendererOptions ### Description Provides access to various internal media renderer options. The default options are optimal to work for most media streams. This is an advanced feature and it is not recommended to change these options without careful consideration. ### Declaration ```csharp public RendererOptions RendererOptions { get; } ``` ### Property Value | Type | Description | |---|---| | RendererOptions | | ``` -------------------------------- ### GetFontSize(MediaElement) Source: https://unosquare.github.io/ffmediaelement/api/Unosquare.FFME.Subtitles.html Gets the font size associated with the specified MediaElement. ```APIDOC ## GetFontSize(MediaElement) ### Description Gets the size of the font. ### Method GetFontSize ### Parameters - **element** (MediaElement) - The object. ### Returns - **Double** - The value. ``` -------------------------------- ### GetFontWeight(MediaElement) Source: https://unosquare.github.io/ffmediaelement/api/Unosquare.FFME.Subtitles.html Gets the font weight associated with the specified MediaElement. ```APIDOC ## GetFontWeight(MediaElement) ### Description Gets the font weight. ### Method GetFontWeight ### Parameters - **element** (MediaElement) - The object. ### Returns - **FontWeight** - The value. ``` -------------------------------- ### UnloadedBehavior property Source: https://unosquare.github.io/ffmediaelement/api/Unosquare.FFME.MediaElement.html Gets or sets the behavior for handling resources when the unloaded event fires. ```APIDOC ## UnloadedBehavior ### Description Specifies how the underlying media engine's resources should be handled when the unloaded event gets fired. The default behavior is to Close and release the resources. ### Declaration ```csharp public MediaPlaybackState UnloadedBehavior { get; set; } ``` ### Property Value | Type | Description | |---|---| | MediaPlaybackState | | ``` -------------------------------- ### GetFontFamily(MediaElement) Source: https://unosquare.github.io/ffmediaelement/api/Unosquare.FFME.Subtitles.html Gets the font family associated with the specified MediaElement. ```APIDOC ## GetFontFamily(MediaElement) ### Description Gets the font family. ### Method GetFontFamily ### Parameters - **element** (MediaElement) - The object. ### Returns - **FontFamily** - The value. ``` -------------------------------- ### IsDesignPreviewEnabled property Source: https://unosquare.github.io/ffmediaelement/api/Unosquare.FFME.MediaElement.html Gets or sets a value indicating whether the MediaElement shows a preview image in design time. ```APIDOC ## IsDesignPreviewEnabled ### Description Gets or sets a value that indicates whether the MediaElement will display a preview image in design time. This is a dependency property. ### Declaration ```csharp public bool IsDesignPreviewEnabled { get; set; } ``` ### Property Value | Type | Description | |---|---| | Boolean | | ``` -------------------------------- ### StretchDirection property Source: https://unosquare.github.io/ffmediaelement/api/Unosquare.FFME.MediaElement.html Gets or sets the stretch direction to control scaling restrictions. ```APIDOC ## StretchDirection ### Description Gets/Sets the stretch direction of the ViewBox, which determines the restrictions on scaling that are applied to the content inside the ViewBox. For instance, this property can be used to prevent the content from being smaller than its native size or larger than its native size. ### Declaration ```csharp public StretchDirection StretchDirection { get; set; } ``` ### Property Value | Type | Description | |---|---| | StretchDirection | | ``` -------------------------------- ### IgnorePixelAspectRatio property Source: https://unosquare.github.io/ffmediaelement/api/Unosquare.FFME.MediaElement.html Gets or sets whether to ignore the pixel aspect ratio when stretching content. ```APIDOC ## IgnorePixelAspectRatio ### Description Gets/Sets the stretch direction of the ViewBox, which determines the restrictions on scaling that are applied to the content inside the ViewBox. For instance, this property can be used to prevent the content from being smaller than its native size or larger than its native size. ### Declaration ```csharp public bool IgnorePixelAspectRatio { get; set; } ``` ### Property Value | Type | Description | |---|---| | Boolean | | ``` -------------------------------- ### ScrubbingEnabled property Source: https://unosquare.github.io/ffmediaelement/api/Unosquare.FFME.MediaElement.html Gets or sets a value indicating whether frames are updated during seek when paused. ```APIDOC ## ScrubbingEnabled ### Description Gets or sets a value that indicates whether the MediaElement will update frames for seek operations while paused. This is a dependency property. ### Declaration ```csharp public bool ScrubbingEnabled { get; set; } ``` ### Property Value | Type | Description | |---|---| | Boolean | | ``` -------------------------------- ### ClosedCaptionsChannel property Source: https://unosquare.github.io/ffmediaelement/api/Unosquare.FFME.MediaElement.html Gets or sets the closed captions channel, used to select a caption track (0 or 1). ```APIDOC ## ClosedCaptionsChannel ### Description Gets/Sets the ClosedCaptionsChannel property on the MediaElement. Note: Valid values are from 0 to 1. ### Declaration ```csharp public CaptionsChannel ClosedCaptionsChannel { get; set; } ``` ### Property Value | Type | Description | |---|---| | CaptionsChannel | | ``` -------------------------------- ### VerticalSyncEnabled property Source: https://unosquare.github.io/ffmediaelement/api/Unosquare.FFME.MediaElement.html Gets or sets a value that indicates whether to update frames for seek operations while paused. (dependency property) ```APIDOC ## VerticalSyncEnabled ### Description Gets or sets a value that indicates whether the MediaElement will update frames for seek operations while paused. This is a dependency property. ### Declaration ```csharp public bool VerticalSyncEnabled { get; set; } ``` ### Property Value | Type | Description | |---|---| | Boolean | | ``` -------------------------------- ### Configure FFmpeg Directory Source: https://unosquare.github.io/ffmediaelement/index.html Set the FFmpeg binary directory in the application's startup code. ```csharp Unosquare.FFME.Library.FFmpegDirectory = @"c:\ffmpeg"; ``` -------------------------------- ### MediaElement Constructor Source: https://unosquare.github.io/ffmediaelement/api/Unosquare.FFME.MediaElement.html Initializes a new instance of the MediaElement class. ```APIDOC ## MediaElement() ### Description Initializes a new instance of the MediaElement class. ### Declaration ```csharp public MediaElement() ``` ``` -------------------------------- ### Library.EnumerateLegacyAudioDevices() Source: https://unosquare.github.io/ffmediaelement/api/Unosquare.FFME.Library.html Enumerates the available Legacy Windows Multimedia Extensions (MME) audio devices. ```APIDOC ## Library.EnumerateLegacyAudioDevices() ### Description Enumerates the (Legacy) Windows Multimedia Extensions devices available on the system. ### Method EnumerateLegacyAudioDevices ### Endpoint Library.EnumerateLegacyAudioDevices() ### Parameters None ### Returns - **IEnumerable** - The available MME devices. ``` -------------------------------- ### AudioDeviceInfo.ToString() Source: https://unosquare.github.io/ffmediaelement/api/Unosquare.FFME.Common.AudioDeviceInfo-1.html Returns a string that represents this instance. ```APIDOC ## ToString() ### Description Returns a String that represents this instance. ### Method ToString() ### Returns - **String** - A String that represents this instance. ``` -------------------------------- ### LegacyAudioException Constructors Source: https://unosquare.github.io/ffmediaelement/api/Unosquare.FFME.Common.LegacyAudioException.html Constructors for the LegacyAudioException class, allowing initialization with no parameters, a message, a message and inner exception, or a Windows API result and function name. ```APIDOC ## LegacyAudioException() ### Description Initializes a new instance of the LegacyAudioException class. ### Declaration public LegacyAudioException() ## LegacyAudioException(String) ### Description Initializes a new instance of the LegacyAudioException class with a specified error message. ### Declaration public LegacyAudioException(string message) ### Parameters - **message** (String) - The error message. ## LegacyAudioException(String, Exception) ### Description Initializes a new instance of the LegacyAudioException class with a specified error message and a reference to the inner exception that is the cause of this exception. ### Declaration public LegacyAudioException(string message, Exception innerException) ### Parameters - **message** (String) - The error message. - **innerException** (Exception) - The inner exception. ## LegacyAudioException(LegacyAudioResult, String) ### Description Initializes a new instance of the LegacyAudioException class with a Windows API result and the name of the failed function. ### Declaration public LegacyAudioException(LegacyAudioResult result, string functionName) ### Parameters - **result** (LegacyAudioResult) - The result returned by the Windows API call. - **functionName** (String) - The name of the Windows API that failed. ``` -------------------------------- ### Library.EnumerateDirectSoundDevices() Source: https://unosquare.github.io/ffmediaelement/api/Unosquare.FFME.Library.html Enumerates the available DirectSound devices and returns them as an enumerable collection. ```APIDOC ## Library.EnumerateDirectSoundDevices() ### Description Enumerates the DirectSound devices available on the system. ### Method EnumerateDirectSoundDevices ### Endpoint Library.EnumerateDirectSoundDevices() ### Parameters None ### Returns - **IEnumerable** - The available DirectSound devices. ``` -------------------------------- ### RenderingEventArgs Constructor Source: https://unosquare.github.io/ffmediaelement/api/Unosquare.FFME.Common.RenderingEventArgs.html Initializes a new instance of the RenderingEventArgs class. ```APIDOC ## RenderingEventArgs(IMediaEngineState, StreamInfo, TimeSpan, TimeSpan, TimeSpan, Int64) ### Description Initializes a new instance of the RenderingEventArgs class. ### Declaration ```csharp protected RenderingEventArgs(IMediaEngineState engineState, StreamInfo stream, TimeSpan startTime, TimeSpan duration, TimeSpan clock, long pts) ``` ### Parameters - **engineState** (IMediaEngineState) - The media engine state. - **stream** (StreamInfo) - The stream. - **startTime** (TimeSpan) - The position. - **duration** (TimeSpan) - The duration. - **clock** (TimeSpan) - The clock. - **pts** (Int64) - The original unadjusted PTS of the frame. ``` -------------------------------- ### DirectSoundDeviceInfo Class Definition Source: https://unosquare.github.io/ffmediaelement/api/Unosquare.FFME.Common.DirectSoundDeviceInfo.html The class definition for DirectSoundDeviceInfo, showing its inheritance and namespace. ```APIDOC ## Class DirectSoundDeviceInfo ### Description Represents information about a DirectSound audio device. ### Namespace Unosquare.FFME.Common ### Syntax public sealed class DirectSoundDeviceInfo : AudioDeviceInfo ### Inheritance Object -> AudioDeviceInfo -> DirectSoundDeviceInfo ### Inherited Members - AudioDeviceInfo.DeviceId - AudioDeviceInfo.Name - AudioDeviceInfo.Provider - AudioDeviceInfo.Tag - AudioDeviceInfo.IsDefault - AudioDeviceInfo.ToString() - Object.Equals(Object) - Object.Equals(Object, Object) - Object.ReferenceEquals(Object, Object) - Object.GetHashCode() - Object.GetType() - Object.MemberwiseClone() ``` -------------------------------- ### Open and Close Media Source: https://unosquare.github.io/ffmediaelement/index.html Asynchronous methods to open and close media files or streams. ```csharp await Media.Open(new Uri(@"c:\your-file-here")); await Media.Close(); ``` -------------------------------- ### CaptureBitmapAsync() Source: https://unosquare.github.io/ffmediaelement/api/Unosquare.FFME.MediaElement.html Captures the currently displayed video image and returns a GDI bitmap. ```APIDOC ## CaptureBitmapAsync() ### Description Captures the currently displayed video image and returns a GDI bitmap. ### Declaration public ConfiguredTaskAwaitable CaptureBitmapAsync() ### Returns - ConfiguredTaskAwaitable - The GDI bitmap copied from the video renderer. ``` -------------------------------- ### RenderingSubtitles Event Source: https://unosquare.github.io/ffmediaelement/api/Unosquare.FFME.MediaElement.html Occurs right before the subtitles are rendered. You can update the text. ```APIDOC ## RenderingSubtitles Event ### Description Occurs right before the subtitles are rendered. You can update the text. Ensure you handle this quickly before you get choppy subtitles. ### Declaration public event EventHandler RenderingSubtitles ### Event Type - EventHandler ``` -------------------------------- ### SetOutlineWidth(MediaElement, Thickness) Source: https://unosquare.github.io/ffmediaelement/api/Unosquare.FFME.Subtitles.html Sets the width of the outline on the specified MediaElement. ```APIDOC ## SetOutlineWidth(MediaElement, Thickness) ### Description Sets the width of the outline. ### Method SetOutlineWidth ### Parameters - **element** (MediaElement) - The object. - **value** (Thickness) - The value. ``` -------------------------------- ### RenderingAudio Event Source: https://unosquare.github.io/ffmediaelement/api/Unosquare.FFME.MediaElement.html Occurs right before the audio is added to the audio buffer. You can update the bytes before they are queued. ```APIDOC ## RenderingAudio Event ### Description Occurs right before the audio is added to the audio buffer. You can update the bytes before they are queued. Ensure you handle this quickly before you get choppy audio. ### Declaration public event EventHandler RenderingAudio ### Event Type - EventHandler ``` -------------------------------- ### RenderingSubtitlesEventArgs Class Source: https://unosquare.github.io/ffmediaelement/api/Unosquare.FFME.Common.RenderingSubtitlesEventArgs.html Provides the subtitles rendering payload as event arguments. This class is sealed and inherits from RenderingEventArgs. ```APIDOC ## Class RenderingSubtitlesEventArgs ### Description Provides the subtitles rendering payload as event arguments. ### Inheritance Object -> EventArgs -> RenderingEventArgs -> RenderingSubtitlesEventArgs ### Namespace Unosquare.FFME.Common ### Syntax public sealed class RenderingSubtitlesEventArgs : RenderingEventArgs ### Properties #### Cancel When set to true, clears the current subtitle and prevents the subtitle block from being rendered. - Declaration: public bool Cancel { get; set; } - Property Value: Boolean #### Format Gets the type of subtitle format the original subtitle text is in. - Declaration: public AVSubtitleType Format { get; } - Property Value: AVSubtitleType #### OriginalText Gets the text as originally decoded including all markup and formatting. - Declaration: public IList OriginalText { get; } - Property Value: IList #### Text Gets the text stripped out of ASS or SRT formatting. This is what the default subtitle renderer will display on the screen. - Declaration: public IList Text { get; } - Property Value: IList ``` -------------------------------- ### SetOutlineBrush(MediaElement, Brush) Source: https://unosquare.github.io/ffmediaelement/api/Unosquare.FFME.Subtitles.html Sets the outline brush on the specified MediaElement. ```APIDOC ## SetOutlineBrush(MediaElement, Brush) ### Description Sets the outline brush. ### Method SetOutlineBrush ### Parameters - **element** (MediaElement) - The object. - **value** (Brush) - The value. ``` -------------------------------- ### SetText(MediaElement, String) Source: https://unosquare.github.io/ffmediaelement/api/Unosquare.FFME.Subtitles.html Sets the text on the specified MediaElement. ```APIDOC ## SetText(MediaElement, String) ### Description Sets the text. ### Method SetText ### Parameters - **element** (MediaElement) - The object. - **value** (String) - The value. ``` -------------------------------- ### RenderingVideo Event Source: https://unosquare.github.io/ffmediaelement/api/Unosquare.FFME.MediaElement.html Occurs right before the video is presented on the screen. You can update the pixels on the bitmap before it is rendered on the screen. ```APIDOC ## RenderingVideo Event ### Description Occurs right before the video is presented on the screen. You can update the pixels on the bitmap before it is rendered on the screen. Or you could take a screen shot. Ensure you handle this very quickly as it runs on the UI thread. ### Declaration public event EventHandler RenderingVideo ### Event Type - EventHandler ``` -------------------------------- ### SetForeground(MediaElement, Brush) Source: https://unosquare.github.io/ffmediaelement/api/Unosquare.FFME.Subtitles.html Sets the text foreground on the specified MediaElement. ```APIDOC ## SetForeground(MediaElement, Brush) ### Description Sets the text foreground. ### Method SetForeground ### Parameters - **element** (MediaElement) - The object. - **value** (Brush) - The value. ``` -------------------------------- ### MediaElement Dependency Properties Source: https://unosquare.github.io/ffmediaelement/api/Unosquare.FFME.MediaElement.html Dependency properties for the MediaElement control, including Balance, ClosedCaptionsChannel, IgnorePixelAspectRatio, IsDesignPreviewEnabled, IsMuted, LoadedBehavior, LoopingBehavior, Position, ScrubbingEnabled, SpeedRatio, StretchDirection, Stretch, UnloadedBehavior, VerticalSyncEnabled, and Volume. ```APIDOC ## Dependency Properties ### BalanceProperty #### Description The DependencyProperty for the MediaElement.Balance property. #### Declaration ```csharp public static readonly DependencyProperty BalanceProperty ``` #### Field Value | Type | Description | | --- | --- | | DependencyProperty | The dependency property. | ### ClosedCaptionsChannelProperty #### Description The DependencyProperty for the MediaElement.ClosedCaptionsChannel property. #### Declaration ```csharp public static readonly DependencyProperty ClosedCaptionsChannelProperty ``` #### Field Value | Type | Description | | --- | --- | | DependencyProperty | The dependency property. | ### IgnorePixelAspectRatioProperty #### Description DependencyProperty for StretchDirection property. #### Declaration ```csharp public static readonly DependencyProperty IgnorePixelAspectRatioProperty ``` #### Field Value | Type | Description | | --- | --- | | DependencyProperty | The dependency property. | ### IsDesignPreviewEnabledProperty #### Description The DependencyProperty for the MediaElement.IsDesignPreviewEnabled property. #### Declaration ```csharp public static readonly DependencyProperty IsDesignPreviewEnabledProperty ``` #### Field Value | Type | Description | | --- | --- | | DependencyProperty | The dependency property. | ### IsMutedProperty #### Description The DependencyProperty for the MediaElement.IsMuted property. #### Declaration ```csharp public static readonly DependencyProperty IsMutedProperty ``` #### Field Value | Type | Description | | --- | --- | | DependencyProperty | The dependency property. | ### LoadedBehaviorProperty #### Description The DependencyProperty for the MediaElement.LoadedBehavior property. #### Declaration ```csharp public static readonly DependencyProperty LoadedBehaviorProperty ``` #### Field Value | Type | Description | | --- | --- | | DependencyProperty | The dependency property. | ### LoopingBehaviorProperty #### Description The DependencyProperty for the MediaElement.LoopingBehavior property. #### Declaration ```csharp public static readonly DependencyProperty LoopingBehaviorProperty ``` #### Field Value | Type | Description | | --- | --- | | DependencyProperty | The dependency property. | ### PositionProperty #### Description The DependencyProperty for the MediaElement.Position property. #### Declaration ```csharp public static readonly DependencyProperty PositionProperty ``` #### Field Value | Type | Description | | --- | --- | | DependencyProperty | The dependency property. | ### ScrubbingEnabledProperty #### Description The DependencyProperty for the MediaElement.ScrubbingEnabled property. #### Declaration ```csharp public static readonly DependencyProperty ScrubbingEnabledProperty ``` #### Field Value | Type | Description | | --- | --- | | DependencyProperty | The dependency property. | ### SpeedRatioProperty #### Description The DependencyProperty for the MediaElement.SpeedRatio property. #### Declaration ```csharp public static readonly DependencyProperty SpeedRatioProperty ``` #### Field Value | Type | Description | | --- | --- | | DependencyProperty | The dependency property. | ### StretchDirectionProperty #### Description DependencyProperty for StretchDirection property. #### Declaration ```csharp public static readonly DependencyProperty StretchDirectionProperty ``` #### Field Value | Type | Description | | --- | --- | | DependencyProperty | The dependency property. | ### StretchProperty #### Description DependencyProperty for Stretch property. #### Declaration ```csharp public static readonly DependencyProperty StretchProperty ``` #### Field Value | Type | Description | | --- | --- | | DependencyProperty | The dependency property. | ### UnloadedBehaviorProperty #### Description The DependencyProperty for the MediaElement.UnloadedBehavior property. #### Declaration ```csharp public static readonly DependencyProperty UnloadedBehaviorProperty ``` #### Field Value | Type | Description | | --- | --- | | DependencyProperty | The dependency property. | ### VerticalSyncEnabledProperty #### Description The DependencyProperty for the MediaElement.VerticalSyncEnabled property. #### Declaration ```csharp public static readonly DependencyProperty VerticalSyncEnabledProperty ``` #### Field Value | Type | Description | | --- | --- | | DependencyProperty | The dependency property. | ### VolumeProperty #### Description The DependencyProperty for the MediaElement.Volume property. #### Declaration ```csharp public static readonly DependencyProperty VolumeProperty ``` #### Field Value | Type | Description | | --- | --- | | DependencyProperty | The dependency property. | ``` -------------------------------- ### SetFontSize(MediaElement, Double) Source: https://unosquare.github.io/ffmediaelement/api/Unosquare.FFME.Subtitles.html Sets the font size on the specified MediaElement. ```APIDOC ## SetFontSize(MediaElement, Double) ### Description Sets the size of the font. ### Method SetFontSize ### Parameters - **element** (MediaElement) - The object. - **value** (Double) - The value. ``` -------------------------------- ### Dispose() Source: https://unosquare.github.io/ffmediaelement/api/Unosquare.FFME.MediaElement.html Releases resources used by the MediaElement instance. ```APIDOC ## Dispose() ### Description Releases resources used by the MediaElement instance. ### Declaration public void Dispose() ``` -------------------------------- ### LegacyAudioException Properties Source: https://unosquare.github.io/ffmediaelement/api/Unosquare.FFME.Common.LegacyAudioException.html Properties of the LegacyAudioException class that provide information about the failed function and the Windows API result code. ```APIDOC ## FunctionName ### Description Gets the name of the function that failed. ### Declaration public string FunctionName { get; } ### Property Value - **Type**: String ## Result ### Description Gets the Windows API result code. ### Declaration public LegacyAudioResult Result { get; } ### Property Value - **Type**: LegacyAudioResult ``` -------------------------------- ### RendererOptions Class Source: https://unosquare.github.io/ffmediaelement/api/Unosquare.FFME.Common.RendererOptions.html Configuration options for media renderers, including audio output device selection, video image type, and frame rate limits. ```APIDOC ## RendererOptions Class ### Description Provides access to various internal media renderer options. ### Namespace Unosquare.FFME.Common ### Syntax ```csharp public sealed class RendererOptions ``` ### Properties #### AudioDisableSync By default, the audio renderer will skip or wait for samples to synchronize to video. ```csharp public bool AudioDisableSync { get; set; } ``` **Property Value** - **Type**: Boolean #### DirectSoundDevice Gets or sets the DirectSound device identifier. It is the default playback device by default. Only valid if UseLegacyAudioOut is set to false which is the default. ```csharp public DirectSoundDeviceInfo DirectSoundDevice { get; set; } ``` **Property Value** - **Type**: DirectSoundDeviceInfo #### LegacyAudioDevice Gets or sets the wave device identifier. -1 is the default playback device. Only valid if UseLegacyAudioOut is set to true. ```csharp public LegacyAudioDeviceInfo LegacyAudioDevice { get; set; } ``` **Property Value** - **Type**: LegacyAudioDeviceInfo #### UseLegacyAudioOut Gets or sets a value indicating whether the legacy MME (WinMM) should be used as an audio output device as opposed to DirectSound. This defaults to false. ```csharp public bool UseLegacyAudioOut { get; set; } ``` **Property Value** - **Type**: Boolean #### VideoImageType Gets or sets which image type is used for the video renderer. Use WriteableBitmap for tear-free scenarios, or use the InteropBitmap for faster, lower CPU usage. InteropBitmap might introduce some tearing. ```csharp public VideoRendererImageType VideoImageType { get; set; } ``` **Property Value** - **Type**: VideoRendererImageType #### VideoRefreshRateLimit Gets or sets the frame refresh rate limit for the video renderer. Defaults to 0 and means no limit. Units are in frames per second. ```csharp public int VideoRefreshRateLimit { get; set; } ``` **Property Value** - **Type**: Int32 ``` -------------------------------- ### LegacyAudioException.GetObjectData Method Source: https://unosquare.github.io/ffmediaelement/api/Unosquare.FFME.Common.LegacyAudioException.html Overrides the GetObjectData method to provide serialization support for the exception. ```APIDOC ## GetObjectData(SerializationInfo, StreamingContext) ### Description Overrides the GetObjectData method to populate serialization information with the data needed to serialize the exception. ### Declaration [SecurityPermission(SecurityAction.Demand, SerializationFormatter = true)] public override void GetObjectData(SerializationInfo info, StreamingContext context) ### Parameters - **info** (SerializationInfo) - The SerializationInfo to populate with data. - **context** (StreamingContext) - The destination for this serialization. ``` -------------------------------- ### AudioDeviceStopped Event Source: https://unosquare.github.io/ffmediaelement/api/Unosquare.FFME.MediaElement.html Occurs when the currently selected audio device stops or loses its buffer. ```APIDOC ## AudioDeviceStopped Event ### Description Occurs when the currently selected audio device stops or loses its buffer. Call the method and select a new audio device in order to output to a new audio device. ### Declaration public event EventHandler AudioDeviceStopped ### Event Type - EventHandler ``` -------------------------------- ### SetFontWeight(MediaElement, FontWeight) Source: https://unosquare.github.io/ffmediaelement/api/Unosquare.FFME.Subtitles.html Sets the font weight on the specified MediaElement. ```APIDOC ## SetFontWeight(MediaElement, FontWeight) ### Description Sets the font weight. ### Method SetFontWeight ### Parameters - **element** (MediaElement) - The object. - **value** (FontWeight) - The value. ``` -------------------------------- ### SetEffect(MediaElement, Effect) Source: https://unosquare.github.io/ffmediaelement/api/Unosquare.FFME.Subtitles.html Sets the effect on the specified MediaElement. ```APIDOC ## SetEffect(MediaElement, Effect) ### Description Sets the effect. ### Method SetEffect ### Parameters - **element** (MediaElement) - The object. - **value** (Effect) - The value. ``` -------------------------------- ### BitmapDataBuffer.CreateDrawingBitmap() Source: https://unosquare.github.io/ffmediaelement/api/Unosquare.FFME.Common.BitmapDataBuffer.html Creates a Drawing Bitmap from this data buffer. This method is used to convert the raw bitmap data into a usable Bitmap object. ```APIDOC ## CreateDrawingBitmap() ### Description Creates a Drawing Bitmap from this data buffer. ### Method CreateDrawingBitmap ### Syntax public Bitmap CreateDrawingBitmap() ### Returns - **Bitmap** - The bitmap. ``` -------------------------------- ### RenderingVideoEventArgs Properties Source: https://unosquare.github.io/ffmediaelement/api/Unosquare.FFME.Common.RenderingVideoEventArgs.html The RenderingVideoEventArgs class exposes properties that provide access to the rendered video frame data. These can be captured or modified during rendering. ```APIDOC ## Class RenderingVideoEventArgs ### Description Represents the video rendering event arguments. The video rendering event arguments. ### Namespace Unosquare.FFME.Common ### Inheritance Object -> EventArgs -> RenderingEventArgs -> RenderingVideoEventArgs ### Syntax ```csharp public sealed class RenderingVideoEventArgs : RenderingEventArgs ``` ### Properties #### Bitmap Gets the writable bitmap filled with the video frame pixels. Feel free to capture or change this buffer. ```csharp public BitmapDataBuffer Bitmap { get; } ``` ##### Property Value - **BitmapDataBuffer** - The bitmap data buffer containing the video frame pixels. #### ClosedCaptions Gets the closed caption decoded packets. ```csharp public IReadOnlyList ClosedCaptions { get; } ``` ##### Property Value - **IReadOnlyList** - The list of closed caption packets. #### PictureNumber Gets the display picture number (frame number). If not set by the decoder, this attempts to obtain it by dividing the start time by the frame duration. ```csharp public long PictureNumber { get; } ``` ##### Property Value - **Int64** - The display picture number. #### PictureType Gets the picture type. ```csharp public AVPictureType PictureType { get; } ``` ##### Property Value - **AVPictureType** - The picture type. #### SmtpeTimeCode Gets the SMTPE time code. ```csharp public string SmtpeTimeCode { get; } ``` ##### Property Value - **String** - The SMTPE time code. ### See Also - EventArgs ``` -------------------------------- ### SetFontFamily(MediaElement, FontFamily) Source: https://unosquare.github.io/ffmediaelement/api/Unosquare.FFME.Subtitles.html Sets the font family on the specified MediaElement. ```APIDOC ## SetFontFamily(MediaElement, FontFamily) ### Description Sets the font family. ### Method SetFontFamily ### Parameters - **element** (MediaElement) - The object. - **value** (FontFamily) - The value. ``` -------------------------------- ### BitmapDataBuffer Properties Source: https://unosquare.github.io/ffmediaelement/api/Unosquare.FFME.Common.BitmapDataBuffer.html Properties of the BitmapDataBuffer class that provide metadata about the raw bitmap back-buffer. ```APIDOC ## Properties ### BitsPerPixel Gets the bits per pixel. - **Type**: Int32 ### BufferLength Gets the length of the buffer (Stride x Pixel Height). - **Type**: UInt32 ### BytesPerPixel Gets the bytes per pixel. - **Type**: Int32 ### DpiX Gets the DPI on the X axis. - **Type**: Double ### DpiY Gets the DPI on the Y axis. - **Type**: Double ### Palette Gets the palette. - **Type**: BitmapPalette ### PixelFormat Gets the pixel format. - **Type**: PixelFormat ### PixelHeight Gets height of the bitmap. - **Type**: Int32 ### PixelWidth Gets width of the bitmap. - **Type**: Int32 ### Scan0 Gets a pointer to the raw pixel data. - **Type**: IntPtr ### Stride Gets the byte width of each row of pixels. - **Type**: Int32 ### UpdateRect Gets the update rect. - **Type**: Int32Rect ``` -------------------------------- ### RenderingEventArgs Properties Source: https://unosquare.github.io/ffmediaelement/api/Unosquare.FFME.Common.RenderingEventArgs.html Properties of the RenderingEventArgs class providing access to rendering event data. ```APIDOC ## Properties ### Clock Gets the clock position at which the media was called for rendering. **Declaration** ```csharp public TimeSpan Clock { get; } ``` **Property Value** - **TimeSpan** - The clock position. ### Duration Gets how long this media has to be presented. **Declaration** ```csharp public TimeSpan Duration { get; } ``` **Property Value** - **TimeSpan** - The duration. ### EngineState Provides access to the underlying media engine state. **Declaration** ```csharp public IMediaEngineState EngineState { get; } ``` **Property Value** - **IMediaEngineState** - The media engine state. ### PresentationTime Gets the unadjusted, original presentation timestamp (PTS) of the frame in units. May return when invalid, not applicable (as in continuous audio rendering), or unavailable. **Declaration** ```csharp public long PresentationTime { get; } ``` **Property Value** - **Int64** - The presentation timestamp. ### StartTime Gets the starting time at which this media has to be presented. **Declaration** ```csharp public TimeSpan StartTime { get; } ``` **Property Value** - **TimeSpan** - The start time. ### Stream Provides Stream Information coming from the media container. **Declaration** ```csharp public StreamInfo Stream { get; } ``` **Property Value** - **StreamInfo** - The stream information. ``` -------------------------------- ### Add FFME MediaElement to XAML Source: https://unosquare.github.io/ffmediaelement/index.html Define the FFME MediaElement control within your WPF window's XAML. ```xml xmlns:ffme="clr-namespace:Unosquare.FFME;assembly=ffme.win" ``` -------------------------------- ### LegacyAudioResult Enum Source: https://unosquare.github.io/ffmediaelement/api/Unosquare.FFME.Common.LegacyAudioResult.html The LegacyAudioResult enum defines constants for Windows multimedia error codes. It is used to represent audio-related error conditions in the FFME library. ```APIDOC ## LegacyAudioResult Enum ### Description Defines Windows multimedia error codes from mmsystem.h. ### Namespace Unosquare.FFME.Common ### Syntax public enum LegacyAudioResult ### Fields - **AcmBusy** - Busy - **AcmCancelled** - Cancelled - **AcmHeaderUnprepared** - Header Unprepared - **AcmNotPossible** - Conversion not possible - **AlreadyAllocated** - device already allocated - **BadDeviceId** - device ID out of range - **BadErrorNumber** - error value out of range - **BadRegistryDatabase** - bad registry database - **HandleBusy** - handle being used simultaneously on another thread (eg callback) - **InvalidAlias** - specified alias not found - **InvalidFlag** - invalid flag passed - **InvalidHandle** - device handle is invalid - **InvalidParameter** - invalid parameter passed - **MemoryAllocationError** - memory allocation error - **MixerInvalidControl** - invalid control - **MixerInvalidLine** - invalid line - **MixerInvalidValue** - invalid value - **MoreData** - more data to be returned - **NoDriver** - no device driver present - **NoDriverCallback** - driver does not call DriverCallback - **NoError** - no error - **NotEnabled** - driver failed enable - **NotSupported** - function isn't supported - **RegistryDeleteError** - registry delete error - **RegistryKeyNotFound** - registry key not found - **RegistryReadError** - registry read error - **RegistryValueNotFound** - registry value not found - **RegistryWriteError** - registry write error - **UnspecifiedError** - unspecified error - **WaveBadFormat** - unsupported wave format - **WaveHeaderUnprepared** - header not prepared - **WaveStillPlaying** - still something playing - **WaveSync** - device is synchronous ``` -------------------------------- ### FFmpegMessageLogged Event Source: https://unosquare.github.io/ffmediaelement/api/Unosquare.FFME.MediaElement.html Occurs when a logging message from the FFmpeg library has been received. This is shared across all instances of Media Elements. ```APIDOC ## FFmpegMessageLogged Event ### Description Occurs when a logging message from the FFmpeg library has been received. This is shared across all instances of Media Elements. ### Declaration public static event EventHandler FFmpegMessageLogged ### Event Type - EventHandler ### Remarks This event is raised on a background thread. All interaction with UI elements requires calls on their corresponding dispatcher. ``` -------------------------------- ### VideoRendererImageType Enum Source: https://unosquare.github.io/ffmediaelement/api/Unosquare.FFME.Common.VideoRendererImageType.html Enumerates the different video renderer image types. The enum includes InteropBitmap and WriteableBitmap fields. ```APIDOC ## VideoRendererImageType Enum ### Description Enumerates the different video renderer image types. ### Namespace Unosquare.FFME.Common ### Syntax public enum VideoRendererImageType ### Fields - **InteropBitmap** - Use as the faster, non tear-free InteropBitmap. - **WriteableBitmap** - Uses a tear-free WriteableBitmap. ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.