コード例 #1
0
        public UserVideoPageViewModel(
            ILoggerFactory loggerFactory,
            ApplicationLayoutManager applicationLayoutManager,
            UserProvider userProvider,
            SubscriptionManager subscriptionManager,
            PageManager pageManager,
            VideoPlayWithQueueCommand videoPlayWithQueueCommand,
            PlaylistPlayAllCommand playlistPlayAllCommand,
            AddSubscriptionCommand addSubscriptionCommand,
            SelectionModeToggleCommand selectionModeToggleCommand
            )
            : base(loggerFactory.CreateLogger <UserVideoPageViewModel>())
        {
            SubscriptionManager      = subscriptionManager;
            ApplicationLayoutManager = applicationLayoutManager;
            UserProvider             = userProvider;
            PageManager = pageManager;
            VideoPlayWithQueueCommand  = videoPlayWithQueueCommand;
            PlaylistPlayAllCommand     = playlistPlayAllCommand;
            AddSubscriptionCommand     = addSubscriptionCommand;
            SelectionModeToggleCommand = selectionModeToggleCommand;
            UserInfo = new ReactiveProperty <UserInfoViewModel>();

            CurrentPlaylistToken = Observable.CombineLatest(
                this.ObserveProperty(x => x.UserVideoPlaylist),
                this.ObserveProperty(x => x.SelectedSortOption),
                (x, y) => new PlaylistToken(x, y)
                )
                                   .ToReadOnlyReactivePropertySlim()
                                   .AddTo(_CompositeDisposable);

            SelectedSortOption = UserVideoPlaylist.DefaultSortOption;
        }
コード例 #2
0
        public async Task <IActionResult> Create([FromBody] SubscriptionRequest model)
        {
            IPAddress ipAddress                 = HttpContext.Connection.RemoteIpAddress;
            AddSubscriptionCommand command      = new AddSubscriptionCommand(model, ipAddress);
            Subscription           subscription = await _mediator.Send(command);

            return(StatusCode(StatusCodes.Status201Created, new ApiResponse <dynamic>(new { subscription.UserId })));
        }
コード例 #3
0
 public VideoInfomationPageViewModel(
     ILoggerFactory loggerFactory,
     ApplicationLayoutManager applicationLayoutManager,
     AppearanceSettings appearanceSettings,
     VideoFilteringSettings ngSettings,
     NiconicoSession niconicoSession,
     LoginUserOwnedMylistManager userMylistManager,
     NicoVideoProvider nicoVideoProvider,
     LoginUserMylistProvider loginUserMylistProvider,
     SubscriptionManager subscriptionManager,
     NicoVideoSessionProvider nicoVideo,
     PageManager pageManager,
     Services.NotificationService notificationService,
     Services.DialogService dialogService,
     VideoPlayWithQueueCommand videoPlayWithQueueCommand,
     MylistAddItemCommand addMylistCommand,
     LocalPlaylistAddItemCommand localPlaylistAddItemCommand,
     AddSubscriptionCommand addSubscriptionCommand,
     OpenLinkCommand openLinkCommand,
     CopyToClipboardCommand copyToClipboardCommand,
     CopyToClipboardWithShareTextCommand copyToClipboardWithShareTextCommand,
     OpenShareUICommand openShareUICommand,
     CacheAddRequestCommand cacheAddRequestCommand,
     RecommendProvider recommendProvider,
     UserFollowProvider userFollowProvider,
     ChannelFollowProvider channelFollowProvider
     )
 {
     _logger = loggerFactory.CreateLogger <VideoInfomationPageViewModel>();
     ApplicationLayoutManager = applicationLayoutManager;
     AppearanceSettings       = appearanceSettings;
     NgSettings              = ngSettings;
     NiconicoSession         = niconicoSession;
     UserMylistManager       = userMylistManager;
     NicoVideoProvider       = nicoVideoProvider;
     LoginUserMylistProvider = loginUserMylistProvider;
     SubscriptionManager     = subscriptionManager;
     NicoVideo                           = nicoVideo;
     PageManager                         = pageManager;
     NotificationService                 = notificationService;
     DialogService                       = dialogService;
     VideoPlayWithQueueCommand           = videoPlayWithQueueCommand;
     AddMylistCommand                    = addMylistCommand;
     LocalPlaylistAddItemCommand         = localPlaylistAddItemCommand;
     AddSubscriptionCommand              = addSubscriptionCommand;
     OpenLinkCommand                     = openLinkCommand;
     CopyToClipboardCommand              = copyToClipboardCommand;
     CopyToClipboardWithShareTextCommand = copyToClipboardWithShareTextCommand;
     OpenShareUICommand                  = openShareUICommand;
     CacheAddRequestCommand              = cacheAddRequestCommand;
     _recommendProvider                  = recommendProvider;
     _userFollowProvider                 = userFollowProvider;
     _channelFollowProvider              = channelFollowProvider;
     NowLoading                          = new ReactiveProperty <bool>(false);
     IsLoadFailed                        = new ReactiveProperty <bool>(false);
 }
        public AddSubscriptionCommandHandlerTests()
        {
            _command = new AddSubscriptionCommand
            {
                ShowId   = ShowId,
                ShowName = ShowName
            };

            _subscriptionCommandDataSource = Substitute.For <ISubscriptionCommandDataSource>();
            _handler = new AddSubscriptionCommandHandler(_subscriptionCommandDataSource);
        }
