Code Monkey home page Code Monkey logo

Comments (5)

syahrizalakbar avatar syahrizalakbar commented on August 23, 2024 4

i think that because this is using Singleton, and after unsubscribe Stream, you cannot reinitialize the stream, the solution is you can reset compressProgress$ with this code in initState

VideoCompress.compressProgress$ = ObservableBuilder();

from videocompress.

syahrizalakbar avatar syahrizalakbar commented on August 23, 2024

i have the same too although i have unsubscribed in dispose method

from videocompress.

yanivshaked avatar yanivshaked commented on August 23, 2024

Or you can wrap VideoCompress.compressProgress$ with StreamController that supports multiple subscriptions:

static StreamController<double> _progressStreamController = StreamController<double>();
static Stream<double> progressStream = _progressStreamController.stream.asBroadcastStream();
.
.
.
VideoCompress.compressProgress$.subscribe((value) {
  _progressStreamController.sink.add(value / 100);
});

and register the stream in your widget:

  @override
  void initState() {
    super.initState();
    if (widget.progressStream != null) {
      _progressSusbscription = widget.progressStream.listen((p) {
        setState(() {
          _progress = p;
        });
      });
    }
  }

from videocompress.

jonataslaw avatar jonataslaw commented on August 23, 2024

Fix um last version

from videocompress.

ribesh-code avatar ribesh-code commented on August 23, 2024

Video compress: 3.1.0

[✓] Flutter (Channel stable, 2.10.5, on macOS 12.3.1 21E258 darwin-arm, locale
en-NP)
[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 13.0)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2021.1)
[✓] VS Code (version 1.67.2)

I am still facing the issue where multiple video cannot be compressed. any possible solutions?

from videocompress.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.