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

Commit

Permalink
Rename and move ErrorFactory to ErrorMapper.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan Feline committed Jun 27, 2017
1 parent e32b839 commit 6b400cf
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,21 +1,27 @@
package com.novoda.noplayer.exoplayer.playererror;
package com.novoda.noplayer.exoplayer.forwarder;

import android.media.MediaCodec;

import com.google.android.exoplayer2.ParserException;
import com.google.android.exoplayer2.upstream.HttpDataSource;
import com.novoda.noplayer.Player;
import com.novoda.noplayer.drm.DrmRequestException;
import com.novoda.noplayer.exoplayer.playererror.ConnectivityError;
import com.novoda.noplayer.exoplayer.playererror.DrmDecryptionError;
import com.novoda.noplayer.exoplayer.playererror.DrmRequestError;
import com.novoda.noplayer.exoplayer.playererror.InvalidResponseCodeError;
import com.novoda.noplayer.exoplayer.playererror.MalformedContentError;
import com.novoda.noplayer.exoplayer.playererror.UnknownError;

import java.io.IOException;

public final class ExoPlayerErrorFactory {
final class ExoPlayerErrorMapper {

private ExoPlayerErrorFactory() {
// uninstantiable
private ExoPlayerErrorMapper() {
// static class.
}

public static Player.PlayerError errorFor(Exception e) {
static Player.PlayerError errorFor(Exception e) {
if (e instanceof HttpDataSource.InvalidResponseCodeException) {
return new InvalidResponseCodeError(e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import com.google.android.exoplayer2.source.TrackGroupArray;
import com.google.android.exoplayer2.trackselection.TrackSelectionArray;
import com.novoda.noplayer.Player;
import com.novoda.noplayer.exoplayer.playererror.ExoPlayerErrorFactory;
import com.novoda.noplayer.listeners.ErrorListeners;

class PlayerOnErrorForwarder implements ExoPlayer.EventListener {
Expand All @@ -22,7 +21,7 @@ class PlayerOnErrorForwarder implements ExoPlayer.EventListener {

@Override
public void onPlayerError(ExoPlaybackException error) {
Player.PlayerError playerError = ExoPlayerErrorFactory.errorFor(error);
Player.PlayerError playerError = ExoPlayerErrorMapper.errorFor(error);
errorListeners.onError(player, playerError);
}

Expand Down

0 comments on commit 6b400cf

Please sign in to comment.