Example #1
0
        public void DisposeMediaDiscoverer()
        {
            var mds = _libVLC.MediaDiscoverers(MediaDiscovererCategory.Lan);
            var md  = new MediaDiscoverer(_libVLC, mds.First().Name);

            Assert.True(md.Start());
            Assert.True(md.IsRunning);
            Assert.NotNull(md.MediaList);
            md.Dispose();
            Assert.IsNull(md.MediaList);
            Assert.False(md.IsRunning);
            Assert.AreEqual(IntPtr.Zero, md.NativeReference);
        }
        public async Task DisposeMediaDiscoverer()
        {
            var mds = _libVLC.MediaDiscoverers(MediaDiscovererCategory.Lan);
            var md  = new MediaDiscoverer(_libVLC, mds.First().Name);

            Assert.True(md.Start());
            Assert.True(md.IsRunning);
            Assert.NotNull(md.MediaList);
            await Task.Delay(1000);

            foreach (var media in md.MediaList)
            {
                Debug.WriteLine(media.Mrl);
            }
            md.Dispose();
            Assert.IsNull(md.MediaList);
            Assert.False(md.IsRunning);
            Assert.AreEqual(IntPtr.Zero, md.NativeReference);
        }