private static Format newFormat(String id) { return Format.createContainerFormat( id, /* label= */ null, MimeTypes.VIDEO_MP4, MimeTypes.VIDEO_H264, /* codecs= */ null, /* bitrate= */ Format.NO_VALUE, /* selectionFlags= */ 0, /* language= */ null); } }
@Deprecated public static Format createContainerFormat( @Nullable String id, @Nullable String containerMimeType, @Nullable String sampleMimeType, @Nullable String codecs, int bitrate, @C.SelectionFlags int selectionFlags, @Nullable String language) { return createContainerFormat( id, /* label= */ null, containerMimeType, sampleMimeType, codecs, bitrate, selectionFlags, language); }
/** * Creates an HLS url from a given http url. * * @param url The url. * @return An HLS url. */ public static HlsUrl createMediaPlaylistHlsUrl(String url) { Format format = Format.createContainerFormat( "0", /* label= */ null, MimeTypes.APPLICATION_M3U8, /* sampleMimeType= */ null, /* codecs= */ null, /* bitrate= */ Format.NO_VALUE, /* selectionFlags= */ 0, /* language= */ null); return new HlsUrl(url, format); }
/** * Creates a {@link Format} instance containing all information contained in the given * {@link MediaTrack} object. * * @param mediaTrack The {@link MediaTrack}. * @return The equivalent {@link Format}. */ public static Format mediaTrackToFormat(MediaTrack mediaTrack) { return Format.createContainerFormat( mediaTrack.getContentId(), /* label= */ null, mediaTrack.getContentType(), /* sampleMimeType= */ null, /* codecs= */ null, /* bitrate= */ Format.NO_VALUE, /* selectionFlags= */ 0, mediaTrack.getLanguage()); }
return Format.createContainerFormat( id, label, containerMimeType, sampleMimeType, codecs, bitrate, selectionFlags, language);
} else { format = Format.createContainerFormat( id, name,