private void ConnectBTN_Click(object sender, RoutedEventArgs e)
 {
     FillPlayList();
     if (!string.IsNullOrEmpty(FolderPathTB.Text) &&
         Directory.Exists(FolderPathTB.Text))
     {
         if (RoomNameTB.Text.Length > 5 && RoomPasswordTB.Password.Length > 5)
         {
             var room = new Room {
                 UniqName = RoomNameTB.Text, Name = RoomNameTB.Text, Password = RoomPasswordTB.Password, Medias = Playlist
             };
             if (room.ConntectToRoom())
             {
                 room.Medias       = Playlist;
                 room.PlaylistPath = FolderPathTB.Text;
                 PlayerForm playerForm = new PlayerForm(room, false);
                 playerForm.Show();
                 this.Close();
             }
             else
             {
                 System.Windows.MessageBox.Show("Something went wrong....", "Sync Player");
             }
         }
         else
         {
             RoomNameTB.Clear();
             RoomPasswordTB.Clear();
         }
     }
     else
     {
         System.Windows.MessageBox.Show("You did not select playlist folder, or folder does not exist", "Filmst");
     }
 }
Exemplo n.º 2
0
        /// <summary>
        /// 播放按钮点击事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Btn_Download_MouseClick(object sender, DuiMouseEventArgs e)
        {
            //播放视频
            DuiButton dbn = sender as DuiButton;

            Entity.MovieListEntity.DataItem moveInfo = new Entity.MovieListEntity.DataItem();
            if (dbn.Tag != null)
            {
                moveInfo = dbn.Tag as Entity.MovieListEntity.DataItem;
            }
            string url = "";

            try
            {
                API.TvAPI             tva  = new API.TvAPI();
                Entity.MovePlayEntity plav = tva.getVideoUrl(userEntity.email, userEntity.psw, moveInfo.videoID.ToString(), "all", userEntity.imei);
                Console.WriteLine(plav.toJsonString());
                Console.WriteLine(plav.data);
                PlayerForm plF = new PlayerForm();
                url        = plav.data.ToString();
                plF.tvUrl  = plav.data.ToString();
                plF.tvName = moveInfo.videoName;
                plF.Show();
                plF.AxPlayer_PlayOrPause(url);
            }
            catch (Exception ex)
            {
                Logger.Singleton.Error("name:" + moveInfo.videoName + "---地址:" + url, ex);
                throw;
            }
        }
Exemplo n.º 3
0
 public void Play(VideoInfo video)
 {
     Width  = 0;
     Height = 0;
     info   = video;
     Initialize();
     form = new PlayerForm(this);
     form.Show();
     form.Play(video);
 }
Exemplo n.º 4
0
        public void Play(VideoInfo video)
        {
            form = new PlayerForm(this);
            form.FilePosition += (v, position) =>
            {
                VideoInfoChange?.Invoke(v, position);
            };
            form.Show();

            form.Play(video);
        }
Exemplo n.º 5
0
        private void DemoFormItemOnOnExecute(object sender, EventArgs eventArgs)
        {
            if (_demoForm.IsDisposed)
            {
                _demoForm = new PlayerForm(Player, _hook);
            }

            var item = sender as IAimpMenuItem;

            Logger.Instance.AddInfoMessage($"Event: [Execute] {item.Id}");

            _demoForm.Show();
        }
 private void CreateRoomBTN_Click(object sender, RoutedEventArgs e)
 {
     FillPlayList();
     if (Playlist.Count != 0)
     {
         if (RoomNameTB.Text.Length > 5 && RoomPasswordTB.Password.Length > 5)
         {
             var room = new Room
             {
                 UniqName = RoomNameTB.Text,
                 Name     = RoomNameTB.Text,
                 Password = RoomPasswordTB.Password,
                 Medias   = Playlist
             };
             if (room.CreateRoom())
             {
                 room.Medias       = Playlist;
                 room.PlaylistPath = FolderPathTB.Text;
                 PlayerForm playerForm = new PlayerForm(room, true);
                 playerForm.Show();
                 this.Close();
             }
             else
             {
                 System.Windows.MessageBox.Show("Something went wrong....", "Filmst");
             }
         }
         else
         {
             RoomNameTB.Clear();
             RoomPasswordTB.Clear();
         }
     }
     else
     {
         System.Windows.MessageBox.Show("You did not select playlist folder, or folder does not contain files with available formats", "Filmst");
     }
 }
Exemplo n.º 7
0
 private void Player(IntPtr parentHwnd)
 {
     // 播放窗口 没有被创建
     if (playerForm == null || playerForm.IsDisposed)
     {
         // 播放器没有创建 或 播放文件不存在
         if (player == null || !File.Exists(player.FilePath))
         {
             MessageBox.Show("视频文件不存在!");
             return;
         }
         else // 可以载入播放窗口
         {
             playerForm = new PlayerForm(player.FilePath);
             // 获取播放窗口的句柄
             IntPtr child = playerForm.Handle;
             // 设置播放窗口
             if (IntPtr.Zero == Win32.User32.SetParent(child, parentHwnd))
             {
                 MessageBox.Show("error", "error");
             }
         }
     }
     else
     {
         // 切换预览视频
         if (!player.FilePath.Equals(playerForm.p.FilePath))
         {
             playerForm.p.Post(MCIPlayer.Cmd.close);
             playerForm.p.Replace(player.FilePath);
             playerForm.p.Post(MCIPlayer.Cmd.play);
             playerForm.p.Post(MCIPlayer.Cmd.loops);
         }
     }
     // 显示播放窗口
     playerForm.Show();
 }