uri - WPF MediaElement Natural Duration -


I have a media element that I set my source in a new URI based on a valid string.

For example:

MediaElementName.Source = new URI ("string");

The string is a valid path, and after debugging, sometimes it sets the NaturalDuration of "MediaElementName"

I now at least with the result of any work Googling for 2 hours has gone ..

Anyone here has an idea why sometimes it will set naturalness, and sometimes it does not happen? I am able to play Wave, but do not know how long wav file (time duration)

Any help or thought is appreciated, thanks!

- BTG

I know that it is very late but then Also my experience is in two forms of this problem.

a) The codec (flac can be an example of this) can not know the duration. Check and see if the windows media player is showing the progress bar (I had this problem in some flax files being created by custom frame) I suspect there was no "index" inside the file. Apart from this, the Flax format gives different results based on different results, if it is running on a local file or at http (I suspect why this is because because when he can not search within a stream, he Length can not be found).

b) Some codec do not provide some content until they provide some content, to solve it, I have a timer running that uses Player.NaturalDuration.HasTimeSpan and then Get the TimeSpan. It usually starts playing within a few seconds of the media within a few seconds. Investigating timepoints in Player_MediaOpened does not work reliably.


Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -