-
Notifications
You must be signed in to change notification settings - Fork 28
Conversation
|
||
import java.util.List; | ||
import java.util.Map; | ||
|
||
public interface Player extends PlayerState { | ||
|
||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oooops
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
More red than green, and I have seen a few classes with reduced scope. LGTM
@@ -30,9 +30,9 @@ | |||
|
|||
void removeBitrateChangedListener(Player.BitrateChangedListener bitrateChangedListener); | |||
|
|||
void addHeartbeatCallback(Heart.Heartbeat.Callback<Player> callback); | |||
void addHeartbeatCallback(Player.HeartbeatCallback heartbeatCallback); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Heart.Heartbeat.Callback has been moved to the Player to match the other listeners that the Player supports.
DrmSessionCreator drmSessionCreator = drmSessionCreatorFactory.createFor(drmType, drmHandler); | ||
return noPlayerExoPlayerCreator.createExoPlayer(context, drmSessionCreator, downgradeSecureDecoder); | ||
} catch (DrmSessionCreatorException exception) { | ||
throw new UnableToCreatePlayerException(exception); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mapping an internal
exception to a public facing exception.
@@ -225,4 +224,9 @@ public void onLoadTimeout() { | |||
|
|||
void onLoadTimeout(); | |||
} | |||
|
|||
interface HeartbeatCallback { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved from Heart.Heartbeat.Callback
to match the other callbacks on the Player
.
@@ -3,4 +3,23 @@ | |||
public interface StreamingModularDrm extends DrmHandler { | |||
|
|||
byte[] executeKeyRequest(ModularDrmKeyRequest request) throws DrmRequestException; | |||
|
|||
final class DrmRequestException extends Exception { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only used for StreamingModularDrm
so inlined on the interface.
@@ -63,24 +65,19 @@ public boolean isBeating() { | |||
return beating; | |||
} | |||
|
|||
public static class Heartbeat<T> implements Runnable { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need for the generic, we always pass back a Player
.
|
||
import java.util.HashMap; | ||
|
||
class EventInfoForwarder implements ExoPlayer.EventListener { | ||
|
||
private final InfoListeners infoListeners; | ||
private final Player.InfoListener infoListener; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Coding to the exposed interface rather than the internal class.
@@ -125,39 +119,39 @@ public void removeVideoSizeChangedListener(Player.VideoSizeChangedListener video | |||
videoSizeChangedListeners.remove(videoSizeChangedListener); | |||
} | |||
|
|||
public ErrorListeners getErrorListeners() { | |||
public Player.ErrorListener getErrorListeners() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use the interfaces, so that we can make the ErrorListeners
etc package protected.
@@ -0,0 +1,7 @@ | |||
package com.novoda.noplayer.internal.exoplayer.mediasource; | |||
|
|||
enum TrackType { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where is this coming from ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just moved from exoplayer.mediasource
to internal.exoplayer.mediasource
.
@@ -180,7 +180,7 @@ public void seekTo(VideoPosition position) throws IllegalStateException { | |||
} | |||
|
|||
@Override | |||
public void pause() { // TODO: throw to match ExoPlayer? | |||
public void pause() throws IllegalStateException { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💯
import com.novoda.noplayer.Player; | ||
import com.novoda.noplayer.internal.mediaplayer.CheckBufferHeartbeatCallback; | ||
|
||
class BufferHeartbeatListener implements CheckBufferHeartbeatCallback.BufferListener { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this moved from somewhere else as well ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this was in the mediaplayer.forwarder
package before. Now it's been moved to internal.mediaplayer.forwarder
.
Problem
As per the discussion in #58 we want to expose an
internal
package for classes that we are forced to make public but should not be used by clients and therefore do not require JavaDocs.Solution
Create an
internal
package and move internally public classes there!Replace the getters for
ErrorListeners
etc in theListenersHolder
so that they use the interface rather than the implementation. Allows us to make those implementations package protected so that the only way to add and remove is through theListenersHolder
.Remove generics on the
Heartbeat.Callbacks
we always need aPlayer
anyway.Add the
Heartbeat.Callback
to thePlayer
because that's where all the otherCallbacks
andListeners
are always declared here.Test(s) added
No, just updating the broken packages.
Screenshots
No UI changes.
Paired with
@ouchadam