You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Setting SimpleExoPlayer.VideoListener() causes rendering issues (SimpleExoPlayerView does not show any frames). audio plays fine and even the VideoListener's are invoked properly. Am I missing something here?
Following code illustrates the problem.
private void playStream(final Uri mediaUrl) {
Log.d(LOGTAG, "Now playing: " + mediaUrl);
mUrl.setText(mediaUrl.toString());
// Measures bandwidth during playback. Can be null if not required.
DefaultBandwidthMeter bandwidthMeter = new DefaultBandwidthMeter();
// Produces DataSource instances through which media data is loaded.
DataSource.Factory dataSourceFactory = new DefaultDataSourceFactory(this, Util.getUserAgent(this, "yourApplicationName"), bandwidthMeter);
// Produces Extractor instances for parsing the media data.
ExtractorsFactory extractorsFactory = new DefaultExtractorsFactory();
// This is the MediaSource representing the media to be played.
MediaSource videoSource;
if(mediaUrl.getLastPathSegment().contains(".m3u8"))
videoSource = new HlsMediaSource(mediaUrl,dataSourceFactory, 10, null, null);
else
videoSource = new ExtractorMediaSource(mediaUrl,dataSourceFactory, extractorsFactory, null, null);
// Following listener breaks rendering
player.setVideoListener(new SimpleExoPlayer.VideoListener() {
@Override
public void onVideoSizeChanged(int width, int height, int unappliedRotationDegrees, float pixelWidthHeightRatio) {
Log.e(LOGTAG, "onVideoSizeChanged: " + width + ":" +height);
}
@Override
public void onRenderedFirstFrame() {
Log.e(LOGTAG, "onRenderedFirstFrame ");
}
});
// Prepare the player with the source.
player.prepare(videoSource);
player.setPlayWhenReady(true);
}
Replacing setVideoListener() with setVideoDebugListener() solves the issue.
Tested on Nexus 9 running 7.0
The text was updated successfully, but these errors were encountered:
pilzflorian
changed the title
SimpleExoPlayer.SimplesetVideoListener() causes rendering issues r2.1.1
SimpleExoPlayer.Simple.setVideoListener() causes rendering issues r2.1.1
Jan 3, 2017
pilzflorian
changed the title
SimpleExoPlayer.Simple.setVideoListener() causes rendering issues r2.1.1
SimpleExoPlayer.setVideoListener() causes rendering issues r2.1.1
Jan 3, 2017
SimpleExoPlayerView registers itself as the video listener, so when you set it you're replacing SimpleExoPlayerView as the listener. Hence SimpleExoPlayerView doesn't receive the events that it needs.
Why do you need to register a video listener when also using SimpleExoPlayerView?
Thank you so much for clarification, I will create my own SurfaceView and Controller instances.
I need the information for gathering QOS statistics.
I'll close this, thanks again for the quick response!
Setting SimpleExoPlayer.VideoListener() causes rendering issues (SimpleExoPlayerView does not show any frames). audio plays fine and even the VideoListener's are invoked properly. Am I missing something here?
Following code illustrates the problem.
Replacing setVideoListener() with setVideoDebugListener() solves the issue.
Tested on Nexus 9 running 7.0
The text was updated successfully, but these errors were encountered: