Пример #1
0
        public PlayerServiceImpl(Window window)
        {
            dataProviders = new DataProviderFactoryManager();
            dataProviders.RegisterDataProviderFactory(new DashDataProviderFactory());
            dataProviders.RegisterDataProviderFactory(new HLSDataProviderFactory());
            dataProviders.RegisterDataProviderFactory(new RTSPDataProviderFactory());

            var drmManager = new DrmManager();

            drmManager.RegisterDrmHandler(new CencHandler());

            if (window == null)
            {
                window = WindowUtils.CreateElmSharpWindow();
            }
            var player = new EsPlayer(window);

            playerController = new PlayerController(player, drmManager);

            subscriptions = new CompositeDisposable
            {
                playerController.StateChanged()
                .Subscribe(state => { State = state; }, SynchronizationContext.Current)
            };
        }
Пример #2
0
        private void CreatePlayerController()
        {
            if (playerWindow == null)
            {
                playerWindow = WindowUtils.CreateElmSharpWindow();
            }
            var player = new EsPlayer(playerWindow);

            playerController = new PlayerController(player, drmManager);
        }
Пример #3
0
        private void CreatePlayerController()
        {
            if (playerWindow == null)
            {
                playerWindow = WindowUtils.CreateElmSharpWindow();
            }
            var player = new EsPlayer(playerWindow);

            playerController = new PlayerController(player, drmManager);

            subscriptions = new CompositeDisposable
            {
                playerController.StateChanged()
                .Subscribe(state =>
                {
                    State = state;
                    stateChangedSubject.OnNext(state);
                }, () => stateChangedSubject.OnCompleted(), SynchronizationContext.Current),
                playerController.PlaybackError()
                .Subscribe(playbackErrorSubject.OnNext, SynchronizationContext.Current),
                playerController.BufferingProgress()
                .Subscribe(bufferingProgressSubject.OnNext, SynchronizationContext.Current)
            };
        }