public OnlinePlayerView()
        {
            InitializeComponent();
            m_ViewModel = new OnlinePlayerViewModel(new AnalyticsService(), StorageService.Current(), ApiService.Current())
            {
                ChangeVolumeHandler       = ChangeVolumeHandler,
                ChangePlayback            = ChangePlaybackHandler,
                ChangePosition            = ChangePosition,
                ScrollToSelectedPlaylist  = ScrollToSelectedItemInPlaylist,
                SetVisiblePlaybackButtons = SetVisiblePlaybackButtons,
                ChangeOpenPlaylistButton  = ChangeOpenPlaylistButton
            };
            DataContext = m_ViewModel;
            OnlinePlayer.MediaPlayer.MediaOpened         += MediaPlayer_MediaOpened;
            OnlinePlayer.MediaPlayer.MediaFailed         += MediaPlayer_MediaFailed;
            OnlinePlayer.MediaPlayer.MediaEnded          += MediaPlayer_MediaEnded;
            OnlinePlayer.MediaPlayer.SourceChanged       += MediaPlayer_SourceChanged;
            OnlinePlayer.MediaPlayer.BufferingStarted    += MediaPlayer_BufferingStarted;
            OnlinePlayer.MediaPlayer.BufferingEnded      += MediaPlayer_BufferingEnded;
            OnlinePlayer.MediaPlayer.CurrentStateChanged += MediaPlayer_CurrentStateChanged;
            OnlinePlayer.MediaPlayer.VolumeChanged       += MediaPlayer_VolumeChanged;
            OnlinePlayer.TransportControls.IsFastForwardButtonVisible = true;
            OnlinePlayer.TransportControls.IsFastForwardEnabled       = true;
            OnlinePlayer.TransportControls.IsFastRewindButtonVisible  = true;
            OnlinePlayer.TransportControls.IsFastRewindEnabled        = true;
            //OnlinePlayer.TransportControls.IsPlaybackRateButtonVisible = true;
            //OnlinePlayer.TransportControls.IsPlaybackRateEnabled = true;
            OnlinePlayer.TransportControls.IsSkipBackwardButtonVisible = true;
            OnlinePlayer.TransportControls.IsSkipBackwardEnabled       = true;
            OnlinePlayer.TransportControls.IsSkipForwardButtonVisible  = true;
            OnlinePlayer.TransportControls.IsSkipForwardEnabled        = true;
            OnlinePlayer.TransportControls.IsZoomButtonVisible         = true;
            OnlinePlayer.TransportControls.IsZoomEnabled             = true;
            OnlinePlayer.TransportControls.IsFullWindowEnabled       = false;
            OnlinePlayer.TransportControls.IsFullWindowButtonVisible = false;

            RunTimer();

            Loaded   += OnlinePlayerView_Loaded;
            Unloaded += OnlinePlayerView_Unloaded;

            if (SystemService.GetDeviceFamilyType() != DeviceFamilyType.Xbox)
            {
                castingPicker = new CastingDevicePicker();
                castingPicker.Filter.SupportsVideo = true;
                castingPicker.Filter.SupportedCastingSources.Add(OnlinePlayer.MediaPlayer.GetAsCastingSource());
                castingPicker.CastingDeviceSelected += CastingPicker_CastingDeviceSelected;
            }
            else
            {
                m_GamepadTimer       = new DispatcherTimer();
                m_GamepadTimer.Tick += GamepadTimer_Tick;
                m_GamepadTimer.Start();
                m_isXbox           = true;
                m_ViewModel.IsXbox = true;
            }

            Window.Current.CoreWindow.KeyUp        += GlobalKeyUpHandler;
            Window.Current.CoreWindow.PointerMoved += CoreWindow_PointerMoved;
        }