I'm using Media Element
in an application UWP
to run a sequence of videos, how do I do when one video ends the other runs in sequence?
In the code below when the first video of List<string> videos10
ends the other one of the sequence does not run
My idea is to make the function SequenciaDeVideosNoArquivoTexto();
receive a sequence of video names from a text file.
So with the text file I will have total control of the video sequence that I will constantly change.
public MainPage()
{
this.InitializeComponent();
SequenciaDeVideosNoArquivoTexto();
}
private void SequenciaDeVideosNoArquivoTexto()
{
//A LIST ABAIXO FAREI PEGAR AS INFORMAÇÕES DO ARQUIVO TEXTO
List<string> videos10 = new List<string>();
videos10.Add("Call Farma");
videos10.Add("Dia Mundial");
videos10.Add("Dolex Nueva");
videos10.Add("Mori Farma");
foreach (var item in videos10)
{
LoadMediaFromString("ms-appx:///Videos/" + item + ".mp4");
}
}
private void LoadMediaFromString(string path)
{
try
{
Uri pathUri = new Uri(path);
mediaPlayer.Source = pathUri;
}
catch (Exception ex)
{
if(ex is FormatException)
{
}
throw;
}
}