public IMedia addMedia(string filename, double pos_in_seconds, string url = null) { MediaKit media = new MediaKit(filename, pos_in_seconds); media.DBID(url); // Media media = new Media(filename, pos_in_seconds); this.medias.Add(media); return(media); }
private IMedia loadMediaFile(string filename, MediaType type) { if (!File.Exists(filename)) { MessageTools.Error("Media file not found '" + filename + "'"); return(null); } if (Mediabackend == MEDIABACKEND.MEDIAKIT) { try { MediaKit media = new MediaKit(filename, type); media.OnMediaMouseDown += OnMediaMouseDown; media.OnMediaMouseUp += OnMediaMouseUp; media.OnMediaMouseMove += OnMediaMouseMove; addMedia(media); return(media); } catch { return(null); //ignore the file } } else if (Mediabackend == MEDIABACKEND.MEDIA) { try { Media media = new Media(filename, type); media.OnMediaMouseDown += OnMediaMouseDown; media.OnMediaMouseUp += OnMediaMouseUp; media.OnMediaMouseMove += OnMediaMouseMove; addMedia(media); return(media); } catch { return(null); //ignore the file } } return(null); }