public MusicPlayerViewModel(HistoryService historyService, IMediaService mediaService, VlcService mediaPlayerService)
     : base(historyService, mediaService, mediaPlayerService)
 {
     _trackCollection = new TrackCollectionViewModel();
     _mediaService.MediaEnded += MediaService_MediaEnded;
     _historyService = historyService;
 }
Exemple #2
0
        public PlayVideoViewModel(HistoryService historyService, IMediaService mediaService, VlcService mediaPlayerService)
            : base(historyService, mediaService, mediaPlayerService)
        {
            _subtitles = new ObservableCollection<Subtitle>();
            _subtitlesTracks = new Dictionary<int, string>();
            _audioTracks = new Dictionary<int, string>();
#if NETFX_CORE
            _mouseService = App.Container.Resolve<MouseService>();
#endif
            _setSubTitlesCommand = new SetSubtitleTrackCommand();
            _setAudioTrackCommand = new SetAudioTrackCommand();
            _openSubtitleCommand = new OpenSubtitleCommand();
        }
Exemple #3
0
        public LastViewedViewModel()
        {
            _historyService = App.Container.Resolve<HistoryService>();

            if (_historyService.FileCount() > 0)
            {
                LastViewedSectionVisible = true;
            }
            else
            {
                WelcomeSectionVisible = true;
            }
            _clearHistoryCommand = new ClearHistoryCommand();
            _historyService.HistoryUpdated += UpdateHistory;
        }
        protected MediaPlaybackViewModel(HistoryService historyService, IMediaService mediaService, VlcService mediaPlayerService)
        {
            _historyService = historyService;

            _mediaService = mediaService;
            _mediaService.StatusChanged += PlayerStateChanged;

            _vlcPlayerService = mediaPlayerService;

            _displayAlwaysOnRequest = new DisplayRequest();
            _sliderPositionTimer = new DispatcherTimer();
            _sliderPositionTimer.Tick += FirePositionUpdate;
            _sliderPositionTimer.Interval = TimeSpan.FromMilliseconds(16);

            _skipAhead = new ActionCommand(() => _mediaService.SkipAhead());
            _skipBack = new ActionCommand(() => _mediaService.SkipBack());
            _playNext = new PlayNextCommand();
            _playPrevious = new PlayPreviousCommand();
            _playOrPause = new PlayPauseCommand();
            _goBackCommand = new StopVideoCommand();
        }
Exemple #5
0
        public MediaService(HistoryService historyService, VlcService vlcService)
        {
            _historyService = historyService;
            _vlcService = vlcService;

            _vlcService.MediaEnded += VlcPlayerService_MediaEnded;
            _vlcService.StatusChanged += VlcPlayerService_StatusChanged;
            MediaControl.IsPlaying = false;

            CoreWindow.GetForCurrentThread().Activated += ApplicationState_Activated;
        }
Exemple #6
0
 public VlcService(HistoryService historyService)
 {
     CurrentState = MediaPlayerState.Stopped;
     _historyService = historyService;
 }