Exemple #1
0
		public void PlayVideo(VideoDetailedVM vid)
		{
			try
			{
				recentlyPlayedFiles[vid.VideoLocalID] = vid;
				Process.Start(new ProcessStartInfo(vid.FullPath));
			}
			catch (Exception ex)
			{
				Utils.ShowErrorMessage(ex);
			}
		}
 public VideoWatchedEventArgs(int videoLocalID, VideoDetailedVM vid)
 {
     this.VideoLocalID = videoLocalID;
     this.VideoLocal = vid;
 }
 public void PlayVideo(VideoDetailedVM vid)
 {
     try
     {
         defaultplayer = UserSettingsVM.Instance.DefaultPlayer_GroupList.ToString();
         switch (defaultplayer)
         {
             case "1":
                 defaultplayer = "mpc-hc";
                 break;
             case "2":
                 defaultplayer = "PotPlayerMini";
                 break;
             case "3":
                 defaultplayer = "vlc";
                 break;
             default:
                 defaultplayer = "vlc";
                 break;
         }
         recentlyPlayedFiles[vid.VideoLocalID] = vid;
         if (vid.FullPath.Contains("http:")) {
             try
             {
                 Process.Start(defaultplayer, '"' + vid.FullPath.Replace(@"\", "/") + '"');
             }
             catch(Exception e)
             {
                 Process.Start(defaultplayer+"64", '"' + vid.FullPath.Replace(@"\", "/") + '"');
             }
         }
         else
         {
             try
             {
                 Process.Start(defaultplayer, '"' + vid.FullPath + '"');
             }
             catch (Exception e)
             {
                 Process.Start(defaultplayer + "64", '"' + vid.FullPath.Replace(@"\", "/") + '"');
             }
         }
         defaultplayer = UserSettingsVM.Instance.DefaultPlayer_GroupList.ToString();
     }
     catch (Exception ex)
     {
         Utils.ShowErrorMessage(ex);
     }
 }
Exemple #4
0
 public void PlayVideo(VideoDetailedVM vid,bool forcebegining)
 {
     try
     {
         IVideoPlayer player = ResolvePlayer();
         if (player == null)
             throw new Exception("Please configure a Video Player");
         VideoInfo info = vid.ToVideoInfo(forcebegining);
         recentlyPlayedFiles[info.VideoLocalId] = info;
         player.Play(info);
     }
     catch (Exception ex)
     {
         Utils.ShowErrorMessage(ex);
     }
 }
        public void Init(int animeID, GroupFileSummaryVM gfs)
        {
            this.Cursor = Cursors.Wait;

            GroupFileSummary = gfs;
            AnimeID = animeID;

            // get the videos
            try
            {
                JMMServerVM.Instance.RefreshCloudAccounts();
                dict = JMMServerVM.Instance.FolderProviders.ToDictionary(a => a.CloudID ?? 0, a => new Tuple<string, BitmapImage>(a.Provider, a.Icon));
                chks = new Dictionary<string, bool>();
                Dictionary<string, BitmapImage> types = new Dictionary<string, BitmapImage>();

                List<JMMServerBinary.Contract_VideoDetailed> vidContracts = JMMServerVM.Instance.clientBinaryHTTP.GetFilesByGroup(AnimeID,
                    GroupFileSummary.GroupName, JMMServerVM.Instance.CurrentUser.JMMUserID.Value);
                vids = new List<VideoDetailedVM>();
                foreach (JMMServerBinary.Contract_VideoDetailed contract in vidContracts)
                {
                    VideoDetailedVM vid = new VideoDetailedVM(contract);
                    foreach (VideoLocal_PlaceVM vv in vid.Places)
                    {
                        Tuple<string, BitmapImage> tup = dict[vv.ImportFolder.CloudID ?? 0];
                        if (!types.ContainsKey(tup.Item1))
                            types.Add(tup.Item1, tup.Item2);
                    }
                    vids.Add(vid);
                }
                FileCount = vids.Count;
                lbFiles.ItemsSource = vids;

                GroupName = GroupFileSummary.GroupName;
                SummaryText = "";
                InitImportFolders(types);

            }
            catch (Exception ex)
            {
                Utils.ShowErrorMessage(ex);
            }
            finally
            {
                this.Cursor = Cursors.Arrow;
            }
        }
		public void Init(int animeID, GroupFileSummaryVM gfs)
		{
			this.Cursor = Cursors.Wait;

			GroupFileSummary = gfs;
			AnimeID = animeID;

			// get the videos
			try
			{
				List<JMMServerBinary.Contract_VideoDetailed> vidContracts = JMMServerVM.Instance.clientBinaryHTTP.GetFilesByGroup(AnimeID,
					GroupFileSummary.GroupName, JMMServerVM.Instance.CurrentUser.JMMUserID.Value);
				vids = new List<VideoDetailedVM>();
				foreach (JMMServerBinary.Contract_VideoDetailed contract in vidContracts)
				{
					VideoDetailedVM vid = new VideoDetailedVM(contract);
					vids.Add(vid);
				}
				FileCount = vids.Count;
				lbFiles.ItemsSource = vids;

				GroupName = GroupFileSummary.GroupName;
				SummaryText = "";
			}
			catch (Exception ex)
			{
				Utils.ShowErrorMessage(ex);
			}
			finally
			{
				this.Cursor = Cursors.Arrow;
			}

		}
		public void Init(int animeID, GroupVideoQualityVM gvq)
		{
			this.Cursor = Cursors.Wait;

			GroupVideoQuality = gvq;
			AnimeID = animeID;

			// get the videos
			try
			{
				List<JMMServerBinary.Contract_VideoDetailed> vidContracts = JMMServerVM.Instance.clientBinaryHTTP.GetFilesByGroupAndResolution(AnimeID,
					GroupVideoQuality.GroupName, GroupVideoQuality.Resolution, GroupVideoQuality.VideoSource, GroupVideoQuality.VideoBitDepth, JMMServerVM.Instance.CurrentUser.JMMUserID.Value);
				vids = new List<VideoDetailedVM>();
				foreach (JMMServerBinary.Contract_VideoDetailed contract in vidContracts)
				{
					VideoDetailedVM vid = new VideoDetailedVM(contract);
					vids.Add(vid);
				}
				FileCount = vids.Count;
				lbFiles.ItemsSource = vids;

				GroupName = GroupVideoQuality.GroupName;
				SummaryText = string.Format("{0} - {1}", GroupVideoQuality.VideoSource, GroupVideoQuality.Resolution);
			}
			catch (Exception ex)
			{
				Utils.ShowErrorMessage(ex);
			}
			finally
			{
				this.Cursor = Cursors.Arrow;
			}

		}