flutter_hls_parser 1.0.0

  • Readme
  • Changelog
  • Example
  • Installing
  • 71

flutter_hls_parser #

Pub Version

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().parseString(playlistUri, contentString);
} 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.

1.0.0 #

  • reformat code
  • remove verbose dependencies
  • add parseString method

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: ^1.0.0

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]
41
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
71
Learn more about scoring.

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

  • Dart: 2.7.1
  • pana: 0.13.6
  • Flutter: 1.12.13+hotfix.8

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.8 1.1.8
quiver ^2.0.5 2.1.3
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
test any