locked
Getting presentation clock in MediaElement with custom source

    Question

  • Hi,

    I'm writing a custom media source to be used with XAML MediaElement (in c++/c# apps) or video tag (in JS apps).

    I need to find a way to get the current presentation clock for the media session (so app can sync some events with current played sample time). I don't think using MediaElement.Position is sufficient since my stream can be live stream, and I have no idea what would be the value in such cases.

    I noticed Microsoft solved this problem for their Smooth streaming source (as can be seen in the "Player Framework" source code) by receiving StartEndTime events straight from the media source (using PropertySet to pass a pointer to the event handler). I can use such solution, but the question is how can I get the presentation clock (or any other interface which will give me the timestamp of current played sample) inside my custom source?

    Thanks!

    Wednesday, July 17, 2013 12:22 PM

Answers