Using MediaElement to play video from Stream

前端 未结 5 899
生来不讨喜
生来不讨喜 2020-11-27 05:34

Is it possible to use the WPF MediaElement to play streaming video from a System.IO.Stream object? The Stream object is being retrieved from a WCF service that stores the me

5条回答
  •  一向
    一向 (楼主)
    2020-11-27 05:50

    As WPF mediaelement internally uses windows media player. If you alter the buffer settings of media player from default buffer setting to custom. Open windows media player  Tools  Options  Performance.

    When you choose “Buffer” option and set “Seconds of content” to 2. The following registry values will be added under media player. HKEY_CURRENT_USER\Software\Microsoft\MediaPlayer\Preferences UseDefaultBufferTime=0 CustomBufferTime=2000

    You can use dotnet registry class to make changes. Refer this link: https://social.msdn.microsoft.com/Forums/vstudio/en-US/1b4b8fb9-ff8f-4861-8e99-4a7a4fc75596/setting-windows-media-player-properties-in-wpf?forum=wpf#ac879a7f-37bc-4ccc-854d-ab6e047086e5

提交回复
热议问题