Skip to content
This repository has been archived by the owner on Feb 11, 2022. It is now read-only.

Fix video changed listener #169

Merged
merged 4 commits into from
Jul 12, 2018
Merged

Fix video changed listener #169

merged 4 commits into from
Jul 12, 2018

Conversation

joetimmins
Copy link
Contributor

Problem

The method on exoplayer to attach a VideoRendererEventListener has been deprecated. That means we weren't attaching our VideoSizeChangedListener properly.

Solution

Change the forwarder to implement exoplayer's new VideoListener and attach it in the facade.

Test(s) added

I'm not sure there's any worthwhile tests to add here. What we really need is the capability to say, when we've created a player, and that player sends an onVideoSizeChanged event, our event listeners all hear it. However, it's not possible to write a test like that right now. It would also be quite an undertaking as we'd need a fake exoplayer which is kept up to date with the version we're targeting.

Paired with

No one

@joetimmins joetimmins added the bug label Jul 12, 2018
@zegnus zegnus self-assigned this Jul 12, 2018
@zegnus zegnus requested a review from Mecharyry July 12, 2018 15:11
@Override
public void onDroppedFrames(int count, long elapsedMs) {
for (VideoRendererEventListener listener : listeners) {
listener.onDroppedFrames(count, elapsedMs);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we do not have this callback anymore?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No we don't. The only place it is exposed by exoplayer is on the VideoRendererEventListener, which can't be attached to exoplayer directly any more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Mecharyry do we still have this info in the analytics listener? or now we cannot know if we have dropped frames at all?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yes, onDroppedVideoFrames on exoplayer's AnalyticsListener is the one we want.

}

@Override
public void onVideoDecoderInitialized(String decoderName, long initializedTimestampMs, long initializationDurationMs) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we do not have this callback anymore? and others...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are exposed through the analytics listener now.

Copy link
Contributor

@Mecharyry Mecharyry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm happy assuming that all instances of the VideoRendererListener have been removed 👍

@Mecharyry Mecharyry self-assigned this Jul 12, 2018
@zegnus zegnus merged commit 5899ffa into develop Jul 12, 2018
@zegnus zegnus deleted the fix-video-changed-listener branch July 12, 2018 15:23
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants