示例#1
0
        protected async override void OnNavigatedTo(NavigationEventArgs e)
        {
            App.Current.Suspending   += Current_Suspending;
            App.Current.Resuming     += Current_Resuming;
            Window.Current.Activated += Current_Activated;

            //get the HLS plugin from the PF player
            _hlsplugin = mePlayer.Plugins.FirstOrDefault(p => p is HLSPlugin) as HLSPlugin;
            _hlsplugin.ClosedCaptionType = ClosedCaptionType.CC608Instream;
            //get the controller factory
            _controllerFactory = _hlsplugin.ControllerFactory;
            //subscribe to HLSControllerReady
            _controllerFactory.HLSControllerReady += _controllerFactory_HLSControllerReady;

            _timerPlaybackControlDisplay.Tick += _timerPlaybackControlDisplay_Tick;

            _settingsData.PropertyChanged += _settingsData_PropertyChanged;


            ucHLSSettings.DataContext = _settingsData;

            btnFavorites_Click(null, null);

            _windowRect = ApplicationView.GetForCurrentView().VisibleBounds;
            _settingsData.MaximumBitrate = CalcMaxBitrate();
            ////await the background task
            await StartBackgroundTask();
        }
示例#2
0
        public PlayerPage()
        {
            this.InitializeComponent();
            this._StatsTimer = new DispatcherTimer()
            {
                Interval = TimeSpan.FromSeconds(5)
            };
            this._StatsTimer.Tick += StatsTimer_Tick;

            var plugin = this.Player.Plugins.FirstOrDefault(p => typeof(HLSPlugin) == p.GetType());

            if (null != plugin)
            {
                this._HLSPlugin = plugin as HLSPlugin;
                this.WireHLSPluginHandlers();
            }
        }