locked
[UWP] PlaybackRate does not work on MediaStreamSource RRS feed

  • Question

  • MediaElement.PlaybackRate does not work when MediaElement is using MediaStreamSource?

    Just try the MediaStreamSource(Win8.1) sample.

    Wednesday, June 15, 2016 8:41 AM

Answers

  • Hi Exilerrr,

    The MediaStreamSource(Win8.1) sample that use the MediaStreamSample class to set the file to the MediaElement. That dose not read the file by one time. It will fire the MediaStreamSource.Starting event many times to load the file.

    So if we set the Source property of the MediaElement in XAML. The code of  MediaElement.PlaybackRate=2.0 can work.

    Best Regards,

    Jayden Gu 

    • Marked as answer by Exilerrr Sunday, June 19, 2016 2:28 AM
    Saturday, June 18, 2016 9:17 AM

All replies

  • Hi Exilerrr,

    We can use the MediaElement.DefaultPlaybackRate to set the default playback rate for the media engine. The playback rate applies when the user isn't using fast forward or reverse.

    I set the mediaPlayer.DefaultPlaybackRate = 0.5 in the MediaStreamSource(Win8.1) sample, that works.

    Best Regards,

    Jayden Gu

    Thursday, June 16, 2016 9:09 AM
  • 0.5 also work for MediaElement.PlaybackRate , but 2.0 does not work.

    Seems it can only reduce the playback speed?

    Thursday, June 16, 2016 6:02 PM
  • Hi Exilerrr,

    The MediaStreamSource(Win8.1) sample that use the MediaStreamSample class to set the file to the MediaElement. That dose not read the file by one time. It will fire the MediaStreamSource.Starting event many times to load the file.

    So if we set the Source property of the MediaElement in XAML. The code of  MediaElement.PlaybackRate=2.0 can work.

    Best Regards,

    Jayden Gu 

    • Marked as answer by Exilerrr Sunday, June 19, 2016 2:28 AM
    Saturday, June 18, 2016 9:17 AM
  • Only change position will fire starting. Why it is needed to load file by one time...

    So MediaStreamSource does not support Rate=2.0, will it support in the future?

    Sunday, June 19, 2016 2:26 AM
  • I know this is pretty old, still: You need to set the MaxSupportedPlaybackRate property on the MediaStreamSource. By default it will only support 1.0 or lower, but you can change to anything you like.

    This has been added with Windows 10 Creators Update.

    • Proposed as answer by Lukas F Friday, February 16, 2018 1:15 PM
    • Edited by Lukas F Friday, February 16, 2018 1:18 PM
    Friday, February 16, 2018 1:15 PM