private void SetMediaList() { SubMediaList = new List <IMediaList>(); // if offline exists, set as the main media if (contentlist.Files != null && contentlist.Files.Count != 0) { MainMediaList = contentlist.Files[0]; if (contentlist.Files.Count > 1) { SubMediaList.AddRange(contentlist.Files.GetRange(1, contentlist.Files.Count - 1)); } // add the rest. if (contentlist.Streams != null) { SubMediaList.AddRange(contentlist.Streams); } } // set the first listed stream service as the main media. else { MainMediaList = contentlist.Streams[0]; if (contentlist.Streams.Count > 1) { SubMediaList.AddRange(contentlist.Streams.GetRange(1, contentlist.Streams.Count - 1)); } } this.FindName(nameof(MediaList)); StreamServiceGrid.ItemsSource = SubMediaList; MainMediaListTitle.Text = MainMediaList.Source; }
public MediaListPlayer(IntPtr hMediaLib, IMediaList mediaList) { m_mediaList = mediaList; m_hMediaListPlayer = LibVlcMethods.libvlc_media_list_player_new(hMediaLib); LibVlcMethods.libvlc_media_list_player_set_media_list(m_hMediaListPlayer, ((INativePointer)m_mediaList).Pointer); m_mediaList.Dispose(); m_videoPlayer = new DiskPlayer(hMediaLib); LibVlcMethods.libvlc_media_list_player_set_media_player(m_hMediaListPlayer, ((INativePointer)m_videoPlayer).Pointer); m_videoPlayer.Dispose(); }
private void Dispose() { ThumbnailSpriteVisual?.Dispose(); ThumbnailSpriteVisual = null; ThumbnailSurfaceBrush?.Dispose(); ThumbnailSurfaceBrush = null; SubMediaList = null; MainMediaList = null; contentlist = null; }
static void Main(string[] args) { var MediaStorage = new MediaStorage(new List <IPlayable>(), new List <IMediaList>()); var Directory = Environment.CurrentDirectory; //аудио Guid id = Guid.NewGuid(); IPlayable element = new AudioElement(id, "AudioElement", null, new System.IO.FileInfo(Directory + "\\Баста.mp3")); MediaStorage.AddPlayable(element); Player player = new Player(new PlayableAdapterFactory()); player.Play(MediaStorage.IPlayableFindById(id)); //видео id = Guid.NewGuid(); element = new VideoElement(id, "VideoElement", null, new System.IO.FileInfo(Directory + "\\Баста.mp4")); MediaStorage.AddPlayable(element); player.Play(MediaStorage.IPlayableFindById(id)); //список Guid idMediaList = Guid.NewGuid(); IMediaList UserList = new AudioUserList(idMediaList, "AudioUserList", (ICollection <IPlayable>)MediaStorage.IPlayablesFindByName("AudioElement")); MediaStorage.AddMediaList(UserList); id = Guid.NewGuid(); element = new AudioElement(id, "AudioElement2", null, new System.IO.FileInfo(Directory + "\\Баста.mp3")); MediaStorage.AddPlayableFromMediaList(UserList, element); IMediaList mls = MediaStorage.IMediaListFindById(idMediaList); player.Play(mls.Items); Console.ReadLine(); }
private void SetBinding(object s, RoutedEventArgs a) { EpisodeNumber.Text = contentlist.GenerateEpisodeNumber(); EpisodeTitle.Text = contentlist.Title; SubMediaList = new List <IMediaList>(); // if offline exists, set as the main media if (contentlist.Files != null && contentlist.Files.Count != 0) { MainMediaList = contentlist.Files[0]; if (contentlist.Files.Count > 1) { SubMediaList.AddRange(contentlist.Files.GetRange(1, contentlist.Files.Count - 1)); } // add the rest. if (contentlist.Streams != null) { SubMediaList.AddRange(contentlist.Streams); } } // set the first listed stream service as the main media. else { MainMediaList = contentlist.Streams[0]; if (contentlist.Streams.Count > 1) { SubMediaList.AddRange(contentlist.Streams.GetRange(1, contentlist.Streams.Count - 1)); } } StreamServiceGrid.ItemsSource = SubMediaList; MainMediaListTitle.Text = MainMediaList.Source; MainMediaListIcon.Glyph = MainMediaList.Icon; Loaded -= SetBinding; }
/// <summary> /// Creates new instance of media list player /// </summary> /// <typeparam name="T">Type of media list player</typeparam> /// <param name="mediaList">Media list</param> /// <returns>Newly created media list player</returns> public T CreateMediaListPlayer <T>(IMediaList mediaList) where T : IMediaListPlayer { return(ObjectFactory.Build <T>(m_hMediaLib, mediaList)); }
public CssMediaQueryList(IWindow window, IMediaList media) { _media = media; _matched = ComputeMatched(window); window.Resized += Resized; }
public static Boolean Validate(this IMediaList list, IRenderDevice device) => !list.Any(m => !m.Validate(device));
public VlcPlayer() { string[] args = new string[] { "-I", "dumy", "--ignore-config", "--no-osd", "--disable-screensaver", "--plugin-path=./plugins", "--audio-filter=equalizer", "--equalizer-preamp=11.9", "--equalizer-bands=0 0 0 0 0 0 0 0 0 0" }; m_factory = new MediaPlayerFactory(args); m_player = m_factory.CreatePlayer <IVideoPlayer>(); m_media_list = m_factory.CreateMediaList <IMediaList>(); m_media_list_preview = m_factory.CreateMediaList <IMediaList>(); m_presets = Implementation.Equalizer.Presets.ToDictionary(key => key.Index); m_equalizer = new Implementation.Equalizer(m_presets[0]); m_equalizer.Preamp = Equalizer.ArrBandValue[10].PreAmp / 10; for (int i = 0; i < Equalizer.ArrBandValue.Count() - 2; i++) { m_equalizer.Bands[i].Amplitude = Equalizer.ArrBandValue[i].Gain / 10; Console.WriteLine("Amplitude " + m_equalizer.Bands[i].Amplitude + " : " + m_equalizer.Preamp); } m_player.SetEqualizer(m_equalizer); m_equalizer.Dispose(); //Background Video ========== m_list_player = m_factory.CreateMediaListPlayer <IMediaListPlayer>(m_media_list); m_memRender = m_list_player.InnerPlayer.CustomRenderer; m_memRender.SetCallback(delegate(Bitmap frame) { Video = (Bitmap)frame.Clone(); }); // 4:3 aspect ratio resolutions: 640×480, 800×600, 960×720, 1024×768, 1280×960, 1400×1050, 1440×1080 , 1600×1200, 1856×1392, 1920×1440, and 2048×1536 //16:9 aspect ratio resolutions: 1024×576, 1152×648, 1280×720, 1366×768, 1600×900, 1920×1080, 2560×1440 and 3840×2160 m_memRender.SetFormat(new BitmapFormat(1024, 576, ChromaType.RV32)); m_list_player.PlaybackMode = PlaybackMode.Loop; m_list_player.InnerPlayer.Mute = true; //Background Video //Preview Background video ========== m_list_preview_player = m_factory.CreateMediaListPlayer <IMediaListPlayer>(m_media_list_preview); m_list_preview_player.PlaybackMode = PlaybackMode.Loop; m_list_preview_player.InnerPlayer.Mute = true; //Preview Background video m_player.Events.PlayerPositionChanged += new EventHandler <MediaPlayerPositionChanged>(Events_PlayerPositionChanged); m_player.Events.TimeChanged += new EventHandler <MediaPlayerTimeChanged>(Events_TimeChanged); m_player.Events.MediaEnded += new EventHandler(Events_MediaEnded); m_player.Events.PlayerStopped += new EventHandler(Events_PlayerStopped); videoDir = Main_Form.iniFileHelper.Read("Video", "Video Path"); if (videoDir == string.Empty || !Directory.Exists(videoDir)) { videoDir = BGVideoPath + @"VIDEO_NATURE\"; } GetVideoBG(videoDir); SetAudioOutputDevice(); }
public void RemoveIPlayableFromMediaList(IMediaList mediaList, IPlayable IPlayable) { mediaList.Items.Remove(IPlayable); }
public void AddPlayableFromMediaList(IMediaList mediaList, IPlayable IPlayable) { mediaList.Items.Add(IPlayable); }
public void AddMediaList(IMediaList mediaList) { UserLists.Add(mediaList); }