abdelaziz-mahdy / flutter_meedu_videoplayer

Cross-Platform Video Player for flutter
https://abdelaziz-mahdy.github.io/flutter_meedu_videoplayer/
MIT License
132 stars 69 forks source link

Have you tried this library with a live stream ? #125

Closed reteset closed 11 months ago

reteset commented 1 year ago

If not then , i would advice you to try , because you assume source is a static media and has a known length but , in live stream media length is unknown

you can use following stream url to test yourself: Stream Url

i do not understand why ,i see trace of video_player lib entries in log window, since you claim that you use media_kit i have no import to media_player in my project nor , reference in pubspec file VideoPlayerController.initialize.eventListener (package:video_player/video_player.dart i am constantly receiving the following error twice on every second

Tried on : Android , IOS , Mac OS (with M1 PRO Chip)

[VERBOSE-2:dart_vm_initializer.cc(41)] Unhandled Exception: Bad state: Future already completed
#0      _AsyncCompleter.complete (dart:async/future_impl.dart:35:31)
#1      VideoPlayerController.initialize.eventListener (package:video_player/video_player.dart:423:33)
#2      _RootZone.runUnaryGuarded (dart:async/zone.dart:1594:10)
#3      _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:339:11)
#4      _DelayedData.perform (dart:async/stream_impl.dart:515:14)
#5      _PendingEvents.handleNext (dart:async/stream_impl.dart:620:11)
#6      _PendingEvents.schedule.<anonymous closure> (dart:async/stream_impl.dart:591:7)
#7      _microtaskLoop (dart:async/schedule_microtask.dart:40:21)
#8      _startMicrotaskLoop (dart:async/schedule_microtask.dart:49:5)

I initialized it like below

Future<void> main() async {
  WidgetsFlutterBinding.ensureInitialized();
  initMeeduPlayer(
    iosUseMediaKit: true,
    androidUseMediaKit: true,
  );
}

Here is the Flutter Doctor

[!] Flutter (Channel stable, 3.10.4, on macOS 13.4 22F66 darwin-arm64, locale tr-TR)
    • Flutter version 3.10.4 on channel stable at /Users/serkan/AndroidSDK/flutter
    ! The flutter binary is not on your path. Consider adding /Users/serkan/AndroidSDK/flutter/bin to your path.
    ! The dart binary is not on your path. Consider adding /Users/serkan/AndroidSDK/flutter/bin to your path.
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 682aa387cf (3 weeks ago), 2023-06-05 18:04:56 -0500
    • Engine revision 2a3401c9bb
    • Dart version 3.0.3
    • DevTools version 2.23.1
    • If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to perform update checks and upgrades.

[!] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1)
    • Android SDK at /Users/serkan/AndroidSDK
    ✗ cmdline-tools component is missing
      Run `path/to/sdkmanager --install "cmdline-tools;latest"`
      See https://developer.android.com/studio/command-line for more details.
    ✗ Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/docs/get-started/install/macos#android-setup for more details.

[✓] Xcode - develop for iOS and macOS (Xcode 14.3)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 14E222b
    • CocoaPods version 1.11.3

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2022.2)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b802.4-9586694)

[✓] VS Code (version 1.73.1)
    • VS Code at /Users/serkan/Downloads/Visual Studio Code.app/Contents
    • Flutter extension version 3.60.0

[✓] VS Code (version 1.77.3)
    • VS Code at /Users/serkan/VsCode/Visual Studio Code.app/Contents
    • Flutter extension version 3.60.0

[✓] Connected device (2 available)
    • macOS (desktop) • macos  • darwin-arm64   • macOS 13.4 22F66 darwin-arm64
    • Chrome (web)    • chrome • web-javascript • Google Chrome 114.0.5735.133

[✓] Network resources
    • All expected network resources are available.
abdelaziz-mahdy commented 1 year ago

https://pub.dev/packages/flutter_meedu_media_kit

Is the one that can work with live streams, this one can't due to limitations with video_player interface

reteset commented 1 year ago

https://pub.dev/packages/flutter_meedu_media_kit

Is the one that can work with live streams, this one can't due to limitations with video_player interface

Thanks for fast reply, The flutter_meedu_media_kit is not suitable for my use either. I was using media_kit already, Preferred yours for subtitle support , I would better to get back to media_kit and implement missing parts myself.

It would be good if you place a note to package inroduction about this issue for future users of this lib It really takes time to add a lib of this type to a project and remove afterwards

abdelaziz-mahdy commented 1 year ago

https://pub.dev/packages/flutter_meedu_media_kit

Is the one that can work with live streams, this one can't due to limitations with video_player interface

Thanks for fast reply, The flutter_meedu_media_kit is not suitable for my use either. I was using media_kit already, Preferred yours for subtitle support , I would better to get back to media_kit and implement missing parts myself.

It would be good if you place a note to package inroduction about this issue for future users of this lib It really takes time to add a lib of this type to a project and remove afterwards

Media_kit already supports subtitles, check their issues and you can use it with flutter_meedu_media_kit by using the video controller instance

I think these packages will no longer be needed after media_kit finishes the 1.0.0 release, since they will provide the needed controls and subtitles and it will be better than video_player since they will maintain the same interface/logic across platforms.

abdelaziz-mahdy commented 1 year ago

Sorry for any inconveniences, it's just the limitations is due to video_player interface it self

If you can add the note in pull request I would happily merge it

abdelaziz-mahdy commented 11 months ago

fixed in the new release 4.2.22