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

The following examples show how to use com.google.android.exoplayer.util.Util#inferContentType() . 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: IjkExoMediaPlayer.java    From ShareBox with Apache License 2.0 2 votes vote down vote up
/**
 * Makes a best guess to infer the type from a media {@link Uri}
 *
 * @param uri The {@link Uri} of the media.
 * @return The inferred type.
 */
private static int inferContentType(Uri uri) {
    String lastPathSegment = uri.getLastPathSegment();
    return Util.inferContentType(lastPathSegment);
}
 
Example 2
Source File: VideoPlayerActivity.java    From droidkaigi2016 with Apache License 2.0 2 votes vote down vote up
/**
 * Makes a best guess to infer the type from a media {@link Uri} and an optional overriding file
 * extension.
 *
 * @param uri           The {@link Uri} of the media.
 * @param fileExtension An overriding file extension.
 * @return The inferred type.
 */
private static int inferContentType(Uri uri, String fileExtension) {
    String lastPathSegment = !TextUtils.isEmpty(fileExtension) ? "." + fileExtension
            : uri.getLastPathSegment();
    return Util.inferContentType(lastPathSegment);
}
 
Example 3
Source File: PlayerActivity.java    From Android-Example-HLS-ExoPlayer with Apache License 2.0 2 votes vote down vote up
/**
 * Makes a best guess to infer the type from a media {@link Uri} and an optional overriding file
 * extension.
 *
 * @param uri           The {@link Uri} of the media.
 * @param fileExtension An overriding file extension.
 * @return The inferred type.
 */
private static int inferContentType(Uri uri, String fileExtension) {
    String lastPathSegment = !TextUtils.isEmpty(fileExtension) ? "." + fileExtension
            : uri.getLastPathSegment();
    return Util.inferContentType(lastPathSegment);
}
 
Example 4
Source File: VideoPlayerActivity.java    From droidkaigi2016 with Apache License 2.0 2 votes vote down vote up
/**
 * Makes a best guess to infer the type from a media {@link Uri} and an optional overriding file
 * extension.
 *
 * @param uri           The {@link Uri} of the media.
 * @param fileExtension An overriding file extension.
 * @return The inferred type.
 */
private static int inferContentType(Uri uri, String fileExtension) {
    String lastPathSegment = !TextUtils.isEmpty(fileExtension) ? "." + fileExtension
            : uri.getLastPathSegment();
    return Util.inferContentType(lastPathSegment);
}