flutter_torrent_streamer 0.0.2

  • Readme
  • Changelog
  • Example
  • Installing
  • 77

Flutter Torrent Streamer #


A flutter plugin to stream videos directly from torrent/magnet links.

This plugin is still under development and pull requests to make it better are heavily appreciated

Few Important points to note before using this plugin #

  • Has only android support for now. (Help to implement iOS support is highly appreciated)
  • Is still under development and APIs may go through breaking changes.
  • Supports streaming and seeking videos while still being downloaded but is still experimental and has been tested to work on MX Player but does not work with video_player plugin.

Installation #

Add below line to your pubspec.yaml and run flutter packages get

flutter_torrent_streamer: ^0.0.2

Example #

import 'package:flutter_torrent_streamer/flutter_torrent_streamer.dart';  
class TorrentStreamerView extends StatefulWidget {
  @override _TorrentStreamerViewState createState() => _TorrentStreamerViewState();
class _TorrentStreamerViewState extends State<TorrentStreamerView> {
  bool isStreamReady = false;
  int progress = 0;
  void initState() {
  void _addTorrentListeners() {
    TorrentStreamer.addEventListener('progress', (data) {
      setState(() => progress = data['progress']);
    TorrentStreamer.addEventListener('ready', (_) {
      setState(() => isStreamReady = true);
  Future<void> _startDownload() async {
    await TorrentStreamer.start('torrent-link-here');
  Future<void> _openVideo(BuildContext context) async {
    if (progress == 100) {
      await TorrentStreamer.launchVideo();
    } else {
        builder: (BuildContext context) {
          return AlertDialog(
            title: new Text('Are You Sure?'),
            content: new Text('Playing video while it is still downloading is experimental and only works on limited set of apps.'),
            actions: <Widget>[
               child: new Text("Cancel"),
                onPressed: () {
                child: new Text("Yes, Proceed"),
                onPressed: () async {
                  await TorrentStreamer.launchVideo();
        context: context
  Widget build(BuildContext context) {
    return Container(
      child: Column(
        children: <Widget>[
            child: Text('Start Download'),
            onPress: _startDownload
          Container(height: 8),
	        child: Text('Play Video'),
	        onPress: () => _openVideo(context)
	    crossAxisAlignment: CrossAxisAlignment.center,
	    mainAxisAlignment: MainAxisAlignment.start,
	    mainAxisSize: MainAxisSize.max
	  padding: EdgeInsets.all(16)

See example app for more detailed usage.

Using in release builds #

If you are using proguard in your app then add the below 2 lines to your proguard rules:

-keep class com.frostwire.jlibtorrent.swig.libtorrent_jni {*;}
-keep class com.frostwire.jlibtorrent.swig.** { *; }


  • Add support for video_player flutter plugin.
  • Make streaming and seeking more robust for while download still in progress.
  • Run torrent streamer server on local network instead of localhost.
  • Add support for iOS.

0.0.2 #

  • Small fix in example.

0.0.1+3 #

  • Adds option to specify the port in which streaming server starts. See [[TorrentStreamerOptions]].
  • Changes default value of removeFilesAfterStop to false.
  • URL encodes torrent streaming url.
  • Few bug fixes to streaming.
  • Updated README with instructions to add proguard rules.
  • Fixes Xlint:unchecked warning during compile.

0.0.1+2 #

  • Adds pub badge.

0.0.1+1 #

  • Adds android support for streaming torrents.


Torrent Streamer Example #

Demonstrates how to use the flutter_torrent_streamer plugin in more detail.

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  flutter_torrent_streamer: ^0.0.2

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_torrent_streamer/flutter_torrent_streamer.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 21, 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

Format lib/flutter_torrent_streamer.dart.

Run flutter format to format lib/flutter_torrent_streamer.dart.

Maintenance suggestions

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.1.0 <3.0.0
flutter 0.0.0
path_provider ^1.1.0 1.5.1
Transitive dependencies
collection 1.14.11 1.14.12
meta 1.1.8
platform 2.2.1
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies