diff --git a/CHANGELOG.md b/CHANGELOG.md index 282bb9b..f491242 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,20 @@ +## 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 +* Adds pub badge. ## 0.0.1+1 -* Adds android support for streaming torrents +* Adds android support for streaming torrents. diff --git a/README.md b/README.md index 80eb797..ab56a28 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Flutter Torrent Streamer -[![pub](https://img.shields.io/pub/v/flutter_torrent_streamer.svg?color=blue)](https://pub.dev/packages/flutter_torrent_streamer) +[![pub](https://img.shields.io/pub/v/flutter_torrent_streamer.svg)](https://pub.dev/packages/flutter_torrent_streamer) A flutter plugin to stream videos directly from torrent/magnet links. @@ -16,7 +16,7 @@ This plugin is still under development and pull requests to make it better are h Add below line to your `pubspec.yaml` and run `flutter packages get` ``` -flutter_torrent_streamer: ^0.0.1+2 +flutter_torrent_streamer: ^0.0.2 ``` ## Example @@ -109,6 +109,14 @@ class _TorrentStreamerViewState extends State { See [example](/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.** { *; } +``` + ## TODO - Add support for `video_player` flutter plugin. - Make streaming and seeking more robust for while download still in progress. diff --git a/android/build.gradle b/android/build.gradle index 63988cc..745402e 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -44,4 +44,4 @@ dependencies { implementation 'com.github.TorrentStream:TorrentStream-Android:2.5.0' implementation 'org.nanohttpd:nanohttpd-webserver:2.3.1' // implementation files('/Users/sundeep/flutter/bin/cache/artifacts/engine/android-x64/flutter.jar') -} \ No newline at end of file +} diff --git a/android/src/main/java/in/dotapps/plugins/flutter_torrent_streamer/FlutterTorrentStreamerPlugin.java b/android/src/main/java/in/dotapps/plugins/flutter_torrent_streamer/FlutterTorrentStreamerPlugin.java index 6616fca..1fe8d90 100644 --- a/android/src/main/java/in/dotapps/plugins/flutter_torrent_streamer/FlutterTorrentStreamerPlugin.java +++ b/android/src/main/java/in/dotapps/plugins/flutter_torrent_streamer/FlutterTorrentStreamerPlugin.java @@ -65,7 +65,7 @@ public static void registerWith(Registrar registrar) { public void onMethodCall(MethodCall call, Result result) { switch (call.method) { case "init": - initHandler((HashMap) call.arguments, result); + initHandler((HashMap) call.arguments, result); break; case "start": startHandler(call.argument("uri"), result); @@ -156,7 +156,7 @@ public void onCancel(Object o) { torrentListener = null; } - private void initHandler(HashMap options, Result result) { + private void initHandler(HashMap options, Result result) { final String saveLocation = (String) options.get("saveLocation"); final boolean removeOnStop = (boolean) options.get("removeFilesAfterStop"); final int port = (int) options.get("port"); diff --git a/android/src/main/java/in/dotapps/plugins/flutter_torrent_streamer/VideoServerPlugin.java b/android/src/main/java/in/dotapps/plugins/flutter_torrent_streamer/VideoServerPlugin.java index a2e97ca..b7a97aa 100644 --- a/android/src/main/java/in/dotapps/plugins/flutter_torrent_streamer/VideoServerPlugin.java +++ b/android/src/main/java/in/dotapps/plugins/flutter_torrent_streamer/VideoServerPlugin.java @@ -1,7 +1,5 @@ package in.dotapps.plugins.flutter_torrent_streamer; -import android.util.Log; - import com.frostwire.jlibtorrent.TorrentHandle; import com.github.se_bastiaan.torrentstream.Torrent; import com.github.se_bastiaan.torrentstream.TorrentStream; @@ -194,7 +192,6 @@ public void run() { } } } - Log.d(TAG, "PIECES STATUS: " + pieces.toString()); if (allPiecesDownloaded) { latch.countDown(); timer.cancel(); diff --git a/example/README.md b/example/README.md index a58cf68..a25c5d2 100644 --- a/example/README.md +++ b/example/README.md @@ -1,16 +1,4 @@ -# flutter_torrent_streamer_example +# Torrent Streamer Example -Demonstrates how to use the flutter_torrent_streamer plugin. +Demonstrates how to use the flutter_torrent_streamer plugin in more detail. -## 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: - -- [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab) -- [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook) - -For help getting started with Flutter, view our -[online documentation](https://flutter.dev/docs), which offers tutorials, -samples, guidance on mobile development, and a full API reference. diff --git a/example/android/build.gradle b/example/android/build.gradle index 1b33616..87e530f 100644 --- a/example/android/build.gradle +++ b/example/android/build.gradle @@ -14,6 +14,10 @@ allprojects { google() jcenter() } + + tasks.withType(JavaCompile) { + options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation" + } } rootProject.buildDir = '../build' diff --git a/pubspec.yaml b/pubspec.yaml index 2a875e9..5accee8 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: flutter_torrent_streamer description: A flutter plugin to stream videos directly from torrent/magnet links. -version: 0.0.1+2 +version: 0.0.2 author: Sundeep Babbur homepage: https://github.com/DarkSouL11/flutter_torrent_streamer