public ShowVideoListPage(IEnumerable <BaseContentEntity> items, TypeItem typeVideo)
        {
            try
            {
                InitializeComponent();

                if (typeVideo == TypeItem.Video360)
                {
                    Title = "Видео 360";
                }
                if (typeVideo == TypeItem.Video5D)
                {
                    Title = "Видео 5D";
                }
                if (typeVideo == TypeItem.Game)
                {
                    Title = "Игры";
                }

                App.MainWnd.ChangeTitle(Title);
                VideoViewer.SetSourse(items);
                Paggination.SetViewer(VideoViewer);
                Paggination.GenerateListPagginationButtons();
                Paggination.CurrentPage = 1;
            }
            catch (Exception ex)
            {
                App.SendException(ex);
            }
        }
Example #2
0
 public void openCam()
 {
     TimerThread.Enabled = true;
     TimerThread.Start();
     fuenteVideo             = new VideoCaptureDevice(ball[CameraComboBox.SelectedIndex].MonikerString);
     VideoViewer.VideoSource = fuenteVideo;
     VideoViewer.Start();
 }
Example #3
0
        /// <summary>
        /// Fades in video and hiding loading ring when it starts to play.
        /// </summary>
        private async void VideoStateChanged(object sender, RoutedEventArgs e)
        {
            if (VideoViewer.CurrentState == Windows.UI.Xaml.Media.MediaElementState.Playing)
            {
                await VideoViewer.Fade(1, 200).StartAsync();

                LoadingRing.IsActive = false;
            }
        }
Example #4
0
        private void Video_OnMouseDown(object sender, MouseButtonEventArgs e)
        {
            var button = sender as Border;

            if (button == null)
            {
                return;
            }
            var view = new VideoViewer($"C:\\xampp\\htdocs\\locations\\{button.Tag}\\video.mp4");

            view.ShowDialog();
        }
Example #5
0
        private void buttonShowVideo_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                if (usingRemotePath || !File.Exists(mCaseInfo.Image1))
                {
                    mCaseInfo.Image1 = mCaseInfo.RemoteImage1;
                }
                else
                {
                    usingRemotePath = false;
                }

                string filePath = mCaseInfo.Image1;
                //string filePath = @"C:\ENC\LuAnn\Not Showing in Session\Img0178s.enc";

                var camera = CameraFactory.Find();
                if (camera == null)
                {
                    return;
                }

                Configuration configuration = new Configuration();

                string videoPath;
                videoPath = camera.ExtractInfringementVideo(filePath, configuration.GetDLLPath());
                if (videoPath != string.Empty)
                {
                    VideoViewer videoViewer = new VideoViewer();
                    videoViewer.LoadVideo(videoPath);
                    videoViewer.ShowDialog();
                    File.Delete(videoPath);
                }
                else
                {
                    MessageBox.Show("No Video File found.");
                }
            }
            catch (GatewayException gex)
            {
                System.Diagnostics.Trace.WriteLine(string.Format("Failed to load window from{0} - {1}", "OtherWindow", gex.Message));
                throw new Exception(String.Format("Failed to load window from{0} - {1}", "OtherWindow", gex.Message), gex);
            }
            catch (Exception ex)
            {
                System.Diagnostics.Trace.WriteLine(string.Format("Failed to load window from{0} - {1}", "OtherWindow", ex.Message));
                throw new Exception(String.Format("Failed to load window from{0} - {1}", "OtherWindow", ex.Message), ex);
            }
        }
        private void VideoViewer_TileClick(object sender, EventArgs e)
        {
            BaseContentEntity  content;
            VideoControlerPage controller;

            VideoViewer.FreeResourses();

            if (sender is ModelVideo)
            {
                content    = sender as ModelVideo;
                controller = new VideoControlerPage(content as ModelVideo);
            }
            else
            {
                content    = sender as ModelGame;
                controller = new VideoControlerPage(content as ModelGame);
            }
            App.Frame.Navigate(controller);
        }
        private void Information_OnMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            var career = KunosCareerObject;

            if (career == null)
            {
                return;
            }

            if (File.Exists(career.StartVideo))
            {
                //if (VideoViewer.IsSupported()) {
                var videoViewer = new VideoViewer(career.StartVideo, career.Name);
                videoViewer.ShowDialog();
                //} else {
                //    NonfatalError.Notify(ControlsStrings.Video_CannotPlay, ControlsStrings.Video_CannotPlay_Commentary);
                //}
            }

            new KunosCareerIntro(career).ShowDialog();
        }
 private void Page_Unloaded(object sender, RoutedEventArgs e)
 {
     VideoViewer.FreeResourses();
 }
