Windows media player cmd

Command Line Parameters

Command Line Parameters for Wmplayer

Windows Media Player supports a set of command line parameters that specify how the Player behaves when it starts. The following table details the parameters and their behaviors.

Syntax Behavior
«path\filename«(For example: wmplayer «c:\filename.wma» ) Start the Player and play the file.
«path\filename» /fullscreen(For example: wmplayer «c:\filename.wmv» /fullscreen ) Play the specified file in full-screen mode.You must specify the path and file name of the content to play.
/Device:(For example: wmplayer /device:audio CD ) Play a DVD or audio CD.
«path\filename?WMPSkin=skin name«For example: wmplayer «c:\filename.wma?wmpskin=headspace» Open the Player, applying the specified skin.
/Service:keyname Open the Player showing the online store specified by keyname.Requires Windows Media Player 10 or later.
/Task NowPlaying Open the Player in the Now Playing feature.
/Task MediaGuide Open the Player in the Media Guide feature (current active online store in Windows Media Player 10 or later).
/Task CDAudio Open the Player in the Copy from CD feature (Rip feature in Windows Media Player 10 or Windows Media Player 11). This parameter is not supported in Windows Media Player 12.
/Task CDWrite Open the Player in the Burn feature.Requires Windows Media Player 10.
/Task MediaLibrary Open the Player in the Library feature.
/Task RadioTuner Open the Player in the Radio Tuner feature (current active online store in Windows Media Player 10 or later).
/Task PortableDevice Open the Player in the Copy to CD or Device feature (Sync feature in Windows Media Player 10 or later).
/Task Services /Service servicename Open the Player in the Premium Services feature, showing the service specified by the servicename parameter. This value is the unique name for the service. If the specified service has not been previously viewed, the servicename parameter is ignored. (Opens the specified online store in Windows Media Player 10 or later.)
/Task ServiceTaskX Open the Player in the online store service task pane specified by X. For example, /Task ServiceTask1 opens the Player in the first online store service task pane.
/Task SkinViewer Open the Player in the Skin Chooser feature.
/Playlist PlaylistName Open the Player and play the specified playlist.
/Schema:For example: wmplayer /Schema:Pictures /Task:PortableDevice Open the Player, showing the specified media category. Requires Windows Media Player 11.

Command Line Parameters for Wmpconfig

Wmpconfig.exe is used to execute certain commands in Windows Media Player that require administrator permission. Examples include the starting and stopping of browsing and sharing services and the enabling of exceptions in the Windows Firewall. The following table describes the possible values for the command line parameters.

Syntax Behavior
DisableHMEDevice MAC Disables the device specified by a Media Access Control (MAC) identifier.
HMEOff Example:
wmpconfig HMEOff
Disables the Windows Media Player Network Sharing Service.
HMEOn Example:
wmpconfig HMEOn
Enables sharing, browsing, and the firewall exception.
RemoveHMEDevice MAC Removes the device specified by a MAC identifier.
RestoreHMEDevice MAC Restores the device specified by a MAC identifier.
SetDVDParentalLevel levelExample:
wmpconfig SetDVDParentalLevel 3
Sets the DVD parental control level. The level is specified as an integer.

Command Line Parameters for Wmpnscfg

Microsoft Windows uses wmpnscfg.exe to alert users when media rendering devices are found on the network. Wmpnscfg starts the Windows Media Player Network Sharing Service (NSS) and then waits for notifications from the service. When wmpnscfg is notified that a new media device is available on the network, it displays a popup in the system tray that informs the user about the availability of the new device. If the user clicks the popup, wmpnscfg launches Windows Media Player, which displays a dialog box that asks the user to either allow or deny sharing with the new device.

Typically, Windows calls wmpnscfg with no command line parameters. However, there is one parameter available, described in the following table.

Источник

Embedding the Windows Media Player Control in a C# Solution

To use the functionality of Windows Media Player in a C# application, first add the component to a form as described in Using the Windows Media Player Control with Microsoft Visual Studio

