Exemplo n.º 1
0
        private void InitVideoRenderingMethod()
        {
            _videoElement?.UnsubscribeEvents();

            switch (_optionsService.RenderingMethod)
            {
            case RenderingMethod.Ffmpeg:
                _videoElement = new MediaElementUnoSquare(VideoElementFfmpeg);
                break;

            case RenderingMethod.MediaFoundation:
                _videoElement = new MediaElementMediaFoundation(VideoElementMediaFoundation, _optionsService);
                break;

            default:
                throw new NotImplementedException();
            }

            _currentRenderingMethod = _optionsService.RenderingMethod;

            if (_videoDisplayManager != null)
            {
                UnsubscribeVideoEvents();
                _videoDisplayManager.Dispose();
            }

            _videoDisplayManager = new VideoDisplayManager(_videoElement, SubtitleBlock, _optionsService);

            SubscribeVideoEvents();
        }
Exemplo n.º 2
0
        public MediaWindow(IOptionsService optionsService, ISnackbarService snackbarService)
        {
            InitializeComponent();

            _optionsService = optionsService;

            _imageDisplayManager = new ImageDisplayManager(Image1Element, Image2Element, _optionsService);

            _snackbarService = snackbarService;

            _videoDisplayManager = new VideoDisplayManager(new MediaElementUnoSquare(VideoElement));

            SubscribeEvents();
        }
Exemplo n.º 3
0
        public MediaWindow(IOptionsService optionsService, ISnackbarService snackbarService)
        {
            InitializeComponent();

            _optionsService = optionsService;
            _optionsService.ShowSubtitlesChangedEvent += HandleShowSubtitlesChangedEvent;

            _imageDisplayManager = new ImageDisplayManager(Image1Element, Image2Element, _optionsService);
            _imageDisplayManager.MediaChangeEvent += HandleMediaChangeEventForImages;

            _snackbarService = snackbarService;

            _videoDisplayManager = new VideoDisplayManager(VideoElement);
            _videoDisplayManager.MediaChangeEvent          += HandleMediaChangeEventForVideoAndAudio;
            _videoDisplayManager.MediaPositionChangedEvent += HandleMediaPositionChangedEvent;
        }