コード例 #5
0
        public bool Add([FromBody] AddSubscriptionParameter addSubscriptionParameter)
        {
            var command = new AddSubscriptionCommand
            {
                ShowId   = addSubscriptionParameter.ShowId,
                ShowName = addSubscriptionParameter.showName
            };

            _commandSender.Send(command);

            return(true);
        }
コード例 #6
0
 public UserSeriesPageViewModel(
     SeriesProvider seriesRepository,
     UserProvider userProvider,
     PageManager pageManager,
     AddSubscriptionCommand addSubscriptionCommand
     )
 {
     _seriesProvider        = seriesRepository;
     _userProvider          = userProvider;
     _pageManager           = pageManager;
     AddSubscriptionCommand = addSubscriptionCommand;
 }
コード例 #7
0
        public InvestorActionViewModel(ITransferAgencyService investorService, IStaticReferences staticReferences, Fund fund)
        {
            // if _isNavFinal. disable the price and quantity box, which means amount is entered manually
            this._investorService = investorService;
            this._fund            = fund;
            _staticReferences     = staticReferences;
            _tradeDate            = DateExtentions.InitialDate();
            _settleDate           = DateExtentions.InitialDate();
            _lastLockedDate       = _staticReferences.GetMostRecentLockedDate(fund.FundId);

            _isNavFinal       = false;
            _TAType           = cmbIssueType[0]; // this defaults the type to subscription..
            _validationErrors = new ValidationErrors();
            _validationErrors.ErrorsChanged += ChangedErrorsEvents;
            // currency should be the funds base currency
            AddSubscriptionCommand         = new AddSubscriptionCommand(this, investorService);
            AddRedemptionCommand           = new AddRedemptionCommand(this, investorService);
            SelectedInvestorChangedCommand = new ActionCommand(ChangeInvestorHoldingCommand);
        }
コード例 #8
0
 public SeriesPageViewModel(
     ILoggerFactory loggerFactory,
     SeriesProvider seriesRepository,
     VideoPlayWithQueueCommand videoPlayWithQueueCommand,
     AddSubscriptionCommand addSubscriptionCommand,
     SelectionModeToggleCommand selectionModeToggleCommand,
     PlaylistPlayAllCommand playlistPlayAllCommand
     )
     : base(loggerFactory.CreateLogger <SeriesPageViewModel>())
 {
     _seriesProvider            = seriesRepository;
     VideoPlayWithQueueCommand  = videoPlayWithQueueCommand;
     AddSubscriptionCommand     = addSubscriptionCommand;
     SelectionModeToggleCommand = selectionModeToggleCommand;
     PlaylistPlayAllCommand     = playlistPlayAllCommand;
     CurrentPlaylistToken       = Observable.CombineLatest(
         this.ObserveProperty(x => x.SeriesVideoPlaylist),
         this.ObserveProperty(x => x.SelectedSortOption),
         (x, y) => new PlaylistToken(x, y)
         )
                                  .ToReadOnlyReactivePropertySlim()
                                  .AddTo(_CompositeDisposable);
 }