The following sections describe how to create an application that plays video and uses custom play and stop buttons.

Add the Video Window

Add the Windows Media Player ActiveX control to a form. Resize the control, and then place it where you want the video window to appear.

Select the Windows Media Player control, then change the uiMode property to «none». This setting hides the UI controls. When the user plays a video, it will appear in the window. For audio-only content, a visualization will appear.

Add Two Buttons and Adjust the Form

Now, add two buttons to the form. Select the first button and change the Text property to «Play». Select the second button and change its Text property to «Stop».

Add the Play Code

Double-click the Play button to reveal the Code window. In C#, the following code will be displayed:

Add this line between the two curly braces:

In the preceding code example, «axWindowsMediaPlayer1» is the default name of the Windows Media Player control, and «c:\mediafile.wmv» is a placeholder for the name of the media item you want to play. Any valid file path can be used. The @ symbol instructs the compiler to not interpret backslashes as escape characters.

If you have added the digital media content from the Windows Media Player SDK to the library in Windows Media Player, you can use this code instead:

Because the autoStart property is true by default, Windows Media Player will start playing when you set the currentPlaylist or URL property.

Add the Stop Code

Double-click the Stop button to reveal the Code window. In C#, the following code will be displayed:

Add this line between the two curly braces:

The managed-code wrapper for the Windows Media Player control exposes the Controls object as Ctlcontrols to avoid collision with the Controls property inherited from System.Windows.Forms.Control.

Add Error-handling

The Windows Media Player control does not raise an exception when it encounters an error such as an invalid URL. Instead, it signals an event. Your application should handle error events sent by the Player.

To create an event handler, first open the Properties window for the Windows Media Player control. In the list of events, double-click MediaError. The following code is displayed:

The following code could be inserted in the method to provide minimal error-handling capability. Note that information about the error can be retrieved from the _WMPOCXEvents_MediaErrorEvent argument.

Источник

Проигрыватель Windows не работает.

Если он работает, конечно. И для начала нам стоит ещё раз убедиться в его работоспособности. Так, если Проигрыватель Windows не работает именно с ярлыка на Рабочем столе, его можно попробовать запустить напрямую из папки. В которой тот хранится с незапамятных времён:

C:\Program Files\Windows Media Player

Откроем строку Выполнить клавишами WIN + R и введёт путь запуска:

Проигрыватель Windows не работает: встроенные средства диагностики.

В составе инструментов самодиагностики Windows есть набор и для проигрывателя. И за GUI интерфейсом средства диагностики скрывается мощный набор скриптов для перезапуска специальных служб, проверки реестра и целостности соответствующих файлов. Вобщем, стоит попробовать.

Для начала запускаем консоль cmd от имени администратора и вводим команду:

Появится окно диагноста:

По нажатию на кнопку Далее система сама попытается вычленить ошибку и исправить её. Это – одно из трёх средств диагностики неисправностей с проигрывателем, так что возьмите на заметку ещё две похожие команды:

Проигрыватель Windows не работает: окно не открывается

У этой проблемы много симптомов: окно проигрывателя не открывается вообще, диски или файлы конкретных форматов не проигрываются. То есть щёлкаем по ярлыку файла – и ничего не происходит. Вращающийся курсор синего цвета возвещает лишь о том, что что-то не так. Следующие шаги должны помочь:

После ввода перезагружаемся.

Для повторной установки снова установите флажок для проигрывателя.

Проигрыватель Windows не работает: прогоняем утилитой.

Этот этап на самом деле повторяет всё то, что мы проделывали выше (кроме переустановки), только фоном и без демонстрации процесса. Представляю вам Fix WMP Utility : программа автоматического поиска и исправления ошибок проигрывателя Windows. Утилитку нашёл на этом сайте, основной упор она делает именно на перерегистрацию файлов динамических библиотек проигрывателя:

Программку найдёте в zip-ованном архиве. Вам останется только нажать по кнопке Run Utility и отписаться по результатам.

Источник

How to play a sound file from a Windows batch file

