示例#1
0
        public void VlcInstanceConstructorTest()
        {
            VlcInstance target = new VlcInstance(VlcInstanceArgs);

            Assert.IsInstanceOfType(target, typeof(VlcInstance));
            target.Dispose();

            target = new VlcInstance(new string[] {});
        }
示例#2
0
        public void AspectRatioTest()
        {
            VlcInstance    instance = new VlcInstance(VlcInstanceArgs);
            VlcMediaPlayer player   = instance.CreatePlayer(BaseTestFilePath + "n900_extremely_short.avi");

            player.Play();
            Assert.AreEqual("1.66", player.Media.AspectRatio);
            player.Stop();
            player.Dispose();
            instance.Dispose();
        }
示例#3
0
        public void SubtitleTracksTest()
        {
            VlcInstance    instance = null;
            VlcMediaPlayer player   = null;

            instance = new VlcInstance(VlcInstanceArgs);
            player   = instance.CreatePlayer(BaseTestFilePath + "mewmew-vorbis-ssa.mkv");
            Assert.IsInstanceOfType(player, typeof(VlcMediaPlayer));
            player.Play();
            Assert.AreEqual(player.Media.Length, 58183);
            ArrayList subtitles = player.Media.SubtitleTracks;

            Assert.AreEqual(subtitles.Count, 17);

            Assert.AreEqual("Disable", ((VLCLibrary.libvlc_track_description_t)subtitles[0]).psz_name);
            Assert.IsTrue(player.ChangeSubtitleTrack(0));
            Assert.AreEqual("Track 1 - [English]", ((VLCLibrary.libvlc_track_description_t)subtitles[1]).psz_name);
            Assert.IsTrue(player.ChangeSubtitleTrack(1));
            Assert.AreEqual("Track 2 - [Nederlands]", ((VLCLibrary.libvlc_track_description_t)subtitles[2]).psz_name);
            Assert.IsTrue(player.ChangeSubtitleTrack(2));
            Assert.AreEqual("Track 3 - [English]", ((VLCLibrary.libvlc_track_description_t)subtitles[3]).psz_name);
            Assert.IsTrue(player.ChangeSubtitleTrack(3));
            Assert.AreEqual("Track 4 - [Suomi]", ((VLCLibrary.libvlc_track_description_t)subtitles[4]).psz_name);
            Assert.IsTrue(player.ChangeSubtitleTrack(4));
            Assert.AreEqual("Track 5 - [Français]", ((VLCLibrary.libvlc_track_description_t)subtitles[5]).psz_name);
            Assert.IsTrue(player.ChangeSubtitleTrack(5));
            Assert.AreEqual("Track 6 - [Deutsch]", ((VLCLibrary.libvlc_track_description_t)subtitles[6]).psz_name);
            Assert.IsTrue(player.ChangeSubtitleTrack(6));
            Assert.AreEqual("Track 7 - [עברית]", ((VLCLibrary.libvlc_track_description_t)subtitles[7]).psz_name);
            Assert.IsTrue(player.ChangeSubtitleTrack(7));
            Assert.AreEqual("Track 8 - [Magyar]", ((VLCLibrary.libvlc_track_description_t)subtitles[8]).psz_name);
            Assert.IsTrue(player.ChangeSubtitleTrack(8));
            Assert.AreEqual("Track 9 - [Italiano]", ((VLCLibrary.libvlc_track_description_t)subtitles[9]).psz_name);
            Assert.IsTrue(player.ChangeSubtitleTrack(9));
            Assert.AreEqual("Track 10 - [日本語]", ((VLCLibrary.libvlc_track_description_t)subtitles[10]).psz_name);
            Assert.IsTrue(player.ChangeSubtitleTrack(10));
            Assert.AreEqual("Track 11 - [Norsk]", ((VLCLibrary.libvlc_track_description_t)subtitles[11]).psz_name);
            Assert.IsTrue(player.ChangeSubtitleTrack(11));
            Assert.AreEqual("Track 12 - [Polski]", ((VLCLibrary.libvlc_track_description_t)subtitles[12]).psz_name);
            Assert.IsTrue(player.ChangeSubtitleTrack(12));
            Assert.AreEqual("Track 13 - [Português]", ((VLCLibrary.libvlc_track_description_t)subtitles[13]).psz_name);
            Assert.IsTrue(player.ChangeSubtitleTrack(13));
            Assert.AreEqual("Track 14 - [Русский]", ((VLCLibrary.libvlc_track_description_t)subtitles[14]).psz_name);
            Assert.IsTrue(player.ChangeSubtitleTrack(14));
            Assert.AreEqual("Track 15 - [Español]", ((VLCLibrary.libvlc_track_description_t)subtitles[15]).psz_name);
            Assert.IsTrue(player.ChangeSubtitleTrack(15));
            Assert.AreEqual("Track 16 - [Svenska]", ((VLCLibrary.libvlc_track_description_t)subtitles[16]).psz_name);
            Assert.IsTrue(player.ChangeSubtitleTrack(16));

            player.Stop();
            player.Dispose();

            instance.Dispose();
        }
示例#4
0
        public void LengthTest()
        {
            VlcInstance    instance = null;
            VlcMediaPlayer player   = null;

            instance = new VlcInstance(VlcInstanceArgs);
            player   = instance.CreatePlayer(BaseTestFilePath + "mewmew-vorbis-ssa.mkv");
            Assert.IsInstanceOfType(player, typeof(VlcMediaPlayer));
            player.Play();
            Assert.AreEqual(player.Media.Length, 58183);

            player.Stop();
            player.Dispose();

            instance.Dispose();
        }
示例#5
0
 private void frmUNIcastPlayer_FormClosing(object sender, FormClosingEventArgs e)
 {
     if (multicastClient != null)
     {
         multicastClient.EndReceive();
     }
     isExiting = true;
     if (media != null)
     {
         media.Dispose();
     }
     if (player != null)
     {
         player.Dispose();
     }
     instance.Dispose();
 }
        public void MyTestCleanup()
        {
            if (player != null)
            {
                if (!player.IsStopped)
                {
                    player.Stop();
                }

                player.Dispose();
            }

            if (instance != null)
            {
                instance.Dispose();
            }
        }
示例#7
0
 protected override void OnClosing(CancelEventArgs e)
 {
     _logForm.Stop();
     _v.Dispose();
     base.OnClosing(e);
 }
示例#8
0
 void Form1_FormClosed(object sender, FormClosedEventArgs e)
 {
     //throw new NotImplementedException();
     player.Dispose();
     Pbase.Dispose();
 }