Example #9
0
 protected override void OnDisappearing()
 {
     DependencyService.Get <IStatusBar>().ShowStatusBar();
     NavigationPage.SetHasNavigationBar(this, false);
     VideoViewer.Stop();
 }
Example #10
0
 protected override void OnAppearing()
 {
     DependencyService.Get <IStatusBar>().HideStatusBar();
     VideoViewer.Play();
 }
Example #11
0
        private void timer1_Tick(object sender, EventArgs e)
        {
            DT_Now = DateTime.Now;

            if (VideoViewer.GetCurrentVideoFrame() != null)
            {
                BarcodeReader Reader = new BarcodeReader();
                Bitmap        img    = new Bitmap(VideoViewer.GetCurrentVideoFrame());

                //----------------加入CV---------------------
                //Image<Gray, byte> I = new Image<Gray, byte>(img);
                //Image<Bgr, byte> DrawI = I.Convert<Bgr, byte>();
                //Image<Gray, byte> CannyImage = I.Clone(); //灰階處理
                //CvInvoke.GaussianBlur(I, CannyImage, new Size(5, 5), 0);
                //CvInvoke.Canny(I, CannyImage, 100, 200);
                //MyCV.BoundingBox(CannyImage, DrawI);
                //pictureBox1.Image = DrawI.Bitmap;
                //pictureBox2.Image = CannyImage.Bitmap;
                //Result result = Reader.Decode(DrawI.Bitmap);
                //----------------CV end----------------------
                Result result = Reader.Decode(img); //原本
                img.Dispose();                      //釋放資源


                if (result != null)
                {
                    Scan_result_richTextBox.SelectionColor = Color.Green;
                    Scan_result_richTextBox.AppendText("[" + DT_Now + "] 掃描條碼顯示: " + result + Environment.NewLine);

                    //Scan_result.Items.Add("DBconnection = " + connectionString);
                    //資料庫(自動Dispose寫法)
                    String check_psd = "SELECT * FROM staff_info WHERE Encode_ID = '" + result + "'";
                    using (OleDbCommand cmd = new OleDbCommand())
                    {
                        DataSet          ds        = new DataSet();
                        Table_Row        TBR       = new Table_Row();
                        List <Table_Row> table_row = new List <Table_Row>();

                        //OleDbDataReader dr;
                        cmd.Connection  = Access_DataBase.DB_Conn_Open(connectionString_StaffDB);
                        cmd.CommandText = check_psd;
                        //dr = cmd.ExecuteReader();
                        OleDbDataAdapter adapter = new OleDbDataAdapter(cmd);

                        try
                        {
                            adapter.Fill(ds, "Encode_ID");
                            adapter.Fill(ds, "Name");
                            adapter.Fill(ds, "Sex");
                            adapter.Fill(ds, "Job");
                            adapter.Fill(ds, "Phone");
                            adapter.Fill(ds, "CarNumP");
                            adapter.Fill(ds, "Photo");

                            try
                            {
                                TBR.Id      = ds.Tables["Encode_ID"].Rows[0]["Encode_ID"].ToString();
                                TBR.Name    = ds.Tables["Name"].Rows[0]["Name"].ToString();
                                TBR.Sex     = ds.Tables["Sex"].Rows[0]["Sex"].ToString();
                                TBR.Job     = ds.Tables["Job"].Rows[0]["Job"].ToString();
                                TBR.CarNumP = ds.Tables["CarNumP"].Rows[0]["CarNumP"].ToString();
                                TBR.CarNumP = ds.Tables["Phone"].Rows[0]["Phone"].ToString();
                                TBR.Photo   = (byte[])ds.Tables["Photo"].Rows[0]["Photo"];
                                table_row.Add(TBR);
                                ds.Tables.Clear();

                                string Table_name = DT_Now.ToString("yyyy_MM");
                                Check_Table_Exsits(Access_DataBase.DB_Conn_Open(connectionString_QRcode_Scan), cmd, Table_name);//檢查有無當月Table沒有建立
                                ShowInfo SI_form = new ShowInfo(table_row, this, Table_name, connectionString_QRcode_Scan);
                            }
                            catch
                            {
                                TimerThread.Stop();
                                string            message   = "此條碼可能被註銷,或者不是岡山榮家發行";
                                string            caption   = "查無此資料";
                                MessageBoxButtons buttons   = MessageBoxButtons.OK;
                                DialogResult      DiaResult = MessageBox.Show(message, caption, buttons);
                                //MessageBox.Show(message, caption, buttons);
                                if (DiaResult == DialogResult.OK)
                                {
                                    TimerThread.Start();
                                }
                            }
                        }
                        catch (Exception ex)
                        {
                            MessageBox.Show(ex.ToString());
                        }
                    }
                }
            }
        }