If you’re running a batch file on your computer, it can be useful to play audio on your computer speakers, as a notification or alarm. You can use the start command in your batch file to launch an audio application and play the sound, audio recording, or music that you’d like to hear.

Examples

If you would like to the player to open and play «music.mp3» in the command line or batch file, you could type the following command.

If the sound file has a space in the file name, surround the file name in quotes as shown in the following example.

Using the start command opens the file in the default audio player, which means by default, audio files open in Windows Media Player. However, if the computer has a different audio program that re-associated the audio files, the other program is used instead. If you want Windows Media Player to play the audio file regardless of what other audio players are installed, continue to the next section.

Alternative solution

The Windows Media Player can run from the command line, or in a batch file, to play sound files. In Windows 10, the Media Player executable file is located at Program Files (x86)\Windows Media Player\wmplayer.exe. In previous versions of Windows, the Media Player executable was named mplay32.exe or mplayer.exe. Windows 95 and 98 users should use mplayer. Windows XP and 2000 users should use mplay32 (as shown in the following examples), and Windows Vista and Windows 7 users should use wmplayer.

Windows Vista, Windows 7, and Windows 8 wmplayer examples

The following command cause Windows Media Player to open and play the audio file example.mp3.

As in this example, always specify the complete path to the audio file, including the drive letter. If the directory or audio file name has a space in it, make sure to enclose the entire path and file name in double quotes, for example:

Where is the wmplayer /close option?

Unfortunately, Microsoft has not included a /close option for wmplayer. If you need a close option to run a series of different files, you may consider using the «/Playlist PlaylistName» switch to have Windows Media Player play a playlist. Alternatively, you can use another media player program, such as MPC-HC, which does have a /close option.

Windows XP and 2000 mplay32 examples

As shown in the following example, we are using mplay32 as the program to play the file. The /play and /close switches tell the program to play the file and then close when done. Finally, the remainder of the line is the full path to where the audio file is stored. In this example, we are playing the Windows chimes file.

If the file or directory has a space in it, make sure to include the full path in quotes, as shown.

Playing sound with a custom audio program

To play an audio file in a different media player, set the path to the directory where the alternative media player is located. Otherwise, you get an error message indicating that the command is not recognized.

For example, if you want to play an MP3 file in the VLC media player, you could move to the C:\Program Files\VideoLan\VLC directory or add the directory to your path. From this directory, type the following command to execute and start playing the MP3 file in VLC. Keep in mind that the mplay32 options mentioned above (/play and /close) do not work for every media player, including VLC.

Источник

Media Player Класс

Определение

Предоставляет воспроизведение мультимедиа для рисунков. Provides media playback for drawings.

Примеры

Комментарии

MediaPlayer можно использовать в двух разных режимах, в зависимости от того, что влияет на проигрыватель: независимого режима или часового режима. MediaPlayer can be used in two different modes, depending on what is driving the player: independent mode or clock mode. В независимом режиме платформа MediaPlayer является аналогом изображения и носителя, открытого с помощью метода, который используется для Open воспроизведения. In independent mode, the MediaPlayer is analogous to an image and the media opened through the Open method drives playback. В режиме часов объект MediaPlayer можно рассматривать как цель для анимации, и поэтому он будет иметь соответствующие Timeline Clock записи и в дереве времени, которое управляет воспроизведением. In Clock mode, the MediaPlayer can be thought of as a target for an animation, and thus it will have corresponding Timeline and Clock entries in the Timing tree which controls playback. Дополнительные сведения о режимах мультимедиа см. в обзоре мультимедиа. For more information on media modes, see the Multimedia Overview.

Конструкторы

Инициализирует новый экземпляр класса MediaPlayer. Initializes a new instance of the MediaPlayer class.

Свойства

Получает или задает баланс громкости между левыми и правыми динамиками. Gets or sets the balance between the left and right speaker volumes.

Получает процент буферизации потокового содержимого. Gets the percentage of buffering completed for streaming content.

