Custom MediaStreamSource and MediaElement.Naturalduration property

Posted by Tilo Skomudek on Stack Overflow See other posts from Stack Overflow or by Tilo Skomudek
Published on 2010-08-02T12:58:20Z Indexed on 2011/02/03 23:25 UTC
Read the original article Hit count: 678

i have written a custom mediastreamsource, that can play media from growing source files (mpeg transport streams). Once it reaches the end of its mediastream, it reads the new duration from the mediafile and continues to deliver samples. The MediaElement plays continously.

Unfortunately i haven´t found a way to update the MediaElement.NaturalDuration property. Hence i cannot seek into the “reloaded” area, because ME doesn´t know about it and sets my position change to its NaturalDuration value.

I tried to call ReportOpenMediaCompleted after getting the new stream length. Then Naturalduration get´s updated, but i cannot play anymore.

Is there any other way to deal with it ?

© Stack Overflow or respective owner

Related posts about c#

Related posts about Silverlight