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

Exo-player two facade and forwarders #23

Merged
merged 9 commits into from
May 31, 2017
10 changes: 5 additions & 5 deletions core/src/main/java/com/novoda/noplayer/NoPlayerView.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
import com.google.android.exoplayer2.ui.AspectRatioFrameLayout;
import com.google.android.exoplayer2.ui.SimpleExoPlayerView;
import com.google.android.exoplayer2.ui.SubtitleView;
import com.novoda.noplayer.exoplayer.AspectRatioChangeForwarder;
import com.novoda.noplayer.exoplayer.AspectRatioChangeCalculator;
import com.novoda.notils.caster.Views;

public class NoPlayerView extends FrameLayout implements AspectRatioChangeForwarder.Listener, PlayerView {
public class NoPlayerView extends FrameLayout implements AspectRatioChangeCalculator.Listener, PlayerView {

private final PlayerViewSurfaceHolder surfaceHolderProvider;
private final AspectRatioChangeForwarder aspectRatioChangeForwarder;
private final AspectRatioChangeCalculator aspectRatioChangeCalculator;

private AspectRatioFrameLayout videoFrame;
private SimpleExoPlayerView playerView;
Expand All @@ -30,7 +30,7 @@ public NoPlayerView(Context context, AttributeSet attrs) {
public NoPlayerView(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
surfaceHolderProvider = new PlayerViewSurfaceHolder();
aspectRatioChangeForwarder = new AspectRatioChangeForwarder(this);
aspectRatioChangeCalculator = new AspectRatioChangeCalculator(this);
}

@Override
Expand Down Expand Up @@ -93,7 +93,7 @@ public void removeControls() {
private final Player.VideoSizeChangedListener videoSizeChangedListener = new Player.VideoSizeChangedListener() {
@Override
public void onVideoSizeChanged(int width, int height, int unappliedRotationDegrees, float pixelWidthHeightRatio) {
aspectRatioChangeForwarder.onVideoSizeChanged(width, height, unappliedRotationDegrees, pixelWidthHeightRatio);
aspectRatioChangeCalculator.onVideoSizeChanged(width, height, unappliedRotationDegrees, pixelWidthHeightRatio);
}
};

Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/com/novoda/noplayer/Player.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import android.net.Uri;

import com.novoda.noplayer.exoplayer.Bitrate;
import com.novoda.noplayer.exoplayer.forwarder.Bitrate;
import com.novoda.noplayer.player.PlayerInformation;

import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.novoda.noplayer;

import com.novoda.noplayer.exoplayer.InfoListener;
import com.novoda.noplayer.exoplayer.forwarder.InfoListener;

public interface PlayerListeners {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.novoda.noplayer;

import com.novoda.noplayer.Player.BitrateChangedListener;
import com.novoda.noplayer.exoplayer.InfoListener;
import com.novoda.noplayer.exoplayer.forwarder.InfoListener;
import com.novoda.noplayer.listeners.BitrateChangedListeners;
import com.novoda.noplayer.listeners.BufferStateListeners;
import com.novoda.noplayer.listeners.CompletionListeners;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
package com.novoda.noplayer.exoplayer;

public class AspectRatioChangeForwarder extends ExoPlayerEventForwarder {
public class AspectRatioChangeCalculator {

private final Listener listener;

public AspectRatioChangeForwarder(Listener listener) {
public AspectRatioChangeCalculator(Listener listener) {
this.listener = listener;
}

@Override
public void onVideoSizeChanged(int width, int height, int unappliedRotationDegrees, float pixelWidthHeightRatio) {
float aspectRatio = determineAspectRatio(width, height, pixelWidthHeightRatio);
listener.onNewAspectRatio(aspectRatio);
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading