예제 #1
0
        private void ShowVideoForm(string title)
        {
            if (testForm == null || testForm.IsDisposed)
            {
                testForm = new VideoForm
                {
                    StartPosition = FormStartPosition.CenterParent,
                    Width         = 1280,
                    Height        = 720,

                    Text = title,
                };

                imageProvider?.Close(true);

                imageProvider = new D3DImageRenderer();
                var reciver = remoteClient.VideoReceiver;

                imageProvider.Setup(reciver.sharedTexture);
                imageProvider.Start();

                var video = testForm.userControl11;
                video.DataContext = imageProvider;

                testForm.FormClosed += TestForm_FormClosed;
            }


            testForm.Visible = true;
        }
예제 #2
0
        public override void InitState()
        {
            base.InitState();

            FXGrid = new Vivid.PostProcess.Processes.PPVirtualGrid();

            SUI = new UI();

            vid = new VideoForm().Set(0, 0, AppInfo.W, AppInfo.H) as VideoForm;
            Console.WriteLine("Play video");
            vid.SetVideo("Corona/Video/intro2.mov");
            SUI.Root      = vid;
            SUI.FadeUI    = false;
            SUI.FadeAlpha = 0.0f;
            vid.Click     = (b) =>
            {
                vid.Stop();
                VividApp.PushState(new ScopeNineMenu());
            };


            var lab = new LabelForm().Set(AppInfo.W / 2 - 110, AppInfo.H - 80, 300, 30, "PRESS START TO CONTINUE") as LabelForm;

            vid.Add(lab);
        }
예제 #3
0
파일: MainForm.cs 프로젝트: shimakee/BVS
 private void AddVideoButton_Click(object sender, EventArgs e)
 {
     if (videoForm == null)
     {
         videoForm = new VideoForm(_unitOfWork);
     }
     videoForm.ShowDialog();
 }
예제 #4
0
        public ActionResult editar(int?id)
        {
            var ViewModel = new VideoForm();

            ViewModel.Video = this.OVideoBL.carregar(UtilNumber.toInt32(id)) ?? new Video();

            return(View(ViewModel));
        }
예제 #5
0
 public VideoSync(VideoForm form, ref AxWindowsMediaPlayer vf, int pollingInterval)
 {
     this.Player = vf;
     this.Player.PlayStateChange += OnPlayStateChanged;
     this.SyncPollingInterval = pollingInterval;
     this.SyncTimer = new Timer();
     this.SyncTimer.Interval = SyncPollingInterval;
     this.SyncTimer.Tick += Sync;
     this.VideoForm = form;
 }
예제 #6
0
        private void CloseVideoForm()
        {
            if (testForm != null && !testForm.IsDisposed)
            {
                testForm.UnlinkInputManager();

                testForm.Close();
                testForm.FormClosed -= TestForm_FormClosed;
                testForm             = null;
            }
        }
예제 #7
0
 public void ShowVideoForm(string data)
 {
     MainForm.BeginInvoke(new Func <bool>(() =>
     {
         VideoForm form = new VideoForm(MainForm, data);
         //form.StartAudio();
         form.ShowDialog(MainForm);
         //MainForm.StartAudio(form.DisplayStatusMsg);
         //form.DisplayStatusMsg("远程连接失败.");
         return(false);
     }));
 }
예제 #8
0
 private void Play()
 {
     try
     {
         BackColor = Color.Silver;
         List <Guid> files = new List <Guid>();
         files.Add(dRec.Id);
         VideoForm videoForm = new VideoForm();
         videoForm.LoadVideoList(files, dRec.AccountId);
         int num = (int)videoForm.ShowDialog(this);
     }
     catch (Exception ex)
     {
         MessageBox.Show(this, ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Hand);
     }
     BackColor = Color.White;
 }
예제 #9
0
        public override void InitState()
        {
            SUI    = new UI();
            FXGrid = new Vivid.PostProcess.Processes.PPVirtualGrid();

            var vid = new VideoForm().Set(0, 0, AppInfo.W, AppInfo.H) as VideoForm;

            vid.SetVideo("Corona/Video/menuseq3.mov");
            SUI.Root = vid;

            vid.Click = (b) =>
            {
                //    vid.Pause();
                //   VividApp.PushState(new ScopeNineMenu());
            };

            var newGame = new ButtonForm().Set(AppInfo.W / 2 - 140, AppInfo.H - 160, 280, 30, "Begin Assignment") as ButtonForm;
            var config  = new ButtonForm().Set(AppInfo.W / 2 - 140, AppInfo.H - 120, 280, 30, "Configure Environment") as ButtonForm;
            var exit    = new ButtonForm().Set(AppInfo.W / 2 - 140, AppInfo.H - 80, 280, 30, "Exit") as ButtonForm;

            vid.Add(newGame);
            vid.Add(config);
            vid.Add(exit);

            var powerDown = Vivid.Audio.Songs.LoadSound("Corona/Sound/Misc/powerdown2.mp3");

            newGame.Click = (b) =>
            {
                vid.Stop();
                VividApp.PushState(new InGamePlatform());
            };

            if (Vivid.Input.XIn.Start())
            {
                vid.Stop();
                VividApp.PushState(new InGamePlatform());
            }

            exit.Click = (b) =>
            {
                vid.StopAudio();
                powerSnd      = Vivid.Audio.Songs.PlaySource(powerDown);
                SUI.FadeUI    = true;
                SUI.FadeAlpha = 1.0f;
            };
        }
예제 #10
0
        public ActionResult editar(VideoForm ViewModel)
        {
            if (!ModelState.IsValid)
            {
                return(View(ViewModel));
            }

            bool flagSucesso = this.OVideoBL.salvar(ViewModel.Video, null);

            if (flagSucesso)
            {
                this.Flash(UtilMessage.TYPE_MESSAGE_SUCCESS, UtilMessage.success("Sucesso!", "Os dados foram salvos com sucesso."));

                return(RedirectToAction("editar", new { id = ViewModel.Video.id }));
            }

            this.Flash(UtilMessage.TYPE_MESSAGE_ERROR, UtilMessage.error("Erro!", "Houve um problema ao salvar o registro. Tente novamente."));

            return(View(ViewModel));
        }
예제 #11
0
        private IAssetTool CreateAssetTool(AssetType assetType)
        {
            IAssetTool newAssetTool;

            switch (assetType)
            {
            case AssetType.video:
                newAssetTool = new VideoForm();
                (newAssetTool as VideoForm).Show();
                break;

            case AssetType.webpage:
                newAssetTool = new WebPageTool();
                break;

            case AssetType.flash:
                newAssetTool = new FlashForm();
                (newAssetTool as FlashForm).Show();
                break;

            case AssetType.app:
                newAssetTool = new AppTool();
                break;

            case AssetType.image:
                newAssetTool = new ImageForm();
                (newAssetTool as ImageForm).Show();
                break;

            case AssetType.ppt:
                //newAssetTool = new PointApp.AssetTool.PPTTool();
                newAssetTool = PPTTool.GetInstance();
                break;

            default:
                newAssetTool = null;
                break;
            }
            return(newAssetTool);
        }
예제 #12
0
 private void imageListView_ItemDoubleClick(object sender, ItemClickEventArgs e)
 {
     try
     {
         ImageListViewItem item = this.imageListView.Items.FocusedItem;
         if (item != null)
         {
             var fileExtension = Path.GetExtension(item.FileName);
             if (fileExtension == ".avi")
             {
                 string fileName = item.FileName;
                 int    v        = videoFiles.FindIndex(file => { return(file == fileName); });
                 videoForm = new VideoForm(videoFiles, fileName);
                 videoForm.ShowDialog();
             }
             else if (fileExtension == ".png")
             {
                 string fileName = item.FileName;
                 imageForm = new ImageForm();
                 imageForm.DeleteImageItemHandler += DeleteImageItemHandler;
                 imageForm.Text = item.Text;
                 imageForm.ImageListViewItem = item;
                 imageForm.FileName          = fileName;
                 DialogResult dr = imageForm.ShowDialog();
                 if (dr == DialogResult.OK && imageForm.IsAssign)
                 {
                     DeleteImageItemHandler(item);
                     File.Delete(item.FileName);
                 }
             }
         }
     }
     catch (Exception ex)
     {
         LogHelper.GetLogger <FilesForm>().Error(ex.Message);
         LogHelper.GetLogger <FilesForm>().Error(ex.StackTrace);
     }
 }
예제 #13
0
        public IActionResult EditVideo(VideoForm video, Guid id, string catalogId, Guid?BlogId, Guid?PracticeId)
        {
            if (ModelState.IsValid)
            {
                var oldVideo = _context.Video.Find(id);
                if (oldVideo == null)
                {
                    return(NotFound());
                }

                _context.Entry(oldVideo).CurrentValues.SetValues(video);
                oldVideo.Catalog = _context.Catalog.Find(Guid.Parse(catalogId));
                //同时更新到blog表

                if (BlogId != null)
                {
                    var blog = _context.Blog.Find(BlogId);
                    oldVideo.Blog = blog;
                    blog.Video    = oldVideo;

                    if (PracticeId != null)
                    {
                        var practice = _context.Practice.Find(PracticeId);
                        oldVideo.Practice = practice;
                        blog.Practice     = practice;
                    }
                }

                oldVideo.Status = StatusType.Edit;
                var re = _context.SaveChanges();
                if (re > 0)
                {
                    return(RedirectToAction(nameof(Index)));
                }
            }
            return(RedirectToAction(nameof(EditVideo)));
        }
