Java Code Examples for com.google.android.exoplayer.util.Util#getMergedUri()

The following examples show how to use com.google.android.exoplayer.util.Util#getMergedUri() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SmoothStreamingManifest.java    From Exoplayer_VLC with Apache License 2.0 5 votes vote down vote up
/**
 * Builds a uri for requesting the specified chunk of the specified track.
 *
 * @param track The index of the track for which to build the URL.
 * @param chunkIndex The index of the chunk for which to build the URL.
 * @return The request uri.
 */
public Uri buildRequestUri(int track, int chunkIndex) {
  Assertions.checkState(tracks != null);
  Assertions.checkState(chunkStartTimes != null);
  Assertions.checkState(chunkIndex < chunkStartTimes.size());
  String chunkUrl = chunkTemplate
      .replace(URL_PLACEHOLDER_BITRATE, Integer.toString(tracks[track].bitrate))
      .replace(URL_PLACEHOLDER_START_TIME, chunkStartTimes.get(chunkIndex).toString());
  return Util.getMergedUri(baseUri, chunkUrl);
}
 
Example 2
Source File: RangedUri.java    From Exoplayer_VLC with Apache License 2.0 2 votes vote down vote up
/**
 * Returns the {@link Uri} represented by the instance.
 *
 * @return The {@link Uri} represented by the instance.
 */
public Uri getUri() {
  return Util.getMergedUri(baseUri, stringUri);
}