473,387 Members | 1,834 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

problem using MediaElement for audio/video

175 100+
I've scoured the Internet and can find many people with the same problem, but not a single solution. So, anyway ...

The problem is that when using MediaElement ( .NET, VS2008 ), when I get to the point where I want to check the length of ( in my case ) an audio file, I do something like this ...

Expand|Select|Wrap|Line Numbers
  1. MediaElement me = new MediaElement();
  2.  
  3. ...
  4. ...
  5. ...
  6.  
  7. double milliseconds = 0;
  8. bool gotTime = me.NaturalDuration.HasTimeSpan;
  9.  
  10. if( gotTime )
  11. {
  12.     milliseconds = me.NaturalDuration.Timespan.TotalMilliseconds;
  13. }
  14.  

... and an exception gets thrown SOME TIMES ( other times it runs through just fine ), saying that there is no time span. BUT, when the exception gets thrown, while stepping through the code, 'me.NaturalDuration.Timespan.TotalMilliseconds' has a value, and not just a value, but the correct value. Why won't the value return when it's right there!?

If anyone can help I would greatly appreciate it, as this issue is driving me crazy.
Oct 5 '10 #1
0 1014

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: FAYYAZ | last post by:
Hi All I am looking for a way to deliver audio/video files to users as that user do not know the url of file. For Expamle I have abc.mp3 and some one wants to download this file he has to click...
2
by: Kent Lewandowski | last post by:
hi all, Recently I wrote some stored procedures using java jdbc code (admittedly my first stab) and then tried to implement the same within java packages (for code reuse). I encountered...
3
by: Franky | last post by:
Been having a problem using a treeview. Work great the first time the form containing it is entered but not the second time. Took a while to create a small sample that exhibits the problem, but...
2
by: Ken Seehart | last post by:
Hello, I am looking for a good audio/video conferencing library. Ideally it should work with wxPython (or have some means of making it work there). So far my main difficulty in my attempt at...
1
by: rashish12 | last post by:
Hello All, I want to uplaod the audio/video file on server using PHP. Also want to download the same file throught the script and play that same file. I know how to uplaod the text file using...
2
TLL
by: TLL | last post by:
Greetings to all, I'm rather perplexed about how to go about loading of audio/video files from memory in .NET despite having done lotsa research. Please help me in this area... Thanks so...
2
TLL
by: TLL | last post by:
Hi to all the progrogramming professionals, I've had a query regarding about how to load audio/video files from memory using C#.net. Cause currently, Im working on a digital rights management...
1
by: varun123 | last post by:
hi i am new to this.... i am working on website which is not compatible for audio/video files now. now i need to put it up some audio/video files.... i am working with c#.net and access as back...
0
by: fahima | last post by:
This is an idea to develop a mathematical tool/application which accepts mathematical symbols, expressions, equations from the end user in the form of text, audio and video. This feature enhances...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.