예제 #14
0
 public DisplayClientWrapper(VideoForm form)
 {
     this.form = form;
 }
예제 #15
0
        private void playButton_Click(object sender, EventArgs e)
        {
            var address = addressTextBox.Text;

            if (string.IsNullOrEmpty(address))
            {
                return;
            }

            var port = (int)portNumeric.Value;

            if (vlcVideoForm == null || vlcVideoForm.IsDisposed)
            {
                vlcVideoForm = new VideoForm
                {
                    StartPosition = FormStartPosition.CenterParent,
                    Width         = 1280,
                    Height        = 720,
                };

                mediaPlayer.VideoHostControlHandle = vlcVideoForm.elementHost1.Handle; //vlcVideoForm.Handle;

                //System.Windows.Forms.Integration.ElementHost host = new System.Windows.Forms.Integration.ElementHost
                //{
                //    Dock = DockStyle.Fill,
                //};
                //testForm.Controls.Add(host);


                //UserControl1 video = new UserControl1();
                //host.Child = video;

                //video.DataContext = imageProvider;


                vlcVideoForm.FormClosed += VlcVideoForm_FormClosed;
            }

            vlcVideoForm.Visible = true;


            var file = Path.Combine(CurrentDirectory, "tmp.sdp");

            string[] sdp =
            {
                "v=0",
                "s=SCREEN_STREAM",
                "c=IN IP4 " + address,             // "c=IN IP4 239.0.0.1",
                "m=video " + port + " RTP/AVP 96", //"m=video 1234 RTP/AVP 96",
                "b=AS:2000",
                "a=rtpmap:96 H264/90000",
                "a=fmtp:96 packetization-mode=1",
                //"a=fmtp:96 packetization-mode=1 sprop-parameter-set=Z2QMH6yyAKALdCAAAAMAIAAAB5HjBkkAAAAB,aOvDyyLA",

                //"m=audio 1236 RTP/AVP 0",
                //"a=rtpmap:0 PCMU/8000",
            };


            File.WriteAllLines(file, sdp);

            var opts = new string[]
            {
                // "--extraintf=logger",
                //"--verbose=0",
                //"--network-caching=100", //не работает
            };

            mediaPlayer?.Play(new FileInfo(file), opts);
        }
예제 #16
0
        private void InitializePlayback(object sender, EventArgs e)
        {
            view.PlaybackStatus = PlaybackStatus.NotReady;
            MarkAsDirty();

            // Validate configuration before playback
            var configuration = ExplicitlyMap
                                .TheseTypes <ILedManagerView, LedConfiguration>()
                                .Using <LedManagerViewToConfigurationMap>()
                                .Map(view);

            IConfigurationValidator configValidator = new ConfigurationValidator();
            var validationResult = configValidator.Validate(configuration);

            if (validationResult.OK)
            {
                if (view.DisplayVideo)
                {
                    videoForm = new VideoForm();
                    videoForm.Show();
                }

                Task.Run(async() =>
                {
                    videoPlayer = new VideoPlayer(configuration, new PatternCreationService(), new VideoMetadataService());

                    var clientConfigPairs = new List <ClientConfigPair>();
                    foreach (var server in configuration.Servers)
                    {
                        clientConfigPairs.Add(new ClientConfigPair(new FadecandyClientWrapper(server.NetworkDeviceDetails.IPAddress, server.Port), server));
                    }

                    if (view.DisplayVideo)
                    {
                        clientConfigPairs.Add(new ClientConfigPair(new DisplayClientWrapper(videoForm), null));
                    }

                    await videoPlayer.Load(clientConfigPairs, view.VideoMetadata.StartTime.Minutes, view.VideoMetadata.StartTime.Seconds);
                    videoPlayer.ConnectedHost += (s, args) =>
                    {
                        view.PlaybackInfo = string.Format("Host '{0}' connected", args.Value);
                        MarkAsDirty();
                    };
                    videoPlayer.DisconnectedHost += (s, args) =>
                    {
                        view.PlaybackInfo = string.Format("Host '{0}' disconnected", args.Value);
                        MarkAsDirty();
                    };

                    view.PlaybackStatus = PlaybackStatus.ReadyToPlay;

                    MarkAsDirty();
                }).Forget();

                playbackCancellationTokenSource = new CancellationTokenSource();
            }
            else
            {
                view.PlaybackStatus = PlaybackStatus.NotReady;

                foreach (var error in validationResult.Errors)
                {
                    NotifyError(new Exception(error));
                }
            }

            MarkAsDirty();
        }