예제 #1
0
        public void Test_Video()
        {
            string targetName = TestUtils.GetTempFilePath("test_video.3gp");

            Assembly assembly = typeof(CoreTests).Assembly;
            Stream   vidstm   = assembly.GetManifestResourceStream("GKTests.Resources.test_video.3gp");

            GKUtils.CopyFile(vidstm, new FileInfo(targetName), null);
            Assert.IsTrue(File.Exists(targetName));

            GDMMultimediaRecord mmRecV = fBase.Context.Tree.CreateMultimedia();

            mmRecV.FileReferences.Add(new GDMFileReferenceWithTitle(mmRecV));
            var fileRefV = mmRecV.FileReferences[0];

            fileRefV.Title = "File Title 2";
            fileRefV.LinkFile(targetName);
            fileRefV.MediaType        = GDMMediaType.mtVideo;
            fileRefV.MultimediaFormat = GDMMultimediaFormat.mfMKV;

            fDialog.FileRef = fileRefV;
            Assert.AreEqual(fileRefV, fDialog.FileRef);

            fDialog.SetViewMedia(targetName);
            fDialog.Refresh();

            ClickButton("btnPlay", fDialog);
            ClickButton("btnPause", fDialog);
            ClickButton("btnMute", fDialog);
            ClickButton("btnStop", fDialog);

            KeyDownForm(fDialog.Name, Keys.Escape);
        }
예제 #2
0
        public void Test_Video()
        {
            string targetName = TestUtils.PrepareTestFile("test_video.3gp");

            try {
                Assert.IsTrue(File.Exists(targetName));

                GDMMultimediaRecord mmRecV = fBase.Context.Tree.CreateMultimedia();
                mmRecV.FileReferences.Add(new GDMFileReferenceWithTitle(mmRecV));
                var fileRefV = mmRecV.FileReferences[0];

                fileRefV.Title = "File Title 2";
                fileRefV.LinkFile(targetName);
                fileRefV.MediaType        = GDMMediaType.mtVideo;
                fileRefV.MultimediaFormat = GDMMultimediaFormat.mfMKV;

                fDialog.FileRef = fileRefV;
                Assert.AreEqual(fileRefV, fDialog.FileRef);

                fDialog.SetViewMedia(targetName);
                fDialog.Refresh();

                ClickButton("btnPlay", fDialog);
                ClickButton("btnPause", fDialog);
                ClickButton("btnMute", fDialog);
                ClickButton("btnStop", fDialog);

                KeyDownForm(fDialog.Name, Keys.Escape);
            } finally {
                TestUtils.RemoveTestFile(targetName);
            }
        }