Пример #1
0
        private async void SelectContent(DetailContentData data)
        {
            UpdateContentInfo();
            await ContentSelected(data);

            (BindingContext as ContentListPageViewModel)?.ActivateCommand.Execute(null);
        }
Пример #2
0
        public PlayerViewModel(DetailContentData data, IDialogService dialog)
        {
            _contentData = data;
            _dialog      = dialog;
            Player       = DependencyService.Get <IPlayerService>(DependencyFetchTarget.NewInstance);

            _subscriptions = new CompositeDisposable
            {
                Player.StateChanged()
                .ObserveOn(SynchronizationContext.Current)
                .Subscribe(OnPlayerStateChanged, OnPlayerCompleted),

                Player.PlaybackError()
                .ObserveOn(SynchronizationContext.Current)
                .Subscribe(async message => await OnPlaybackError(message)),

                Player.BufferingProgress()
                .ObserveOn(SynchronizationContext.Current)
                .Subscribe(OnBufferingProgress)
            };

            InitializeSeekPreview();
            SetSource(_contentData.Clip as ClipDefinition);

            Device.StartTimer(UpdateInterval, UpdatePlayerControl);
        }
Пример #3
0
        private Task ContentSelected(DetailContentData data)
        {
            var playerView = new PlayerView
            {
                BindingContext = new PlayerViewModel(data, new DialogService())
            };

            return(_appMainPage.PushAsync(playerView));
        }
Пример #4
0
        public void SetFocusedContent(DetailContentData contentData)
        {
            var index = (_genGrid.ItemsSource as IEnumerable <DetailContentData>).ToList().IndexOf(contentData);

            if (index == -1)
            {
                return;
            }
            var newContent = (ContentItem)_genGrid.Items[index];

            SwapFocusedContent(newContent);
        }
Пример #5
0
        public ContentListPageViewModel()
        {
            ICommand ContentFocusedCommand = CreateFocusedCommand();

            ContentList = new List <DetailContentData>();
            DetailContentData content;

            content                       = new DetailContentData();
            content.Title                 = "Big Buck Bunny";
            content.Description           = "Big Buck Bunny is a comedy about a well-tempered rabbit Big Buck, who finds his day spoiled by the rude actions of the forest bullies, three rodents.In the typical 1950s cartoon tradition, BigBuck then prepares for the rodents in a comical revenge.";
            content.Image                 = "img_1_b.jpg";
            content.Bg                    = "img_1_a.jpg";
            content.Source                = "https://goo.gl/ZVKLVF";
            content.ContentFocusedCommand = ContentFocusedCommand;
            ContentList.Add(content);

            content                       = new DetailContentData();
            content.Title                 = "Monkaa";
            content.Description           = "Monkaa is a blue-furred, pink-faced monkey who consumes a crystallized meteorite, making him invincibly strong and too hot to handle. Exploring his new superpowers, Monkaa zooms through an entire universe.";
            content.Image                 = "img_3_b.jpg";
            content.Bg                    = "img_3_a.jpg";
            content.Source                = "https://goo.gl/kJZq2i";
            content.ContentFocusedCommand = ContentFocusedCommand;
            ContentList.Add(content);

            content                       = new DetailContentData();
            content.Title                 = "Caminandes: Llamigos";
            content.Description           = "In this episode of the Caminandes cartoon series we learn to know our hero Koro even better! It's winter in Patagonia, food is getting scarce. Koro the Llama engages with Oti the pesky penguin in an epic fight over that last tasty berry.";
            content.Image                 = "img_2_b.jpg";
            content.Bg                    = "img_2_a.jpg";
            content.Source                = "https://goo.gl/uMXgLH";
            content.ContentFocusedCommand = ContentFocusedCommand;
            ContentList.Add(content);

            content                       = new DetailContentData();
            content.Title                 = "Caminandes: Gran Dillama";
            content.Description           = "Some llamas have no luck. Inspired by the good old Chuck Jones cartoons, this series of shorts follows the misadventures of one particularly persistent llama - Koro - as he hunts for the good life on the other side of the street. Or fence.";
            content.Image                 = "img_7_b.jpg";
            content.Bg                    = "img_7_a.jpg";
            content.Source                = "https://goo.gl/ndrjju";
            content.ContentFocusedCommand = ContentFocusedCommand;
            ContentList.Add(content);

            content                       = new DetailContentData();
            content.Title                 = "Sintel";
            content.Description           = "The film follows a girl named Sintel who is searching for a baby dragon she calls Scales. A flashback reveals that Sintel found Scales with its wing injured and helped care for it, forming a close bond with it. By the time its wing recovered and it was able to fly, Scales was caught by an adult dragon.";
            content.Image                 = "img_4_b.jpg";
            content.Bg                    = "img_4_a.jpg";
            content.Source                = "https://goo.gl/FnjkmB";
            content.ContentFocusedCommand = ContentFocusedCommand;
            ContentList.Add(content);
        }