コード例 #9
0
        public async Task <ActionResult <Guid> > Create([FromBody] AddSubscriptionCommand command)
        {
            var id = await _mediator.Send(command);

            return(Ok(id));
        }
コード例 #10
0
 public AddSubscriptionCommandHandler(ApplicationDbContext dbContext, AddSubscriptionCommand command) : base(dbContext)
 {
     _command = command;
 }
コード例 #11
0
        public async Task <IActionResult> Subscribe([FromServices] SubscriptionCommandHandlerFactory commandHandlerFactory, [FromBody] AddSubscriptionCommand command)
        {
            command.AccountId = _userManager.GetUserId(User);
            var handler  = commandHandlerFactory.Build(command);
            var response = await handler.Execute();

            return(Ok());
        }
コード例 #12
0
        public MylistPageViewModel(
            ILoggerFactory loggerFactory,
            IMessenger messenger,
            ApplicationLayoutManager applicationLayoutManager,
            PageManager pageManager,
            NiconicoSession niconicoSession,
            MylistProvider mylistProvider,
            MylistFollowProvider mylistFollowProvider,
            UserProvider userProvider,
            LoginUserMylistProvider loginUserMylistProvider,
            LoginUserOwnedMylistManager userMylistManager,
            LocalMylistManager localMylistManager,
            MylistResolver mylistRepository,
            SubscriptionManager subscriptionManager,
            MylistUserSelectedSortRepository mylistUserSelectedSortRepository,
            Services.DialogService dialogService,
            AddSubscriptionCommand addSubscriptionCommand,
            SelectionModeToggleCommand selectionModeToggleCommand,
            PlaylistPlayAllCommand playlistPlayAllCommand,
            VideoPlayWithQueueCommand videoPlayWithQueueCommand
            )
        {
            _logger    = loggerFactory.CreateLogger <MylistPageViewModel>();
            _messenger = messenger;
            ApplicationLayoutManager = applicationLayoutManager;
            PageManager                       = pageManager;
            NiconicoSession                   = niconicoSession;
            MylistProvider                    = mylistProvider;
            _mylistFollowProvider             = mylistFollowProvider;
            UserProvider                      = userProvider;
            LoginUserMylistProvider           = loginUserMylistProvider;
            UserMylistManager                 = userMylistManager;
            LocalMylistManager                = localMylistManager;
            _mylistRepository                 = mylistRepository;
            SubscriptionManager               = subscriptionManager;
            _mylistUserSelectedSortRepository = mylistUserSelectedSortRepository;
            DialogService                     = dialogService;
            AddSubscriptionCommand            = addSubscriptionCommand;
            SelectionModeToggleCommand        = selectionModeToggleCommand;
            PlaylistPlayAllCommand            = playlistPlayAllCommand;
            VideoPlayWithQueueCommand         = videoPlayWithQueueCommand;
            Mylist = new ReactiveProperty <MylistPlaylist>();

            SelectedSortOptionItem = new ReactiveProperty <MylistPlaylistSortOption>(mode: ReactivePropertyMode.DistinctUntilChanged);

            CurrentPlaylistToken = Observable.CombineLatest(
                Mylist,
                SelectedSortOptionItem,
                (x, y) => new PlaylistToken(x, y)
                )
                                   .ToReadOnlyReactivePropertySlim()
                                   .AddTo(_CompositeDisposable);


            /*
             * IsFavoriteMylist = new ReactiveProperty<bool>(mode: ReactivePropertyMode.DistinctUntilChanged)
             *  .AddTo(_CompositeDisposable);
             * CanChangeFavoriteMylistState = new ReactiveProperty<bool>()
             *  .AddTo(_CompositeDisposable);
             *
             *
             * IsFavoriteMylist
             *  .Where(x => PlayableList.Value.Id != null)
             *  .Subscribe(async x =>
             *  {
             *      if (PlayableList.Value.Origin != PlaylistOrigin.OtherUser) { return; }
             *
             *      if (_NowProcessFavorite) { return; }
             *
             *      _NowProcessFavorite = true;
             *
             *      CanChangeFavoriteMylistState.Value = false;
             *      if (x)
             *      {
             *          if (await FavoriteMylist())
             *          {
             *              Debug.WriteLine(_MylistTitle + "のマイリストをお気に入り登録しました.");
             *          }
             *          else
             *          {
             *              // お気に入り登録に失敗した場合は状態を差し戻し
             *              Debug.WriteLine(_MylistTitle + "のマイリストをお気に入り登録に失敗");
             *              IsFavoriteMylist.Value = false;
             *          }
             *      }
             *      else
             *      {
             *          if (await UnfavoriteMylist())
             *          {
             *              Debug.WriteLine(_MylistTitle + "のマイリストをお気に入り解除しました.");
             *          }
             *          else
             *          {
             *              // お気に入り解除に失敗した場合は状態を差し戻し
             *              Debug.WriteLine(_MylistTitle + "のマイリストをお気に入り解除に失敗");
             *              IsFavoriteMylist.Value = true;
             *          }
             *      }
             *
             *      CanChangeFavoriteMylistState.Value =
             *          IsFavoriteMylist.Value == true
             || FollowManager.CanMoreAddFollow(FollowItemType.Mylist);
             ||
             ||
             ||     _NowProcessFavorite = false;
             || })
             || .AddTo(_CompositeDisposable);
             ||
             ||
             ||UnregistrationMylistCommand = SelectedItems.ObserveProperty(x => x.Count)
             || .Where(_ => IsUserOwnerdMylist)
             || .Select(x => x > 0)
             || .ToReactiveCommand(false);
             ||
             ||UnregistrationMylistCommand.Subscribe(async _ =>
             ||{
             || if (PlayableList.Value.Origin == PlaylistOrigin.Local)
             || {
             ||     var localMylist = PlayableList.Value as LegacyLocalMylist;
             ||     var items = SelectedItems.ToArray();
             ||
             ||     foreach (var item in items)
             ||     {
             ||         localMylist.Remove(item.PlaylistItem);
             ||         IncrementalLoadingItems.Remove(item);
             ||     }
             || }
             || else if (PlayableList.Value.Origin == PlaylistOrigin.LoginUser)
             || {
             ||     var mylistGroup = HohoemaApp.UserMylistManager.GetMylistGroup(PlayableList.Value.Id);
             ||
             ||     var items = SelectedItems.ToArray();
             ||
             ||
             ||     var action = AsyncInfo.Run<uint>(async (cancelToken, progress) =>
             ||     {
             ||         uint progressCount = 0;
             ||         int successCount = 0;
             ||         int failedCount = 0;
             ||
             ||         Debug.WriteLine($"マイリストに追加解除を開始...");
             ||         foreach (var video in items)
             ||         {
             ||             var unregistrationResult = await mylistGroup.Unregistration(
             ||                 video.RawVideoId
             ||                 , withRefresh: false );
             ||
             ||             if (unregistrationResult == ContentManageResult.Success)
             ||             {
             ||                 successCount++;
             ||             }
             ||             else
             ||             {
             ||                 failedCount++;
             ||             }
             ||
             ||             progressCount++;
             ||             progress.Report(progressCount);
             ||
             ||             Debug.WriteLine($"{video.Label}[{video.RawVideoId}]:{unregistrationResult.ToString()}");
             ||         }
             ||
             ||         // 登録解除結果を得るためリフレッシュ
             ||         await mylistGroup.Refresh();
             ||
             ||
             ||         // ユーザーに結果を通知
             ||         var titleText = $"「{mylistGroup.Label}」から {successCount}件 の動画が登録解除されました";
             ||         var toastService = Microsoft.Toolkit.Mvvm.DependencyInjection.Ioc.Default.GetService<NotificationService>();
             ||         var resultText = $"";
             ||         if (failedCount > 0)
             ||         {
             ||             resultText += $"\n登録解除に失敗した {failedCount}件 は選択されたままです";
             ||         }
             ||         toastService.ShowToast(titleText, resultText);
             ||
             ||         // 登録解除に失敗したアイテムだけを残すように
             ||         // マイリストから除外された動画を選択アイテムリストから削除
             ||         foreach (var item in SelectedItems.ToArray())
             ||         {
             ||             if (false == mylistGroup.CheckRegistratedVideoId(item.RawVideoId))
             ||             {
             ||                 SelectedItems.Remove(item);
             ||                 IncrementalLoadingItems.Remove(item);
             ||             }
             ||         }
             ||
             ||         Debug.WriteLine($"マイリストに追加解除完了---------------");
             ||     });
             ||
             ||     await PageManager.StartNoUIWork("マイリストに追加解除", items.Length, () => action);
             ||
             || }
             ||
             ||
             ||});
             ||
             ||
             */
        }
コード例 #13
0
        public IActionResult AddSubscription(int id, [FromBody] SubscriptionModel subscription)
        {
            var command = new AddSubscriptionCommand(id, subscription);

            return(ProcessCommand(command));
        }
コード例 #14
0
 public ICommandHandler <AddSubscriptionCommand, Task <CommandResponse> > Build(AddSubscriptionCommand command)
 {
     return(new AddSubscriptionCommandHandler(_context, command));
 }
コード例 #15
0
        public UserInfoPageViewModel(
            ApplicationLayoutManager applicationLayoutManager,
            UserProvider userProvider,
            UserFollowProvider userFollowProvider,
            VideoFilteringSettings ngSettings,
            NiconicoSession niconicoSession,
            SubscriptionManager subscriptionManager,
            LoginUserOwnedMylistManager userMylistManager,
            PageManager pageManager,
            MylistResolver mylistRepository,
            VideoPlayWithQueueCommand videoPlayWithQueueCommand,
            AddSubscriptionCommand addSubscriptionCommand,
            OpenLinkCommand openLinkCommand
            )
        {
            NiconicoSession           = niconicoSession;
            SubscriptionManager       = subscriptionManager;
            UserMylistManager         = userMylistManager;
            PageManager               = pageManager;
            _mylistRepository         = mylistRepository;
            VideoPlayWithQueueCommand = videoPlayWithQueueCommand;
            AddSubscriptionCommand    = addSubscriptionCommand;
            OpenLinkCommand           = openLinkCommand;
            ApplicationLayoutManager  = applicationLayoutManager;
            UserProvider              = userProvider;
            _userFollowProvider       = userFollowProvider;
            NgSettings = ngSettings;

            HasOwnerVideo = true;

            VideoInfoItems = new ObservableCollection <VideoListItemControlViewModel>();

            OpenUserVideoPageCommand = VideoInfoItems.ObserveProperty(x => x.Count)
                                       .Select(x => x > 0)
                                       .ToReactiveCommand()
                                       .AddTo(_CompositeDisposable);

            OpenUserVideoPageCommand.Subscribe(x =>
            {
                PageManager.OpenPageWithId(HohoemaPageType.UserVideo, UserId);
            })
            .AddTo(_CompositeDisposable);

            IsNGVideoOwner = new ReactiveProperty <bool>(false, ReactivePropertyMode.DistinctUntilChanged);

            IsNGVideoOwner.Subscribe(isNgVideoOwner =>
            {
                if (isNgVideoOwner)
                {
                    NgSettings.AddHiddenVideoOwnerId(UserId, Nickname);
                    IsNGVideoOwner.Value = true;
                    Debug.WriteLine(Nickname + "をNG動画投稿者として登録しました。");
                }
                else
                {
                    NgSettings.RemoveHiddenVideoOwnerId(UserId);
                    IsNGVideoOwner.Value = false;
                    Debug.WriteLine(Nickname + "をNG動画投稿者の指定を解除しました。");
                }
            });
        }