Возвращает значение, которое указывает, можно ли сделать объект неизменяемым. Gets a value that indicates whether the object can be made unmodifiable.

Возвращает значение, показывающее, можно ли приостановить воспроизведение файла мультимедиа. Gets a value indicating whether the media can be paused.

Получает или задает объект MediaClock, связанный с подлежащим воспроизведению MediaTimeline. Gets or sets the MediaClock associated with the MediaTimeline to be played.

Возвращает объект Dispatcher, с которым связан этот объект DispatcherObject. Gets the Dispatcher this DispatcherObject is associated with.

Получает процентное значение, показывающее процент загрузки содержимого, расположенного на удаленном сервере. Gets the percentage of download progress for content located at a remote server.

Возвращает значение, которое указывает, сопоставлены ли один или несколько объектов AnimationClock любому из свойств зависимостей этого объекта. Gets a value that indicates whether one or more AnimationClock objects is associated with any of this object’s dependency properties.

Получает значение, указывающее, содержит ли мультимедиа звуковые выходные данные. Gets a value that indicating whether the media has audio output.

Получает значение, указывающее, содержит ли мультимедиа выходные видеоданные. Gets a value that indicates whether the media has video output.

Получает значение, указывающее, выполняется ли буферизация мультимедиа. Gets a value that indicates whether the media is buffering.

Получает значение, указывающее, доступен ли объект для изменения в настоящее время. Gets a value that indicates whether the object is currently modifiable.

Получает значение, указывающее, отключен ли звук мультимедиа. Gets a value that indicates whether the media is muted.

Получает значение, указывающее, является ли этот экземпляр в данный момент запечатанным (доступным только для чтения). Gets a value that indicates whether this instance is currently sealed (read-only).

Получает естественную продолжительность мультимедиа. Gets the natural duration of the media.

Получает высоту видео в пикселях. Gets the pixel height of the video.

Получает ширину видео в пикселях. Gets the pixel width of the video.

Получает или задает текущую позицию мультимедиа. Gets or sets the current position of the media.

Получает или задает значение, указывающее, включена ли очистка. Gets or sets a value that indicates whether scrubbing is enabled.

Получает Uri мультимедиа. Gets the media Uri.

Получает или задает коэффициент скорости воспроизведения мультимедиа. Gets or sets the ratio of speed that media is played at.

Получает или задает громкость мультимедиа. Gets or sets the media’s volume.

Методы

Применяет AnimationClock к заданному DependencyProperty. Applies an AnimationClock to the specified DependencyProperty. Если свойство уже анимировано, используется эстафетное поведение SnapshotAndReplace. If the property is already animated, the SnapshotAndReplace handoff behavior is used.

Применяет AnimationClock к заданному DependencyProperty. Applies an AnimationClock to the specified DependencyProperty. Если свойство уже является анимированным, используется указанное поведение HandoffBehavior. If the property is already animated, the specified HandoffBehavior is used.

Применяет анимацию к указанному DependencyProperty. Applies an animation to the specified DependencyProperty. Анимация начинается при отрисовке следующего кадра. The animation is started when the next frame is rendered. Если указанное свойство уже анимировано, используется поведение перемещения SnapshotAndReplace. If the specified property is already animated, the SnapshotAndReplace handoff behavior is used.

Применяет анимацию к указанному DependencyProperty. Applies an animation to the specified DependencyProperty. Анимация начинается при отрисовке следующего кадра. The animation is started when the next frame is rendered. Если указанное свойство уже является анимированным, используется указанное поведение HandoffBehavior. If the specified property is already animated, the specified HandoffBehavior is used.

Определяет, имеет ли вызывающий поток доступ к этому DispatcherObject. Determines whether the calling thread has access to this DispatcherObject.

Очищает локальное значение свойства. Clears the local value of a property. Очищаемое свойство задается идентификатором DependencyProperty. The property to be cleared is specified by a DependencyProperty identifier.

