Commit 49f4fe78 by Oliver Woodman

Rename URL->URI for manifest fetching

parent ded10605
...@@ -58,7 +58,7 @@ public class MediaPresentationDescription implements RedirectingManifest { ...@@ -58,7 +58,7 @@ public class MediaPresentationDescription implements RedirectingManifest {
} }
@Override @Override
public String getNextManifestUrl() { public String getNextManifestUri() {
return location; return location;
} }
......
...@@ -86,15 +86,15 @@ public class ManifestFetcher<T> implements Loader.Callback { ...@@ -86,15 +86,15 @@ public class ManifestFetcher<T> implements Loader.Callback {
/** /**
* Interface for manifests that are able to specify that subsequent loads should use a different * Interface for manifests that are able to specify that subsequent loads should use a different
* URL. * URI.
*/ */
public interface RedirectingManifest { public interface RedirectingManifest {
/** /**
* Returns the URL from which subsequent manifests should be requested, or null to continue * Returns the URI from which subsequent manifests should be requested, or null to continue
* using the current URL. * using the current URI.
*/ */
public String getNextManifestUrl(); public String getNextManifestUri();
} }
...@@ -103,7 +103,7 @@ public class ManifestFetcher<T> implements Loader.Callback { ...@@ -103,7 +103,7 @@ public class ManifestFetcher<T> implements Loader.Callback {
private final Handler eventHandler; private final Handler eventHandler;
private final EventListener eventListener; private final EventListener eventListener;
/* package */ volatile String manifestUrl; /* package */ volatile String manifestUri;
private int enabledCount; private int enabledCount;
private Loader loader; private Loader loader;
...@@ -117,27 +117,27 @@ public class ManifestFetcher<T> implements Loader.Callback { ...@@ -117,27 +117,27 @@ public class ManifestFetcher<T> implements Loader.Callback {
private volatile long manifestLoadTimestamp; private volatile long manifestLoadTimestamp;
/** /**
* @param manifestUrl The manifest location. * @param manifestUri The manifest location.
* @param uriDataSource The {@link UriDataSource} to use when loading the manifest. * @param uriDataSource The {@link UriDataSource} to use when loading the manifest.
* @param parser A parser to parse the loaded manifest data. * @param parser A parser to parse the loaded manifest data.
*/ */
public ManifestFetcher(String manifestUrl, UriDataSource uriDataSource, public ManifestFetcher(String manifestUri, UriDataSource uriDataSource,
UriLoadable.Parser<T> parser) { UriLoadable.Parser<T> parser) {
this(manifestUrl, uriDataSource, parser, null, null); this(manifestUri, uriDataSource, parser, null, null);
} }
/** /**
* @param manifestUrl The manifest location. * @param manifestUri The manifest location.
* @param uriDataSource The {@link UriDataSource} to use when loading the manifest. * @param uriDataSource The {@link UriDataSource} to use when loading the manifest.
* @param parser A parser to parse the loaded manifest data. * @param parser A parser to parse the loaded manifest data.
* @param eventHandler A handler to use when delivering events to {@code eventListener}. May be * @param eventHandler A handler to use when delivering events to {@code eventListener}. May be
* null if delivery of events is not required. * null if delivery of events is not required.
* @param eventListener A listener of events. May be null if delivery of events is not required. * @param eventListener A listener of events. May be null if delivery of events is not required.
*/ */
public ManifestFetcher(String manifestUrl, UriDataSource uriDataSource, public ManifestFetcher(String manifestUri, UriDataSource uriDataSource,
UriLoadable.Parser<T> parser, Handler eventHandler, EventListener eventListener) { UriLoadable.Parser<T> parser, Handler eventHandler, EventListener eventListener) {
this.parser = parser; this.parser = parser;
this.manifestUrl = manifestUrl; this.manifestUri = manifestUri;
this.uriDataSource = uriDataSource; this.uriDataSource = uriDataSource;
this.eventHandler = eventHandler; this.eventHandler = eventHandler;
this.eventListener = eventListener; this.eventListener = eventListener;
...@@ -146,10 +146,10 @@ public class ManifestFetcher<T> implements Loader.Callback { ...@@ -146,10 +146,10 @@ public class ManifestFetcher<T> implements Loader.Callback {
/** /**
* Updates the manifest location. * Updates the manifest location.
* *
* @param manifestUrl The manifest location. * @param manifestUri The manifest location.
*/ */
public void updateManifestUrl(String manifestUrl) { public void updateManifestUri(String manifestUri) {
this.manifestUrl = manifestUrl; this.manifestUri = manifestUri;
} }
/** /**
...@@ -161,7 +161,7 @@ public class ManifestFetcher<T> implements Loader.Callback { ...@@ -161,7 +161,7 @@ public class ManifestFetcher<T> implements Loader.Callback {
*/ */
public void singleLoad(Looper callbackLooper, final ManifestCallback<T> callback) { public void singleLoad(Looper callbackLooper, final ManifestCallback<T> callback) {
SingleFetchHelper fetchHelper = new SingleFetchHelper( SingleFetchHelper fetchHelper = new SingleFetchHelper(
new UriLoadable<>(manifestUrl, uriDataSource, parser), callbackLooper, callback); new UriLoadable<>(manifestUri, uriDataSource, parser), callbackLooper, callback);
fetchHelper.startLoading(); fetchHelper.startLoading();
} }
...@@ -234,7 +234,7 @@ public class ManifestFetcher<T> implements Loader.Callback { ...@@ -234,7 +234,7 @@ public class ManifestFetcher<T> implements Loader.Callback {
loader = new Loader("manifestLoader"); loader = new Loader("manifestLoader");
} }
if (!loader.isLoading()) { if (!loader.isLoading()) {
currentLoadable = new UriLoadable<>(manifestUrl, uriDataSource, parser); currentLoadable = new UriLoadable<>(manifestUri, uriDataSource, parser);
loader.startLoading(currentLoadable, this); loader.startLoading(currentLoadable, this);
notifyManifestRefreshStarted(); notifyManifestRefreshStarted();
} }
...@@ -254,9 +254,9 @@ public class ManifestFetcher<T> implements Loader.Callback { ...@@ -254,9 +254,9 @@ public class ManifestFetcher<T> implements Loader.Callback {
if (manifest instanceof RedirectingManifest) { if (manifest instanceof RedirectingManifest) {
RedirectingManifest redirectingManifest = (RedirectingManifest) manifest; RedirectingManifest redirectingManifest = (RedirectingManifest) manifest;
String nextLocation = redirectingManifest.getNextManifestUrl(); String nextLocation = redirectingManifest.getNextManifestUri();
if (!TextUtils.isEmpty(nextLocation)) { if (!TextUtils.isEmpty(nextLocation)) {
manifestUrl = nextLocation; manifestUri = nextLocation;
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment