private void Ready()
 {
     Deployment.Current.Dispatcher.BeginInvoke(() =>
     {
         Messenger.Default.Send(ScreenLock.Release());
         if (App.DataCacheServiceInstance != null &&
             App.DataCacheServiceInstance.Videos != null)
         {
             var parameters = this.NavigationViewService.GetParametersFromUri();
             var id = Int32.Parse(parameters.First().Value);
             this.currentVideo = App.DataCacheServiceInstance.VideosVisible.FirstOrDefault(x => x.Id == id);
             this.SetVideo(this.currentVideo);
         }
     });
 }
示例#2
0
 private void DeleteVideoMediaInternal(VideoMedia entity)
 {
     base.VideoMediaDataService.Delete(entity);
     this.Videos.Remove(entity);
 }
        public void SetVideo(VideoMedia video)
        {
            try
            {
                // Set Video
                using (IsolatedStorageFile store = IsolatedStorageFile.GetUserStoreForApplication())
                {
                    this.currentStream = store.OpenFile(Path.Combine(this.MediaSupportService.GetStorageDirectory(), video.FilesystemId), FileMode.Open);
                }
                this.mediaElement.SetSource(this.currentStream);

                // Stop Progress Timer
                if (this.progressTimer != null)
                {
                    if (this.progressTimer.IsEnabled)
                    {
                        this.progressTimer.Stop();
                    }
                }
            }
            catch (Exception e)
            {
                this.MediaFailed();
            }
        }
示例#4
0
 private void AddVideoMediaInternal(string title, string filesystemId, bool isProtected)
 {
     var videoEntity = new VideoMedia() { Title = title, FilesystemId = filesystemId, IsProtected = isProtected };
     base.VideoMediaDataService.Insert(videoEntity);
     this.Videos.Add(videoEntity);
 }
示例#5
0
 public DataAsyncResult UpdateVideoMedia(VideoMedia entity, string title, bool isProtected, TaskParam taskParam)
 {
     return this.EnqueueRequest(taskParam, () =>
     {
         entity.Title = title;
         entity.IsProtected = isProtected;
         base.VideoMediaDataService.Update(entity);
         return null;
     });
 }
示例#6
0
 public DataAsyncResult SendToAudioLibrary(VideoMedia entity, TaskParam taskParam)
 {
     return this.EnqueueRequest(taskParam, () =>
     {
         var title = entity.Title;
         var fileSystemId = entity.FilesystemId;
         var isProtected = entity.IsProtected;
         this.DeleteVideoMediaInternal(entity);
         this.AddAudioMediaInternal(title, string.Empty, string.Empty, fileSystemId, isProtected);
         return null;
     });
 }
示例#7
0
 public DataAsyncResult DeleteVideoMedia(VideoMedia entity, TaskParam taskParam)
 {
     return this.EnqueueRequest(taskParam, () =>
     {
         DeleteVideoMediaInternal(entity);
         return null;
     });
 }
示例#8
0
 public void Play(VideoMedia media)
 {
     this.NavigationViewService.NavigateTo("/UI/Pages/VideoPlayerPage.xaml",
                                                                              new NavigationParameter("videoId", media.Id.ToString()));
 }