Git Product home page Git Product logo

Comments (7)

birros avatar birros commented on May 23, 2024 1

Yep

from media-kit.

alexmercerind avatar alexmercerind commented on May 23, 2024 1

👏👏👏 May you please raise a PR.
AFAIK only removing send port should also work. I'm surprised how it kept working on Windows & Linux. NEVERMIND!

from media-kit.

alexmercerind avatar alexmercerind commented on May 23, 2024

Is it really happening?
Once hot restart takes place, a different instance of Player with different mpv_handle* should be created.
So, new event loop should be registered for it.


Ideally, I'd like to clear all Player instances upon a hot-restart, but since our whole implementation is completely in Dart, it's going to be a bit challenging. Maybe, we can request users to call some initialization method before runApp, where we can internally clear existing resources & event threads.

from media-kit.

alexmercerind avatar alexmercerind commented on May 23, 2024

Shouldn't this be happening even without native event loop?


Eitherway, maybe we can dedicate native event loop to dispose tasks upon hot-restart.
Is there any way to listen to application lifecycle?

flutter/flutter#10437

from media-kit.

birros avatar birros commented on May 23, 2024

I have just tested with main, the video is playing, without the duration or the position being updated. But when I don't use the native event loop, everything works fine.

This may be a problem specific to the Flutter runtime on macOS.

from media-kit.

alexmercerind avatar alexmercerind commented on May 23, 2024

And it's working before hot-restart?

from media-kit.

birros avatar birros commented on May 23, 2024

Ok, I think I found where the bug came from: media_kit_native_event_loop/src/media_kit_native_event_loop.cc#L21-L27

When I skip the conditions, the events are sent after the hot restart.

// if (post_c_object_ == nullptr) {
  post_c_object_ =
      reinterpret_cast<bool (*)(Dart_Port, Dart_CObject*)>(post_c_object);
// }
// if (send_port_ == -1) {
  send_port_ = send_port;
// }

from media-kit.

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.