Metadatos de flujo
Un StreamExtractor devuelve mucho más que formatos reproducibles. Casi todo es opcional con un valor por defecto seguro, así que un servicio rellena lo que puede y la app muestra lo que tiene.
La superficie
Más allá de getAudioStreams / getVideoStreams / getVideoOnlyStreams, un StreamExtractor expone (tipos de retorno abreviados):
Description getDescription();
long getLength(); long getTimeStamp(); // duration, and a t= deep-link offset
long getViewCount(); long getLikeCount(); long getDislikeCount();
String getUploaderName() / Url() / AvatarUrl(); long getUploaderSubscriberCount(); boolean isUploaderVerified();
String getSubChannelName() / Url(); // e.g. a topic / sub-channel
String getTextualUploadDate(); DateWrapper getUploadDate();
List<Image> getThumbnails();
List<SubtitlesStream> getSubtitlesDefault(); List<SubtitlesStream> getSubtitles(MediaFormat);
List<StreamSegment> getStreamSegments(); // chapters
List<MetaInfo> getMetaInfo(); // info boxes
List<Frameset> getFrames(); // storyboard preview thumbnails
StreamInfoItemsCollector getRelatedStreams();
StreamType getStreamType(); Privacy getPrivacy(); // PUBLIC, UNLISTED, PRIVATE, INTERNAL, OTHER
String getCategory(); String getLicence(); List<String> getTags(); String getHost();StreamInfo.getInfo ejecuta estos dentro de extractStreams / extractOptionalData, cada uno envuelto de modo que uno que falte se convierte en un error recogido en lugar de en un fallo total (ver Flujo de extracción).
Description: texto tipado
Una Description es contenido más un tipo, para que la app sepa cómo renderizarlo:
class Description { String getContent(); int getType(); } // HTML = 1, MARKDOWN = 2, PLAIN_TEXT = 3
Description.EMPTY_DESCRIPTION // the defaultCapítulos: StreamSegment
Un StreamSegment es un capítulo en la línea de tiempo:
String getTitle(); int getStartTimeSeconds();
String getChannelName(); // optional, when a chapter credits a creator
String getUrl(); // optional deep link
String getPreviewUrl();Subtítulos
SubtitlesStream extiende Stream (así que lleva un DeliveryMethod y contenido/URL) y añade:
String getLanguageTag(); Locale getLocale(); String getDisplayLanguageName();
boolean isAutoGenerated(); String getExtension(); // from the MediaFormat: VTT, TTML, SRT, ...Fotogramas de previsualización: Frameset
Un Frameset es una hoja de sprites de storyboard para las previsualizaciones al desplazarse:
List<String> getUrls(); int getFrameWidth(); int getFrameHeight();
int getTotalCount(); int getDurationPerFrame();
int[] getFrameBoundsAt(long positionMs); // -> [urlIndex, left, top, right, bottom]getFrameBoundsAt mapea una posición de reproducción al rectángulo de recorte exacto dentro de la imagen de sprite correcta, que es lo que dibuja la miniatura de previsualización al buscar.
MetaInfo: cajas informativas
MetaInfo es la caja contextual que algunos servicios adjuntan a ciertos vídeos (un aviso de Wikipedia, de salud o electoral, por ejemplo):
String getTitle(); Description getContent(); List<URL> getUrls(); List<String> getUrlTexts();