コード例 #1
0
 public void Stop()
 {
     if (PlayerState != MediaState.Ended && PlayerState != MediaState.NothingSpecial)
     {
         _mediaPlayer.stop();
     }
     TileHelper.ClearTile();
 }
コード例 #2
0
        public void Stop()
        {
            _currentAudioTrack = -1;
            _currentSubtitle   = -1;

            _audioTracks.Clear();
            _subtitlesTracks.Clear();

            if (PlayerState != MediaState.Ended && PlayerState != MediaState.NothingSpecial)
            {
                _mediaService.Stop();
            }
            TileHelper.ClearTile();
        }
コード例 #3
0
        private async void OnEndReached()
        {
            Playback_MediaEndReached?.Invoke();
            TileHelper.ClearTile();
            PlayerState = MediaState.Ended;
            if (!CanGoNext())
            {
                // Playlist is finished
                if (Repeat)
                {
                    // ... One More Time!
                    await StartAgain();

                    return;
                }
                PlayingType = PlayingType.NotPlaying;
                IsRunning   = false;
            }
            else
            {
                await PlayNext();
            }
        }
コード例 #4
0
        public void Stop()
        {
            _mediaService.MediaFailed   -= MediaFailed;
            _mediaService.StatusChanged -= PlayerStateChanged;
            _mediaService.TimeChanged   -= UpdateTime;

            _mediaService.OnLengthChanged -= OnLengthChanged;
            _mediaService.OnStopped       -= OnStopped;
            _mediaService.OnEndReached    -= OnEndReached;
            _mediaService.OnBuffering     -= OnBuffering;


            _currentAudioTrack = -1;
            _currentSubtitle   = -1;

            _audioTracks.Clear();
            _subtitlesTracks.Clear();

            if (PlayerState != MediaState.Ended && PlayerState != MediaState.NothingSpecial)
            {
                _mediaService.Stop();
            }
            TileHelper.ClearTile();
        }
コード例 #5
0
 private void OnEndReached()
 {
     Playback_MediaEndReached?.Invoke();
     TileHelper.ClearTile();
     PlayerState = MediaState.Ended;
 }
コード例 #6
0
        public override void OnStart(StartKind startKind, IActivatedEventArgs args)
        {
            var launchArgs = ExtractArgumentsString(args);

            if (launchArgs != null)
            {
                Logger.Info("Launch args: " + launchArgs);
                LaunchArgs = launchArgs.ParseQueryString();
            }

            DispatcherHelper.Initialize();
            LicenseHelper.Instance.Initialize();

            if (!string.IsNullOrEmpty(ApplicationLanguages.PrimaryLanguageOverride))
            {
                ServiceLocator.Vkontakte.Language = ApplicationLanguages.PrimaryLanguageOverride;
            }

            if (startKind == StartKind.Activate && args.PreviousExecutionState == ApplicationExecutionState.Running)
            {
                Window.Current.Activate();

                if (LaunchArgs != null && LaunchArgs.ContainsKey("uid"))
                {
                    long uid = long.Parse(LaunchArgs["uid"]);

                    Messenger.Default.Send(new GoToDialogMessage()
                    {
                        UserId = uid
                    });
                }
            }
            else
            {
                Logger.AppStart();

                var appView = ApplicationView.GetForCurrentView();
                //appView.TitleBar.BackgroundColor = ((SolidColorBrush)Resources["ConversationOutboxMessageForegroundBrush"]).Color;
                //appView.TitleBar.InactiveBackgroundColor = Colors.Transparent;//appView.TitleBar.BackgroundColor;
                var c  = this.RequestedTheme == ApplicationTheme.Light ? Colors.White : Colors.Black;
                var cf = this.RequestedTheme == ApplicationTheme.Light ? Colors.Black : Colors.White;
                appView.TitleBar.ButtonBackgroundColor         = Color.FromArgb(0, c.R, c.G, c.B); //appView.TitleBar.BackgroundColor;
                appView.TitleBar.ButtonInactiveBackgroundColor = appView.TitleBar.ButtonBackgroundColor;
                appView.TitleBar.ButtonForegroundColor         = cf;
                //appView.TitleBar.ButtonInactiveBackgroundColor = Colors.Transparent;//appView.TitleBar.BackgroundColor;
                //appView.TitleBar.ForegroundColor = Colors.White;

                CoreApplication.GetCurrentView().TitleBar.ExtendViewIntoTitleBar = true;

                if (AppSettings.AccessToken == null || AppSettings.AccessToken.HasExpired)
                {
                    NavigationService.Navigate(typeof(LoginView));
                }
                else
                {
                    ServiceLocator.Vkontakte.AccessToken = AppSettings.AccessToken;
                    NavigationService.Navigate(typeof(MainPage));
                }
            }

            TileHelper.ClearTile();
        }