Код: Выделить всё
video.IsLooping = true; // method 1
video.MediaEnded -= Video_MediaEnded;
video.MediaEnded += Video_MediaEnded; // method 2
private void Video_MediaEnded(object sender, RoutedEventArgs e)
{
video.Position = new TimeSpan(0, 0, 1);
video.Play();
}
Код: Выделить всё
private CastingConnection connection;
//Create a new casting connection to the device that's been selected
connection = (CastingDevice)castingDevicesList.SelectedItem).CreateCastingConnection();
//Register for events
connection.ErrorOccurred += Connection_ErrorOccurred;
connection.StateChanged += Connection_StateChanged;
//Cast the loaded video to the selected casting device.
CastingConnectionErrorStatus status = await connection.RequestStartCastingAsync(video?.GetAsCastingSource());
Код: Выделить всё
private void Timer_Tick(object sender, object e)
{
if (video.Position >= TimeSpan.FromSeconds(10))
{
video.Position = new TimeSpan(0, 0, 1);
}
}
Я разместил свой демонстрационный код здесь: https://github.com/tomxue/BasicMediaCas ... ee/develop ветка: development
Попробовать может каждый.
Подробнее здесь: https://stackoverflow.com/questions/786 ... ng-to-a-tv
Мобильная версия