public void BuildRenderers(MvxVideoPlayer player)
        {
            var allocator = new DefaultAllocator(BufferSegmentSize);


            // Build the video and audio renderers.
            var bandwidthMeter = new DefaultBandwidthMeter(player.MainHandler, null);
            var dataSource     = new DefaultUriDataSource(_context, bandwidthMeter, _userAgent);
            var sampleSource   = new ExtractorSampleSource(_uri, dataSource, allocator,
                                                           BufferSegmentCount * BufferSegmentSize);
            var videoRenderer = new MediaCodecVideoTrackRenderer(_context,
                                                                 sampleSource, MediaCodecSelector.Default, (int)VideoScalingMode.ScaleToFit, 5000, player.MainHandler,
                                                                 player, 50);
            var audioRenderer = new MediaCodecAudioTrackRenderer(sampleSource,
                                                                 MediaCodecSelector.Default, null, true, player.MainHandler, player, AudioCapabilities.GetCapabilities(_context), (int)Stream.Music);
            var textRenderer = new TextTrackRenderer(sampleSource, player,
                                                     player.MainHandler.Looper);

            // Invoke the callback.
            var renderers = new TrackRenderer[MvxVideoPlayer.RendererCount];

            renderers[MvxVideoPlayer.TypeVideo] = videoRenderer;
            renderers[MvxVideoPlayer.TypeAudio] = audioRenderer;
            renderers[MvxVideoPlayer.TypeText]  = textRenderer;
            player.OnRenderers(renderers, bandwidthMeter);
        }
Пример #2
0
            public AsyncRendererBuilder(Context context, string userAgent, string url, MvxVideoPlayer player)
            {
                _context   = context;
                _userAgent = userAgent;
                _url       = url;
                _player    = player;
                var parser = new HlsPlaylistParser();

                _playlistFetcher = new ManifestFetcher(url, new DefaultUriDataSource(context, userAgent),
                                                       parser);
            }
        public void BuildRenderers(MvxVideoPlayer player)
        {
            var allocator = new DefaultAllocator(BufferSegmentSize);

            // Build the video and audio renderers.
            var bandwidthMeter = new DefaultBandwidthMeter(player.MainHandler, null);
            var dataSource = new DefaultUriDataSource(_context, bandwidthMeter, _userAgent);
            var sampleSource = new ExtractorSampleSource(_uri, dataSource, allocator,
                BufferSegmentCount*BufferSegmentSize);
            var videoRenderer = new MediaCodecVideoTrackRenderer(_context,
                sampleSource, MediaCodecSelector.Default, (int) VideoScalingMode.ScaleToFit, 5000, player.MainHandler,
                player, 50);
            var audioRenderer = new MediaCodecAudioTrackRenderer(sampleSource,
                MediaCodecSelector.Default, null, true, player.MainHandler, player, AudioCapabilities.GetCapabilities(_context), (int) Stream.Music);
            var textRenderer = new TextTrackRenderer(sampleSource, player,
                player.MainHandler.Looper);

            // Invoke the callback.
            var renderers = new TrackRenderer[MvxVideoPlayer.RendererCount];
            renderers[MvxVideoPlayer.TypeVideo] = videoRenderer;
            renderers[MvxVideoPlayer.TypeAudio] = audioRenderer;
            renderers[MvxVideoPlayer.TypeText] = textRenderer;
            player.OnRenderers(renderers, bandwidthMeter);
        }
Пример #4
0
 public void BuildRenderers(MvxVideoPlayer player)
 {
     _currentAsyncBuilder = new AsyncRendererBuilder(_context, _userAgent, _url, player);
     _currentAsyncBuilder.Init();
 }
 public void BuildRenderers(MvxVideoPlayer player)
 {
     _currentAsyncBuilder = new AsyncRendererBuilder(_context, _userAgent, _url, player);
     _currentAsyncBuilder.Init();
 }
 public AsyncRendererBuilder(Context context, string userAgent, string url, MvxVideoPlayer player)
 {
     _context = context;
     _userAgent = userAgent;
     _url = url;
     _player = player;
     var parser = new HlsPlaylistParser();
     _playlistFetcher = new ManifestFetcher(url, new DefaultUriDataSource(context, userAgent),
         parser);
 }