flutter_hls_parser 0.0.1

  • Readme
  • Changelog
  • Example
  • Installing
  • 55

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) {

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


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:

  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';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on Jan 24, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.0
  • pana: 0.13.4
  • Flutter: 1.12.13+hotfix.5

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 (Run flutter format to format lib/src/drm_init_data.dart.)
  • lib/src/exception.dart (Run flutter format to format lib/src/exception.dart.)
  • lib/src/format.dart (Run flutter format to format lib/src/format.dart.)
  • lib/src/hls_master_playlist.dart (Run flutter format to format lib/src/hls_master_playlist.dart.)
  • lib/src/hls_playlist_parser.dart (Run flutter format to format lib/src/hls_playlist_parser.dart.)
  • lib/src/hls_track_metadata_entry.dart (Run flutter format to format lib/src/hls_track_metadata_entry.dart.)
  • lib/src/metadata.dart (Run flutter format to format lib/src/metadata.dart.)
  • lib/src/rendition.dart (Run flutter format to format lib/src/rendition.dart.)
  • lib/src/util.dart (Run flutter format to format lib/src/util.dart.)
  • lib/src/variant.dart (Run flutter format to format lib/src/variant.dart.)
  • lib/src/variant_info.dart (Run flutter format to format lib/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.


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