Очищает локальное значение доступного только для чтения свойства. Clears the local value of a read-only property. Очищаемое свойство задается ключом DependencyPropertyKey. The property to be cleared is specified by a DependencyPropertyKey.

Создает изменяемый клон данного объекта Animatable, делая глубокие копии значений этого объекта. Creates a modifiable clone of this Animatable, making deep copies of this object’s values. При копировании свойств зависимостей объекта этот метод копирует указатели на ресурсы и связи с данными (которые могут уже не быть разрешимыми), но не копирует анимации и их текущие значения. When copying this object’s dependency properties, this method copies resource references and data bindings (but they might no longer resolve) but not animations or their current values.

Делает этот экземпляр глубокой копией указанного объекта MediaPlayer. Makes this instance a deep copy of the specified MediaPlayer. При копировании свойств зависимостей этот метод копирует ссылки на ресурсы и привязки данных (которые могут уже не быть разрешимыми), но не копирует анимации и их текущие значения. When copying dependency properties, this method copies resource references and data bindings (but they might no longer resolve) but not animations or their current values.

Создает редактируемую копию (глубокую копию) объекта Freezable с использованием его текущих значений. Creates a modifiable clone (deep copy) of the Freezable using its current values.

Делает этот экземпляр изменяемой глубокой копией указанной коллекции MediaPlayer с использованием текущих значений свойств. Makes this instance a modifiable deep copy of the specified MediaPlayer using current property values. Ссылки на ресурсы, привязки данных и анимации не копируются, но копируются их текущие значения. Resource references, data bindings, and animations are not copied, but their current values are.

Закрывает мультимедиа. Closes the underlying media.

Приводит значение указанного свойства зависимостей. Coerces the value of the specified dependency property. Это осуществляется путем вызова какой-либо функции CoerceValueCallback, указанной в метаданных свойства зависимостей, которое существует в вызывающем объекте DependencyObject. This is accomplished by invoking any CoerceValueCallback function specified in property metadata for the dependency property as it exists on the calling DependencyObject.

Инициализирует новый экземпляр класса Freezable. Initializes a new instance of the Freezable class.

Создает новый экземпляр MediaPlayer. Creates a new MediaPlayer instance.

Определяет, является ли указанный DependencyObject эквивалентом текущего DependencyObject. Determines whether a provided DependencyObject is equivalent to the current DependencyObject.

Делает данный объект Animatable неизменяемым или определяет, может ли он быть сделан неизменяемым. Makes this Animatable object unmodifiable or determines whether it can be made unmodifiable.

Возвращает не анимированное значение указанного объекта DependencyProperty. Returns the non-animated value of the specified DependencyProperty.

Создает фиксированную копию объекта Freezable, используя базовые (не анимационные) значения свойств. Creates a frozen copy of the Freezable, using base (non-animated) property values. Так как копия является фиксированной, копируются только ссылки на фиксированные вложенные объекты. Because the copy is frozen, any frozen sub-objects are copied by reference.

Делает этот экземпляр клоном указанного объекта MediaPlayer. Makes this instance a clone of the specified MediaPlayer object.

Создает фиксированную копию объекта Freezable с использованием текущих значений свойств. Creates a frozen copy of the Freezable using current property values. Так как копия является фиксированной, копируются только ссылки на фиксированные вложенные объекты. Because the copy is frozen, any frozen sub-objects are copied by reference.

Создает текущий экземпляр замороженной копии указанного объекта Freezable. Makes the current instance a frozen clone of the specified Freezable. Если объект имеет анимированные свойства зависимостей, копируются их текущие анимированные значения. If the object has animated dependency properties, their current animated values are copied.

Возвращает хэш-код для данного объекта DependencyObject. Gets a hash code for this DependencyObject.

Создает специализированный перечислитель для определения свойств зависимостей, которые локально установили значения для данного DependencyObject. Creates a specialized enumerator for determining which dependency properties have locally set values on this DependencyObject.

Возвращает объект Type для текущего экземпляра. Gets the Type of the current instance.

