Click here to Skip to main content
15,881,812 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I Have four Videos Playing on WPF Single Form Using MediaElement Tag. Each Video has configured Play Time .Videos played as per configured time one after other sequentially this cycle repeats for 2-3 days .
for e.g i Have v1.mp4,v2.mp4,v3.mp4,v4.mp4 with its Configured Play Times 8,10,15,12 Seconds for Each respectively.Sequentially v1,v2,v3,v4 Videos will Play as Per its Time again cycle repeats.
When I Run Application it plays for 3-4 minutes after that Entire Screen is become Freeze/Stuck.
Can anyone help me on what has to be done.
Thanks in Advance
Posted
Comments
LLLLGGGG 21-Jan-15 16:23pm    
I'm totally guessing as I have not the code under my eyes, but it can be an issue related to Garbage Collector. When my applications have some performance issues, I use GC.Collect(). It rarely works, but you can try to do it and see what happens. Actually I have not got a clue about the problem... you may try to call the method AFTER you have loaded a video, but there are really few probabilities for it to work. You may try to avoid using so many mediaelements or so many videos... I really hope this helps and is not useless... Unfortunately , performance issue s related to someone else's code are not so easy to solve... you may also try to use DirectX to play your videos. They might be more controllable.
Rakesh Bairi 22-Jan-15 3:53am    
Thanks for your response,I m tried with GC.Collect() but no resolution to problem
User-8621695 22-Jan-15 1:06am    
Hi Rakesh,

Same problem I faced also before 6 months. For this first thing is that use GC.collect() in all the methods which will clear the memory.
Most important thing is that Do not play, pause or do any thing from XAML, means by its default controls.Please do all the things from code itself. Check it again and let me know that is there any changes in performance.

Thanks
Rakesh Bairi 22-Jan-15 3:56am    
I m controlling Creating,Playing,Disposing media elements from code only.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900