flutter_hls_parser 0.0.1
flutter_hls_parser #
dart plugin for parse m3u8 file for hls. both of master and media file is supported.
Getting Started #
Uri playlistUri;
List<String> lines;
try {
playList = await HlsPlaylistParser.create().parse(playlistUri, lines);
} on ParserException catch (e) {
print(e);
}
if (playlist is HlsMasterPlaylist) {
// master m3u8 file
} else if (playlist is HlsMediaPlaylist) {
// media m3u8 file
}
MasterPlaylist example #
HlsMasterPlaylist playlist;
playlist.variants[0].format.bitrate;// => 1280000
Util.splitCodec(playlist.variants[0].format.codecs);// => ['mp4a.40.2']['avc1.66.30']
playlist.variants[0].format.width;// => 304(px)
playlist.subtitles[0].format.id;// => sub1:Eng
playlist.audios[0].format.sampleMimeType// => MimeTypes.AUDIO_AC3
MediaPlaylist example #
HlsMediaPlaylist playlist;
playlist.version;// => 3
playlist.hasEndTag;// => true
playlist.segments[0].durationUs;// => 7975000(microsec)
playlist.segments[0].encryptionIV;// => '0x1566B'
playlist.segments[0].drmInitData.schemeData[0].uuid;// => uuid string
Note #
all bool param is nonnull, and others are often nullable if unknown.
0.0.1 #
- initial release
example/README.md
flutter_hls_parser_example #
Demonstrates how to use the flutter_hls_parser plugin.
Getting Started #
This project is a starting point for a Flutter application.
A few resources to get you started if this is your first Flutter project:
For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.
Use this package as a library
1. Depend on it
Add this to your package's pubspec.yaml file:
dependencies:
flutter_hls_parser: ^0.0.1
2. Install it
You can install packages from the command line:
with Flutter:
$ flutter pub get
Alternatively, your editor might support flutter pub get
.
Check the docs for your editor to learn more.
3. Import it
Now in your Dart code, you can use:
import 'package:flutter_hls_parser/flutter_hls_parser.dart';
Popularity:
Describes how popular the package is relative to other packages.
[more]
|
10
|
Health:
Code health derived from static analysis.
[more]
|
99
|
Maintenance:
Reflects how tidy and up-to-date the package is.
[more]
|
70
|
Overall:
Weighted score of the above.
[more]
|
49
|
We analyzed this package on Dec 13, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:
- Dart: 2.6.1
- pana: 0.13.1+4
- Flutter: 1.12.13+hotfix.2
Health suggestions
Fix lib/src/mime_types.dart
. (-0.50 points)
Analysis of lib/src/mime_types.dart
reported 1 hint:
line 161 col 39: The exception variable 'ignored' isn't used, so the 'catch' clause can be removed.
Fix lib/src/scheme_data.dart
. (-0.50 points)
Analysis of lib/src/scheme_data.dart
reported 1 hint:
line 4 col 8: Unused import: 'package:quiver/core.dart'.
Format lib/flutter_hls_parser.dart
.
Run flutter format
to format lib/flutter_hls_parser.dart
.
Fix additional 11 files with analysis or formatting issues.
Additional issues in the following files:
lib/src/drm_init_data.dart
(Runflutter format
to formatlib/src/drm_init_data.dart
.)lib/src/exception.dart
(Runflutter format
to formatlib/src/exception.dart
.)lib/src/format.dart
(Runflutter format
to formatlib/src/format.dart
.)lib/src/hls_master_playlist.dart
(Runflutter format
to formatlib/src/hls_master_playlist.dart
.)lib/src/hls_playlist_parser.dart
(Runflutter format
to formatlib/src/hls_playlist_parser.dart
.)lib/src/hls_track_metadata_entry.dart
(Runflutter format
to formatlib/src/hls_track_metadata_entry.dart
.)lib/src/metadata.dart
(Runflutter format
to formatlib/src/metadata.dart
.)lib/src/rendition.dart
(Runflutter format
to formatlib/src/rendition.dart
.)lib/src/util.dart
(Runflutter format
to formatlib/src/util.dart
.)lib/src/variant.dart
(Runflutter format
to formatlib/src/variant.dart
.)lib/src/variant_info.dart
(Runflutter format
to formatlib/src/variant_info.dart
.)
Maintenance suggestions
The package description is too short. (-20 points)
Add more detail to the description
field of pubspec.yaml
. Use 60 to 180 characters to describe the package, what it does, and its target use case.
Package is pre-v0.1 release. (-10 points)
While nothing is inherently wrong with versions of 0.0.*
, it might mean that the author is still experimenting with the general direction of the API.
Dependencies
Package | Constraint | Resolved | Available |
---|---|---|---|
Direct dependencies | |||
Dart SDK | >=2.2.2 <3.0.0 | ||
collection | ^1.14.11 | 1.14.11 | 1.14.12 |
flutter | 0.0.0 | ||
meta | ^1.1.7 | 1.1.8 | |
quiver | ^2.0.5 | 2.1.2+1 | |
Transitive dependencies | |||
matcher | 0.12.6 | ||
path | 1.6.4 | ||
sky_engine | 0.0.99 | ||
stack_trace | 1.9.3 | ||
typed_data | 1.1.6 | ||
vector_math | 2.0.8 | ||
Dev dependencies | |||
flutter_test |