Возвращает текущее действующее значение свойства зависимостей в этом экземпляре DependencyObject. Returns the current effective value of a dependency property on this instance of a DependencyObject.

Повторно вычисляет действующее значение для указанного свойства зависимостей. Re-evaluates the effective value for the specified dependency property.

Создает неполную копию текущего объекта Object. Creates a shallow copy of the current Object.

Вызывается при изменении текущего объекта Freezable. Called when the current Freezable object is modified.

Обеспечивает создание соответствующих указателей контекста для элемента данных типа DependencyObjectType, который был только что задан. Ensures that appropriate context pointers are established for a DependencyObjectType data member that has just been set.

Этот элемент поддерживает инфраструктуру Windows Presentation Foundation (WPF) и не предназначен для непосредственного использования из кода. This member supports the Windows Presentation Foundation (WPF) infrastructure and is not intended to be used directly from your code.

Переопределяет реализацию DependencyObject для OnPropertyChanged(DependencyPropertyChangedEventArgs), чтобы также вызвать любой обработчик Changed в ответ на изменение свойства зависимостей типа Freezable. Overrides the DependencyObject implementation of OnPropertyChanged(DependencyPropertyChangedEventArgs) to also invoke any Changed handlers in response to a changing dependency property of type Freezable.

Открывает заданныйUri для воспроизведения мультимедиа. Opens the given Uri for media playback.

Приостанавливает воспроизведения мультимедиа. Pauses media playback.

Воспроизводит мультимедиа с текущего Position. Plays media from the current Position.

Возвращает локальное значение свойства зависимостей, если таковое существует. Returns the local value of a dependency property, if it exists.

Гарантирует, что доступ к MediaPlayer осуществляется из допустимого потока. Ensures that the MediaPlayer is being accessed from a valid thread.

Задает значение свойства зависимостей, не меняя источник значения. Sets the value of a dependency property without changing its value source.

Задает локальное значение свойства зависимостей, указанного идентификатором этого свойства. Sets the local value of a dependency property, specified by its dependency property identifier.

Задает локальное значение свойства зависимости только для чтения, определяемое идентификатором DependencyPropertyKey свойства зависимостей. Sets the local value of a read-only dependency property, specified by the DependencyPropertyKey identifier of the dependency property.

Возвращает значение, которое указывает, следует ли процессам сериализации выполнять сериализацию значения для предоставленного свойства зависимостей. Returns a value that indicates whether serialization processes should serialize the value for the provided dependency property.

Останавливает воспроизведения мультимедиа. Stops media playback.

Возвращает строку, представляющую текущий объект. Returns a string that represents the current object.

Обеспечивает наличие у вызывающего потока доступ к этому DispatcherObject. Enforces that the calling thread has access to this DispatcherObject.

Вызывает событие Changed для объекта Freezable и вызывает его метод OnChanged(). Raises the Changed event for the Freezable and invokes its OnChanged() method. Классы, производные от Freezable, должны вызывать этот метод в конце любого API, который изменяет члены класса, не сохраненные в виде свойств зависимостей. Classes that derive from Freezable should call this method at the end of any API that modifies class members that are not stored as dependency properties.

Проверяет, что MediaPlayer не заморожен и доступ к нему осуществляется из допустимого контекста потока. Verifies that the MediaPlayer is not frozen and that it is being accessed from a valid threading context.

События

Происходит по завершении буферизации. Occurs when buffering has finished.

Происходит, когда буферизация началась. Occurs when buffering has started.

Происходит, когда изменяется класс Freezable или объект, который входит в его состав. Occurs when the Freezable or an object it contains is modified.

Происходит при завершении воспроизведения мультимедиа. Occurs when the media has finished playback.

Происходит при ошибке. Occurs when an error is encountered.

Происходит при открытии мультимедиа. Occurs when the media is opened.

Происходит, когда в мультимедиа встречается команда скрипта. Occurs when a script command has been encountered within the media.

Источник

Читайте также:  H310mhp установка windows 7
Поделиться с друзьями
Советы экспертов и специалистов
Adblock
detector