private void OnSelected() { InMemory.Set("SelectedVideo", Video); Mediator.NotifyColleagues("OnPlayVideo", Video); if (InMemory.Can("tag")) { Mediator.NotifyColleagues("OnChangeTag", InMemory.Get("tag")); } else { Mediator.NotifyColleagues("OnChangeTag", string.Empty); } }
private void OnSelectMeta() { if (InMemory.Can("SelectedVideo")) { if (InMemory.Get("SelectedVideo") is Video video) { int fps = video.Fps; TimeSpan duration = video.Duration; long frame = (long)BeginFrame; double time = ((double)frame / fps); Mediator.NotifyColleagues("SetPosition", time); Mediator.NotifyColleagues("OnProgress", time); } } }
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { if (InMemory.Can("SelectedVideo")) { if (InMemory.Get("SelectedVideo") is Video video) { int fps = video.Fps; TimeSpan duration = video.Duration; long frame = (long)value; int time = (int)(frame / fps); return(new TimeSpan(0, 0, time)); } } return(value); }