コード例 #16
0
        public VideoPlayerPageViewModel(
            ILoggerFactory loggerFactory,
            IScheduler scheduler,
            IPlayerView playerView,
            NiconicoSession niconicoSession,
            SubscriptionManager subscriptionManager,
            NicoVideoProvider nicoVideoProvider,
            ChannelProvider channelProvider,
            MylistProvider mylistProvider,
            AppearanceSettings appearanceSettings,
            PlayerSettings playerSettings,
            VideoCacheSettings_Legacy cacheSettings,
            ApplicationLayoutManager applicationLayoutManager,
            LocalMylistManager localMylistManager,
            LoginUserOwnedMylistManager userMylistManager,
            PageManager pageManager,
            QueuePlaylist queuePlaylist,
            HohoemaPlaylistPlayer hohoemaPlaylistPlayer,
            MediaPlayer mediaPlayer,
            VideoTogglePlayPauseCommand videoTogglePlayPauseCommand,
            NotificationService notificationService,
            DialogService dialogService,
            AddSubscriptionCommand addSubscriptionCommand,
            LocalPlaylistCreateCommand createLocalMylistCommand,
            MylistAddItemCommand addMylistCommand,
            LocalPlaylistAddItemCommand localPlaylistAddItemCommand,
            MylistCreateCommand createMylistCommand,
            VideoStreamingOriginOrchestrator videoStreamingOriginOrchestrator,
            VideoCommentPlayer commentPlayer,
            CommentCommandEditerViewModel commentCommandEditerViewModel,
            KeepActiveDisplayWhenPlaying keepActiveDisplayWhenPlaying,
            ObservableMediaPlayer observableMediaPlayer,
            VideoEndedRecommendation videoEndedRecommendation,
            PrimaryViewPlayerManager primaryViewPlayerManager,
            TogglePlayerDisplayViewCommand togglePlayerDisplayViewCommand,
            ShowPrimaryViewCommand showPrimaryViewCommand,
            MediaPlayerSoundVolumeManager soundVolumeManager,
            OpenLinkCommand openLinkCommand,
            CopyToClipboardCommand copyToClipboardCommand,
            ChangeVideoQualityCommand changeVideoQualityCommand,
            CopyToClipboardWithShareTextCommand copyToClipboardWithShareTextCommand,
            OpenShareUICommand openShareUICommand,
            PlaylistSidePaneContentViewModel playlistSidePaneContentViewModel,
            SettingsSidePaneContentViewModel settingsSidePaneContentViewModel,
            VideoCommentSidePaneContentViewModel videoCommentSidePaneContent,
            RelatedVideosSidePaneContentViewModel relatedVideosSidePaneContentViewModel
            )
        {
            _logger = loggerFactory.CreateLogger <VideoPlayerPageViewModel>();
            CurrentPlayerDisplayView = appearanceSettings
                                       .ObserveProperty(x => x.PlayerDisplayView)
                                       .ToReadOnlyReactivePropertySlim()
                                       .AddTo(_CompositeDisposable);

            _scheduler                             = scheduler;
            PlayerView                             = playerView;
            NiconicoSession                        = niconicoSession;
            SubscriptionManager                    = subscriptionManager;
            NicoVideoProvider                      = nicoVideoProvider;
            ChannelProvider                        = channelProvider;
            MylistProvider                         = mylistProvider;
            PlayerSettings                         = playerSettings;
            CacheSettings                          = cacheSettings;
            ApplicationLayoutManager               = applicationLayoutManager;
            LocalMylistManager                     = localMylistManager;
            UserMylistManager                      = userMylistManager;
            PageManager                            = pageManager;
            _queuePlaylist                         = queuePlaylist;
            _hohoemaPlaylistPlayer                 = hohoemaPlaylistPlayer;
            _NotificationService                   = notificationService;
            _HohoemaDialogService                  = dialogService;
            AddSubscriptionCommand                 = addSubscriptionCommand;
            CreateLocalMylistCommand               = createLocalMylistCommand;
            AddMylistCommand                       = addMylistCommand;
            LocalPlaylistAddItemCommand            = localPlaylistAddItemCommand;
            CreateMylistCommand                    = createMylistCommand;
            _videoStreamingOriginOrchestrator      = videoStreamingOriginOrchestrator;
            CommentPlayer                          = commentPlayer;
            CommentCommandEditerViewModel          = commentCommandEditerViewModel;
            PrimaryViewPlayerManager               = primaryViewPlayerManager;
            TogglePlayerDisplayViewCommand         = togglePlayerDisplayViewCommand;
            ShowPrimaryViewCommand                 = showPrimaryViewCommand;
            SoundVolumeManager                     = soundVolumeManager;
            OpenLinkCommand                        = openLinkCommand;
            CopyToClipboardCommand                 = copyToClipboardCommand;
            ChangeVideoQualityCommand              = changeVideoQualityCommand;
            CopyToClipboardWithShareTextCommand    = copyToClipboardWithShareTextCommand;
            OpenShareUICommand                     = openShareUICommand;
            _playlistSidePaneContentViewModel      = playlistSidePaneContentViewModel;
            _settingsSidePaneContentViewModel      = settingsSidePaneContentViewModel;
            _videoCommentSidePaneContentViewModel  = videoCommentSidePaneContent;
            _relatedVideosSidePaneContentViewModel = relatedVideosSidePaneContentViewModel;
            ObservableMediaPlayer                  = observableMediaPlayer
                                                     .AddTo(_CompositeDisposable);
            VideoEndedRecommendation = videoEndedRecommendation
                                       .AddTo(_CompositeDisposable);
            _keepActiveDisplayWhenPlaying = keepActiveDisplayWhenPlaying
                                            .AddTo(_CompositeDisposable);
            MediaPlayer = mediaPlayer;
            VideoTogglePlayPauseCommand = videoTogglePlayPauseCommand;
            SeekCommand            = new MediaPlayerSeekCommand(MediaPlayer);
            SetPlaybackRateCommand = new MediaPlayerSetPlaybackRateCommand(MediaPlayer);
            ToggleMuteCommand      = new MediaPlayerToggleMuteCommand(MediaPlayer);
            VolumeUpCommand        = new MediaPlayerVolumeUpCommand(SoundVolumeManager);
            VolumeDownCommand      = new MediaPlayerVolumeDownCommand(SoundVolumeManager);

            PlayNextCommand = _hohoemaPlaylistPlayer.GetCanGoNextOrPreviewObservable()
                              .SelectMany(async x => await _hohoemaPlaylistPlayer.CanGoNextAsync())
                              .ToAsyncReactiveCommand()
                              .AddTo(_CompositeDisposable);

            PlayNextCommand.Subscribe(async() => await _hohoemaPlaylistPlayer.GoNextAsync(NavigationCancellationToken))
            .AddTo(_CompositeDisposable);

            PlayPreviousCommand = _hohoemaPlaylistPlayer.GetCanGoNextOrPreviewObservable()
                                  .SelectMany(async x => await _hohoemaPlaylistPlayer.CanGoPreviewAsync())
                                  .ToAsyncReactiveCommand()
                                  .AddTo(_CompositeDisposable);

            PlayPreviousCommand.Subscribe(async() => await _hohoemaPlaylistPlayer.GoPreviewAsync(NavigationCancellationToken))
            .AddTo(_CompositeDisposable);

            IsLoopingEnabled = PlayerSettings.ToReactivePropertyAsSynchronized(x => x.IsCurrentVideoLoopingEnabled, raiseEventScheduler: scheduler)
                               .AddTo(_CompositeDisposable);
            IsLoopingEnabled.Subscribe(x => mediaPlayer.IsLoopingEnabled = x)
            .AddTo(_CompositeDisposable);

            IsPlaylistShuffleRequeted = PlayerSettings.ToReactivePropertyAsSynchronized(x => x.IsShuffleEnable, _scheduler)
                                        .AddTo(_CompositeDisposable);

            IsAvailablePlaylistRepeatOrShuffle = _hohoemaPlaylistPlayer.ObserveProperty(x => x.IsShuffleAndRepeatAvailable)
                                                 .ToReadOnlyReactiveProperty();
        }