public void OnSingleManifest(Object obj) { var manifest = obj.JavaCast <HlsPlaylist>(); if (_canceled) { return; } var mainHandler = _player.MainHandler; var loadControl = new DefaultLoadControl(new DefaultAllocator(BufferSegmentSize)); var bandwidthMeter = new DefaultBandwidthMeter(); var timestampAdjusterProvider = new PtsTimestampAdjusterProvider(); var dataSource = new DefaultUriDataSource(_context, bandwidthMeter, _userAgent); var chunkSource = new HlsChunkSource( true, dataSource, manifest, DefaultHlsTrackSelector.NewDefaultInstance(_context), bandwidthMeter, timestampAdjusterProvider, HlsChunkSource.AdaptiveModeSplice); var sampleSource = new HlsSampleSource(chunkSource , loadControl , BufferSegments * BufferSegmentSize , mainHandler , _player , MvxVideoPlayer.TypeVideo); var videoRenderer = new MediaCodecVideoTrackRenderer(_context , sampleSource , MediaCodecSelector.Default , (int)VideoScalingMode.ScaleToFit , 5000 , mainHandler , _player , 50); var audioRenderer = new MediaCodecAudioTrackRenderer(sampleSource , MediaCodecSelector.Default , null , true , _player.MainHandler , _player , AudioCapabilities.GetCapabilities(_context) , (int)Stream.Music); // TODO: The Id3Parser is currently not part of the binding //MetadataTrackRenderer id3Renderer = new MetadataTrackRenderer(sampleSource, new Id3Parser(), player, mainHandler.getLooper()); var closedCaptionRenderer = new Eia608TrackRenderer(sampleSource, _player, mainHandler.Looper); var renderers = new TrackRenderer[MvxVideoPlayer.RendererCount]; renderers[MvxVideoPlayer.TypeVideo] = videoRenderer; renderers[MvxVideoPlayer.TypeAudio] = audioRenderer; //renderers[DemoPlayer.TYPE_METADATA] = id3Renderer; renderers[MvxVideoPlayer.TypeText] = closedCaptionRenderer; _player.OnRenderers(renderers, bandwidthMeter); }
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); }
public TrackActor(Game game, string colHullPath, TrackRenderer renderer, Matrix worldMat) : base(game) { this.renderer = renderer; this.colHullPath = colHullPath; this.worldMatrix = worldMat; }
public GLTrack() { Camera = new Camera(); _renderer = new TrackRenderer(); _sceneryrenderer = new SceneryRenderer(); _track = new Track(); _track.RiderState.Reset(new Vector2d(0, 0), _track); }
public void Prepare() { if (_rendererBuildingState == RendererBuildingStateBuilt) { _player.Stop(); } _rendererBuilder.Cancel(); _videoFormat = null; _videoRenderer = null; _rendererBuildingState = RendererBuildingStateBuilding; MaybeReportPlayerState(); _rendererBuilder.BuildRenderers(this); }
/// <summary> /// Invoked with the results from a <see cref="IRendererBuilder"/>. /// </summary> /// <param name="renderers">Renderers indexed by <see cref="MvxVideoPlayer"/>. TYPE_* constants. An individual element may be null if there do not exist tracks of the corresponding type.</param> /// <param name="bandwidthMeter">Provides an estimate of the currently available bandwidth. May be null.</param> internal void OnRenderers(TrackRenderer[] renderers, IBandwidthMeter bandwidthMeter) { for (var i = 0; i < RendererCount; i++) { if (renderers[i] == null) { // Convert a null renderer to a dummy renderer. renderers[i] = new DummyTrackRenderer(); } } // Complete preparation. _videoRenderer = renderers[TypeVideo]; _codecCounters = _videoRenderer is MediaCodecTrackRenderer ? ((MediaCodecTrackRenderer)_videoRenderer).CodecCounters : renderers[TypeAudio] is MediaCodecTrackRenderer ? ((MediaCodecTrackRenderer)renderers[TypeAudio]).CodecCounters : null; _bandwidthMeter = bandwidthMeter; PushSurface(false); _player.Prepare(renderers); _rendererBuildingState = RendererBuildingStateBuilt; }
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); }
private void LoadTrack(int i) { try { var track = Track.ReadTrack(tracks[i].Path); TrackRenderer tr = new TrackRenderer(track); Program.MainWindow.SetTrackRenderer(tr); tr.Render(); Program.MainWindow.MWInfoTitle.Content = track.TrackInfo.Name; Program.MainWindow.MWInfoAuthor.Content = track.TrackInfo.Author; Program.MainWindow.MWInfoImage.Source = (track.TrackInfo.Image != null && track.TrackInfo.ImageLen > 0) ? (BitmapSource) new ImageSourceConverter().ConvertFrom(track.TrackInfo.Image) : ResourceHelper.LoadBitmapFromResource("Resources/Default.png"); // set slider value EventAgregator.Instance.Publish(new MWSliderValChangedEvt(track.TrackInfo.SliderValue)); } catch (ForUserException e) { InfoDialog.ShowMessageDialog(e.Message); } }
public void SetTrackRenderer(TrackRenderer trackRenderer) { this.trackRenderer = trackRenderer; }
/// <summary> /// Invoked with the results from a <see cref="IRendererBuilder"/>. /// </summary> /// <param name="renderers">Renderers indexed by <see cref="VideoPlayer"/>. TYPE_* constants. An individual element may be null if there do not exist tracks of the corresponding type.</param> /// <param name="bandwidthMeter">Provides an estimate of the currently available bandwidth. May be null.</param> internal void OnRenderers(TrackRenderer[] renderers, IBandwidthMeter bandwidthMeter) { for (var i = 0; i < RendererCount; i++) { if (renderers[i] == null) { // Convert a null renderer to a dummy renderer. renderers[i] = new DummyTrackRenderer(); } } // Complete preparation. _videoRenderer = renderers[TypeVideo]; _codecCounters = _videoRenderer is MediaCodecTrackRenderer ? ((MediaCodecTrackRenderer) _videoRenderer).CodecCounters : renderers[TypeAudio] is MediaCodecTrackRenderer ? ((MediaCodecTrackRenderer) renderers[TypeAudio]).CodecCounters : null; _bandwidthMeter = bandwidthMeter; PushSurface(false); _player.Prepare(renderers); _rendererBuildingState = RendererBuildingStateBuilt; }
public void Prepare() { if (_rendererBuildingState == RendererBuildingStateBuilt) { _player.Stop(); } _rendererBuilder.Cancel(); _videoFormat = null; _videoRenderer = null; _rendererBuildingState = RendererBuildingStateBuilding; MaybeReportPlayerState(); _rendererBuilder.BuildRenderers(this); }
public void OnSingleManifest(Object obj) { var manifest = obj.JavaCast<HlsPlaylist>(); if (_canceled) { return; } var mainHandler = _player.MainHandler; var loadControl = new DefaultLoadControl(new DefaultAllocator(BufferSegmentSize)); var bandwidthMeter = new DefaultBandwidthMeter(); var timestampAdjusterProvider = new PtsTimestampAdjusterProvider(); var dataSource = new DefaultUriDataSource(_context, bandwidthMeter, _userAgent); var chunkSource = new HlsChunkSource(true , dataSource , _url , manifest , DefaultHlsTrackSelector.NewDefaultInstance(_context) , bandwidthMeter , timestampAdjusterProvider , HlsChunkSource.AdaptiveModeSplice); var sampleSource = new HlsSampleSource(chunkSource , loadControl , BufferSegments*BufferSegmentSize , mainHandler , _player , VideoPlayer.TypeVideo); var videoRenderer = new MediaCodecVideoTrackRenderer(_context , sampleSource , MediaCodecSelector.Default , (int) VideoScalingMode.ScaleToFit , 5000 , mainHandler , _player , 50); var audioRenderer = new MediaCodecAudioTrackRenderer(sampleSource , MediaCodecSelector.Default , null , true , _player.MainHandler , _player , AudioCapabilities.GetCapabilities(_context) , (int) Stream.Music); // TODO: The Id3Parser is currently not part of the binding //MetadataTrackRenderer id3Renderer = new MetadataTrackRenderer(sampleSource, new Id3Parser(), player, mainHandler.getLooper()); var closedCaptionRenderer = new Eia608TrackRenderer(sampleSource, _player, mainHandler.Looper); var renderers = new TrackRenderer[VideoPlayer.RendererCount]; renderers[VideoPlayer.TypeVideo] = videoRenderer; renderers[VideoPlayer.TypeAudio] = audioRenderer; //renderers[DemoPlayer.TYPE_METADATA] = id3Renderer; renderers[VideoPlayer.TypeText] = closedCaptionRenderer; _player.OnRenderers(renderers, bandwidthMeter); }
private void BuildRenderers() { var period = _manifest.GetPeriod(0); var mainHandler = _player.MainHandler; var loadControl = new DefaultLoadControl(new DefaultAllocator(BufferSegmentSize)); var bandwidthMeter = new DefaultBandwidthMeter(mainHandler, _player); var hasContentProtection = false; var sets = period.AdaptationSets .OfType <Object>() .Select(item => item.JavaCast <AdaptationSet>()) .ToList(); foreach (var set in sets) { if (set.Type != AdaptationSet.TypeUnknown) { hasContentProtection |= set.HasContentProtection; } } // Check drm support if necessary. var filterHdContent = false; StreamingDrmSessionManager drmSessionManager = null; if (hasContentProtection) { if (ExoPlayerUtil.SdkInt < 18) { _player.OnRenderersError(new UnsupportedDrmException(UnsupportedDrmException.ReasonUnsupportedScheme)); return; } try { drmSessionManager = StreamingDrmSessionManager.NewWidevineInstance(_player.PlaybackLooper, _drmCallback, null, _player.MainHandler, _player); filterHdContent = GetWidevineSecurityLevel(drmSessionManager) != SecurityLevel1; } catch (UnsupportedDrmException e) { _player.OnRenderersError(e); return; } } // Build the video renderer. var videoDataSource = new DefaultUriDataSource(_context, bandwidthMeter, _userAgent); var videoChunkSource = new DashChunkSource(_manifestFetcher , DefaultDashTrackSelector.NewVideoInstance(_context, true, filterHdContent) , videoDataSource , new FormatEvaluatorAdaptiveEvaluator(bandwidthMeter) , LiveEdgeLatencyMs , _elapsedRealtimeOffset , mainHandler , _player , EventSourceId); var videoSampleSource = new ChunkSampleSource(videoChunkSource , loadControl , VideoBufferSegments * BufferSegmentSize , mainHandler , _player , VideoPlayer.TypeVideo); var videoRenderer = new MediaCodecVideoTrackRenderer(_context , videoSampleSource , MediaCodecSelector.Default , (int)VideoScalingMode.ScaleToFit , 5000 , drmSessionManager , true , mainHandler , _player , 50); // Build the audio renderer. var audioDataSource = new DefaultUriDataSource(_context, bandwidthMeter, _userAgent); var audioChunkSource = new DashChunkSource(_manifestFetcher , DefaultDashTrackSelector.NewAudioInstance() , audioDataSource , null , LiveEdgeLatencyMs , _elapsedRealtimeOffset , mainHandler , _player , VideoPlayer.TypeAudio); var audioSampleSource = new ChunkSampleSource(audioChunkSource , loadControl , AudioBufferSegments * BufferSegmentSize , mainHandler , _player , VideoPlayer.TypeAudio); var audioRenderer = new MediaCodecAudioTrackRenderer(audioSampleSource , MediaCodecSelector.Default , drmSessionManager , true , mainHandler , _player , AudioCapabilities.GetCapabilities(_context) , (int)Stream.Music); // Build the text renderer. var textDataSource = new DefaultUriDataSource(_context, bandwidthMeter, _userAgent); var textChunkSource = new DashChunkSource(_manifestFetcher , DefaultDashTrackSelector.NewTextInstance() , textDataSource , null , LiveEdgeLatencyMs , _elapsedRealtimeOffset , mainHandler , _player , VideoPlayer.TypeText); var textSampleSource = new ChunkSampleSource(textChunkSource , loadControl , TextBufferSegments * BufferSegmentSize , mainHandler , _player , VideoPlayer.TypeText); var textRenderer = new TextTrackRenderer(textSampleSource , _player , mainHandler.Looper); // Invoke the callback. var renderers = new TrackRenderer[VideoPlayer.RendererCount]; renderers[VideoPlayer.TypeVideo] = videoRenderer; renderers[VideoPlayer.TypeAudio] = audioRenderer; renderers[VideoPlayer.TypeText] = textRenderer; _player.OnRenderers(renderers, bandwidthMeter); }
public SignalRenderer(IPathFactory pathFactory, TrackRenderer trackRenderer) { _lightPath = BuildLightPath(pathFactory); _trackRenderer = trackRenderer; }
private void BuildRenderers() { var period = _manifest.GetPeriod(0); var mainHandler = _player.MainHandler; var loadControl = new DefaultLoadControl(new DefaultAllocator(BufferSegmentSize)); var bandwidthMeter = new DefaultBandwidthMeter(mainHandler, _player); var hasContentProtection = false; var sets = period.AdaptationSets .OfType<Object>() .Select(item => item.JavaCast<AdaptationSet>()) .ToList(); foreach (var set in sets) { if (set.Type != AdaptationSet.TypeUnknown) { hasContentProtection |= set.HasContentProtection; } } // Check drm support if necessary. var filterHdContent = false; StreamingDrmSessionManager drmSessionManager = null; if (hasContentProtection) { if (ExoPlayerUtil.SdkInt < 18) { _player.OnRenderersError(new UnsupportedDrmException(UnsupportedDrmException.ReasonUnsupportedScheme)); return; } try { drmSessionManager = StreamingDrmSessionManager.NewWidevineInstance(_player.PlaybackLooper, _drmCallback, null, _player.MainHandler, _player); filterHdContent = GetWidevineSecurityLevel(drmSessionManager) != SecurityLevel1; } catch (UnsupportedDrmException e) { _player.OnRenderersError(e); return; } } // Build the video renderer. var videoDataSource = new DefaultUriDataSource(_context, bandwidthMeter, _userAgent); var videoChunkSource = new DashChunkSource(_manifestFetcher , DefaultDashTrackSelector.NewVideoInstance(_context, true, filterHdContent) , videoDataSource , new FormatEvaluatorAdaptiveEvaluator(bandwidthMeter) , LiveEdgeLatencyMs , _elapsedRealtimeOffset , mainHandler , _player , EventSourceId); var videoSampleSource = new ChunkSampleSource(videoChunkSource , loadControl , VideoBufferSegments*BufferSegmentSize , mainHandler , _player , VideoPlayer.TypeVideo); var videoRenderer = new MediaCodecVideoTrackRenderer(_context , videoSampleSource , MediaCodecSelector.Default , (int) VideoScalingMode.ScaleToFit , 5000 , drmSessionManager , true , mainHandler , _player , 50); // Build the audio renderer. var audioDataSource = new DefaultUriDataSource(_context, bandwidthMeter, _userAgent); var audioChunkSource = new DashChunkSource(_manifestFetcher , DefaultDashTrackSelector.NewAudioInstance() , audioDataSource , null , LiveEdgeLatencyMs , _elapsedRealtimeOffset , mainHandler , _player , VideoPlayer.TypeAudio); var audioSampleSource = new ChunkSampleSource(audioChunkSource , loadControl , AudioBufferSegments*BufferSegmentSize , mainHandler , _player , VideoPlayer.TypeAudio); var audioRenderer = new MediaCodecAudioTrackRenderer(audioSampleSource , MediaCodecSelector.Default , drmSessionManager , true , mainHandler , _player , AudioCapabilities.GetCapabilities(_context) , (int) Stream.Music); // Build the text renderer. var textDataSource = new DefaultUriDataSource(_context, bandwidthMeter, _userAgent); var textChunkSource = new DashChunkSource(_manifestFetcher , DefaultDashTrackSelector.NewTextInstance() , textDataSource , null , LiveEdgeLatencyMs , _elapsedRealtimeOffset , mainHandler , _player , VideoPlayer.TypeText); var textSampleSource = new ChunkSampleSource(textChunkSource , loadControl , TextBufferSegments*BufferSegmentSize , mainHandler , _player , VideoPlayer.TypeText); var textRenderer = new TextTrackRenderer(textSampleSource , _player , mainHandler.Looper); // Invoke the callback. var renderers = new TrackRenderer[VideoPlayer.RendererCount]; renderers[VideoPlayer.TypeVideo] = videoRenderer; renderers[VideoPlayer.TypeAudio] = audioRenderer; renderers[VideoPlayer.TypeText] = textRenderer; _player.OnRenderers(renderers, bandwidthMeter); }
public CrossTrackRenderer(TrackRenderer trackRenderer) { _trackRenderer = trackRenderer; }
void OnValidate() { renderer = GetComponent <TrackRenderer>(); trackCollection = TrackCollection.GetInstance(); }
void Awake() { renderer = GetComponent <TrackRenderer>(); ClearTrackLayout(); }
public void OnSingleManifest(Object obj) { var manifest = obj.JavaCast <SmoothStreamingManifest>(); if (_canceled) { return; } var mainHandler = _player.MainHandler; var loadControl = new DefaultLoadControl(new DefaultAllocator(BufferSegmentSize)); var bandwidthMeter = new DefaultBandwidthMeter(mainHandler, _player); // Check drm support if necessary. IDrmSessionManager drmSessionManager = null; if (manifest.ProtectionElement != null) { if (ExoPlayerUtil.SdkInt < 18) { _player.OnRenderersError( new UnsupportedDrmException(UnsupportedDrmException.ReasonUnsupportedScheme)); return; } try { drmSessionManager = new StreamingDrmSessionManager(manifest.ProtectionElement.Uuid, _player.PlaybackLooper, _drmCallback, null, _player.MainHandler, _player); } catch (Exception e) { _player.OnRenderersError(e); return; } } // Build the video renderer. var videoDataSource = new DefaultUriDataSource(_context, bandwidthMeter, _userAgent); var videoChunkSource = new SmoothStreamingChunkSource(_manifestFetcher , DefaultSmoothStreamingTrackSelector.NewVideoInstance(_context, true, false) , videoDataSource , new FormatEvaluatorAdaptiveEvaluator(bandwidthMeter) , LiveEdgeLatencyMs); var videoSampleSource = new ChunkSampleSource(videoChunkSource , loadControl , VideoBufferSegments * BufferSegmentSize , mainHandler , _player , VideoPlayer.TypeVideo); var videoRenderer = new MediaCodecVideoTrackRenderer(_context , videoSampleSource , MediaCodecSelector.Default , (int)VideoScalingMode.ScaleToFit , 5000 , drmSessionManager , true , mainHandler , _player , 50); // Build the audio renderer. var audioDataSource = new DefaultUriDataSource(_context, bandwidthMeter, _userAgent); var audioChunkSource = new SmoothStreamingChunkSource(_manifestFetcher , DefaultSmoothStreamingTrackSelector.NewAudioInstance() , audioDataSource , null , LiveEdgeLatencyMs); var audioSampleSource = new ChunkSampleSource(audioChunkSource , loadControl , AudioBufferSegments * BufferSegmentSize , mainHandler , _player , VideoPlayer.TypeAudio); var audioRenderer = new MediaCodecAudioTrackRenderer(audioSampleSource , MediaCodecSelector.Default , drmSessionManager , true , mainHandler , _player , AudioCapabilities.GetCapabilities(_context) , (int)Stream.Music); // Build the text renderer. var textDataSource = new DefaultUriDataSource(_context, bandwidthMeter, _userAgent); var textChunkSource = new SmoothStreamingChunkSource(_manifestFetcher , DefaultSmoothStreamingTrackSelector.NewTextInstance() , textDataSource , null , LiveEdgeLatencyMs); var textSampleSource = new ChunkSampleSource(textChunkSource , loadControl , TextBufferSegments * BufferSegmentSize , mainHandler , _player , VideoPlayer.TypeText); var textRenderer = new TextTrackRenderer(textSampleSource , _player , mainHandler.Looper); // Invoke the callback. var renderers = new TrackRenderer[VideoPlayer.RendererCount]; renderers[VideoPlayer.TypeVideo] = videoRenderer; renderers[VideoPlayer.TypeAudio] = audioRenderer; renderers[VideoPlayer.TypeText] = textRenderer; _player.OnRenderers(renderers, bandwidthMeter); }
public void OnSingleManifest(Object obj) { var manifest = obj.JavaCast<SmoothStreamingManifest>(); if (_canceled) { return; } var mainHandler = _player.MainHandler; var loadControl = new DefaultLoadControl(new DefaultAllocator(BufferSegmentSize)); var bandwidthMeter = new DefaultBandwidthMeter(mainHandler, _player); // Check drm support if necessary. IDrmSessionManager drmSessionManager = null; if (manifest.ProtectionElement != null) { if (ExoPlayerUtil.SdkInt < 18) { _player.OnRenderersError( new UnsupportedDrmException(UnsupportedDrmException.ReasonUnsupportedScheme)); return; } try { drmSessionManager = new StreamingDrmSessionManager(manifest.ProtectionElement.Uuid, _player.PlaybackLooper, _drmCallback, null, _player.MainHandler, _player); } catch (Exception e) { _player.OnRenderersError(e); return; } } // Build the video renderer. var videoDataSource = new DefaultUriDataSource(_context, bandwidthMeter, _userAgent); var videoChunkSource = new SmoothStreamingChunkSource(_manifestFetcher , DefaultSmoothStreamingTrackSelector.NewVideoInstance(_context, true, false) , videoDataSource , new FormatEvaluatorAdaptiveEvaluator(bandwidthMeter) , LiveEdgeLatencyMs); var videoSampleSource = new ChunkSampleSource(videoChunkSource , loadControl , VideoBufferSegments*BufferSegmentSize , mainHandler , _player , VideoPlayer.TypeVideo); var videoRenderer = new MediaCodecVideoTrackRenderer(_context , videoSampleSource , MediaCodecSelector.Default , (int)VideoScalingMode.ScaleToFit , 5000 , drmSessionManager , true , mainHandler , _player , 50); // Build the audio renderer. var audioDataSource = new DefaultUriDataSource(_context, bandwidthMeter, _userAgent); var audioChunkSource = new SmoothStreamingChunkSource(_manifestFetcher , DefaultSmoothStreamingTrackSelector.NewAudioInstance() , audioDataSource , null , LiveEdgeLatencyMs); var audioSampleSource = new ChunkSampleSource(audioChunkSource , loadControl , AudioBufferSegments*BufferSegmentSize , mainHandler , _player , VideoPlayer.TypeAudio); var audioRenderer = new MediaCodecAudioTrackRenderer(audioSampleSource , MediaCodecSelector.Default , drmSessionManager , true , mainHandler , _player , AudioCapabilities.GetCapabilities(_context) , (int) Stream.Music); // Build the text renderer. var textDataSource = new DefaultUriDataSource(_context, bandwidthMeter, _userAgent); var textChunkSource = new SmoothStreamingChunkSource(_manifestFetcher , DefaultSmoothStreamingTrackSelector.NewTextInstance() , textDataSource , null , LiveEdgeLatencyMs); var textSampleSource = new ChunkSampleSource(textChunkSource , loadControl , TextBufferSegments*BufferSegmentSize , mainHandler , _player , VideoPlayer.TypeText); var textRenderer = new TextTrackRenderer(textSampleSource , _player , mainHandler.Looper); // Invoke the callback. var renderers = new TrackRenderer[VideoPlayer.RendererCount]; renderers[VideoPlayer.TypeVideo] = videoRenderer; renderers[VideoPlayer.TypeAudio] = audioRenderer; renderers[VideoPlayer.TypeText] = textRenderer; _player.OnRenderers(renderers, bandwidthMeter); }
public void CloseTrack() { this.trackRenderer = null; MainWindowNotePanel.Children.Clear(); }