Exemplo n.º 1
0
 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);
         }
     });
 }
Exemplo n.º 2
0
 private void DeleteVideoMediaInternal(VideoMedia entity)
 {
     base.VideoMediaDataService.Delete(entity);
     this.Videos.Remove(entity);
 }
Exemplo n.º 3
0
        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();
            }
        }
Exemplo n.º 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);
 }
Exemplo n.º 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;
     });
 }
Exemplo n.º 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;
     });
 }
Exemplo n.º 7
0
 public DataAsyncResult DeleteVideoMedia(VideoMedia entity, TaskParam taskParam)
 {
     return this.EnqueueRequest(taskParam, () =>
     {
         DeleteVideoMediaInternal(entity);
         return null;
     });
 }
Exemplo n.º 8
0
 public void Play(VideoMedia media)
 {
     this.NavigationViewService.NavigateTo("/UI/Pages/VideoPlayerPage.xaml",
                                                                              new NavigationParameter("videoId", media.Id.ToString()));
 }