public interface

HlsDataSourceFactory

 androidx.media3.exoplayer.hls.HlsDataSourceFactory

Subclasses:

DefaultHlsDataSourceFactory

Gradle dependencies

compile group: 'androidx.media3', name: 'media3-exoplayer-hls', version: '1.0.0-alpha03'

  • groupId: androidx.media3
  • artifactId: media3-exoplayer-hls
  • version: 1.0.0-alpha03

Artifact androidx.media3:media3-exoplayer-hls:1.0.0-alpha03 it located at Google repository (https://maven.google.com/)

Overview

Creates DataSources for HLS playlists, encryption and media chunks.

Summary

Methods
public DataSourcecreateDataSource(int dataType)

Creates a DataSource for the given data type.

Methods

public DataSource createDataSource(int dataType)

Creates a DataSource for the given data type.

Parameters:

dataType: The data type for which the DataSource will be used. One of C .DATA_TYPE_* constants.

Returns:

A DataSource for the given data type.

Source

/*
 * Copyright (C) 2017 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package androidx.media3.exoplayer.hls;

import androidx.media3.common.C;
import androidx.media3.common.util.UnstableApi;
import androidx.media3.datasource.DataSource;

/** Creates {@link DataSource}s for HLS playlists, encryption and media chunks. */
@UnstableApi
public interface HlsDataSourceFactory {

  /**
   * Creates a {@link DataSource} for the given data type.
   *
   * @param dataType The data type for which the {@link DataSource} will be used. One of {@link C}
   *     {@code .DATA_TYPE_*} constants.
   * @return A {@link DataSource} for the given data type.
   */
  DataSource createDataSource(int dataType);
}