Update README.md

This commit is contained in:
Hexah 2020-06-05 20:18:42 +02:00
parent 1fda8f7d6a
commit ef08c1e27f
3 changed files with 11 additions and 9 deletions

View File

@ -50,20 +50,19 @@ var video = yt.video.get(id); // Returns a Video instance.
``` ```
## Get video mediaStream ## Get video mediaStream
The [MediaStreamsInfoSet][MediaStreamsInfoSet] contains the audio, video and muxed streams of the video. Each of the streams provides an url which can be used to download a video with a get request (See [example][VidExample]). The Manifest contains the audio, video and muxed streams of the video. Each of the streams provides an url which can be used to download a video with a get request (See [example][VidExample]).
```dart ```dart
var mediaStreams = yt.getVideoMediaStream(); var manifest = yt.videos.streamsClient.getManifest(videoId);
var muxed = mediaStreams.muxed; // List of `MuxedStreamInfo` sorted by video quality. var muxed = manifest.muxed; // List of `MuxedStreamInfo` sorted by video quality.
var audio = mediaStreams.audio; // List of `AudioStreamInfo` sorted by bitrate. var audio = manifest.audio; // List of `AudioStreamInfo` sorted by bitrate.
var video = mediaStreams.video; // List of `VideoSteamInfo` sorted by video quality. var video = manifest.video; // List of `VideoSteamInfo` sorted by video quality.
// There are available manifest.audioOnly and manifest.videoOnly as well.
var videoDetails = mediaStreams.videoDetails; //Returns a `Video` instance. Used to avoid calling `yt.getVideo`.
``` ```
Be aware, the muxed streams don't hold the best quality, to achieve so, you'd need to merge the audio and video streams. Be aware, the muxed streams don't hold the best quality, to achieve so, you'd need to merge the audio and video streams.
## Closed Captions ## Closed Captions - Not yet implemented
To get the video closed caption it is need to query before the caption track infos, which can be used to retrieve the closed caption. To get the video closed caption it is need to query before the caption track infos, which can be used to retrieve the closed caption.
```dart ```dart

View File

@ -14,7 +14,8 @@ linter:
- prefer_constructors_over_static_methods - prefer_constructors_over_static_methods
- prefer_contains - prefer_contains
- annotate_overrides - annotate_overrides
- await_future - await_only_futures
- unawaited_futures
analyzer: analyzer:
exclude: exclude:

View File

@ -1,3 +1,5 @@
//TODO: Fixing the console printing.
import 'dart:async'; import 'dart:async';
import 'dart:io'; import 'dart:io';