I want to compose a sequence of videos at runtime, making the result look like one, smooth video.
This snippet shows my current approach:
void mediaElement_MediaEnded(object sender, RoutedEventArgs e)
{
if (_currentVideoIndex == this.videos.Length)
this._currentVideoIndex = 0;
PlayNext();
}
void PlayNext()
{
mediaElement.Source = new Uri(videos[_currentVideoIndex++]);
mediaElement.Play();
}
The videos play fine, but the player goes blank for about half of a second between each video.
I'm not tied to a specific platform at this point, WPF / MediaElement is just where I'm starting.