0

I have to play three video files simultaneously using three media elements. I have tried like below. But for some videos (large in size and resolution) it takes time to play. Some times video3 will play first. and then next two videos. Is there any way to first load all three videos to buffer memory and then play it all together?

string file1="C:\\Users\\Downloads\\Video1.avi";
string file2="C:\\Users\\Downloads\\Video2.avi";
string file3="C:\\Users\\Downloads\\Video3.avi";

        MediaEL1.Source = new Uri(file1);
        MediaEL2.Source = new Uri(file2);
        MediaEL3.Source = new Uri(file3);
        MediaEL1.Play();
        MediaEL2.Play();
        MediaEL3.Play();

But when using directly the path, it all plays at same time even there is a delay to load the videos.

        MediaEL1.Source = new Uri("C:\\Users\\Downloads\\Video1.avi");
        MediaEL2.Source = new Uri("C:\\Users\\Downloads\\Video2.avi");
        MediaEL3.Source = new Uri("C:\\Users\\Downloads\\Video3.avi");

Please help to correct.

user2431727
  • 877
  • 2
  • 15
  • 46
  • Does this answer your question? [WPF - limitation for playing mediaelement at once](https://stackoverflow.com/questions/12957121/wpf-limitation-for-playing-mediaelement-at-once) – Sinatr Jun 18 '20 at 10:31
  • @Sinatr they are asked to go for mediakit. I will try it and tell. – user2431727 Jun 18 '20 at 11:38

0 Answers0