Code Monkey home page Code Monkey logo

just_audio_libwinmedia's Introduction

Hi there πŸ‘‹

I'm Bruno, but you can also call me D'Luka (pronounced di luka);
currently majoring in Computer Science;
I do Flutter and stuff; currently learning React Native and Unity (see Pinned);
pronouns: he/him🌈;
Brazilian πŸ‡§πŸ‡·;
fun fact: I can speak 4 languages (pt, en, es, ko), but I'm bad at all of them.


just_audio_libwinmedia's People

Contributors

bdlukaa avatar yesterday17 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

just_audio_libwinmedia's Issues

Playback breaking in filenames containing Unicode

Minimal reproduction project
example repository

To Reproduce

  1. Navigate to just-audio/example
  2. Modify the directory variable with the absolute path of the example folder
  3. Run the application
  4. The "loading" ring should never stop spinning

Expected behavior
Playback should occur almost immediately as is with the commented code below.

Desktop

  • Windows 10 Version 10.0.19044 Build 19044

Flutter SDK version

  • channel stable
  • version 2.10.3

Windows HLS support is not actually present

To which pages does your suggestion apply?

Quote the sentences(s) from the documentation to be improved (if any)

"Windows HLS supported"

Describe your suggestion

According to ryanheise/just_audio#103 (comment) and my tests, HLS does not work on Windows, it just keeps buffering and will not play.

Tested with https://devstreaming-cdn.apple.com/videos/streaming/examples/img_bipbop_adv_example_fmp4/master.m3u8, works with Android.

audioPlayer?.setAudioSource(
      HlsAudioSource(
        Uri.parse(
            "https://devstreaming-cdn.apple.com/videos/streaming/examples/img_bipbop_adv_example_fmp4/master.m3u8"),
      ),

[linux] `ProcessingStream` never fires event/changes state to `ProcessingState.completed` when track has finished playing

For the latest version of webkit2gtk (2.36.1) ProcessingStream.listener never gets called for ProcessingState.completed event when the audio file has finished playing
Also the state never gets set to ProcessingState.completed when the track has finished playing
The entire scenario works perfectly fine if using older versions of webkit2gtk/libwebkit2gtk (all versions before latest gnome-41 & after gnome-36)

Error occurring piece of code:
https://github.com/KRTirtho/spotube/blob/3b7f7785b66e63dfe56b07c49d009441ad56219b/lib/provider/Playback.dart#L113-L130

Tested on Operating Systems/Platforms:

  • Fedora 35 (Gnome-42)
  • Endeavour OS (Gnome-42)
  • Flatpak-Flathub with org.gnome.SDK@41

UnimplementedError: disposeAllPlayers() has not been implemented.

Thanks very much for providing this package for desktop platforms.

I'm trying to use just audio on linux, but it does not work well.

my pubspec.yaml

flutter:
  just_audio: ^0.9.20
  just_audio_libwinmedia: ^0.0.4

...

assets:
  - audios/passing.wav

my versions

$ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[βœ“] Flutter (Channel stable, 2.8.1, on Ubuntu 16.04.7 LTS 4.15.0-142-generic, locale en_US.UTF-8)
[βœ“] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
[βœ“] Chrome - develop for the web
[βœ“] Linux toolchain - develop for Linux desktop
[βœ“] Android Studio (version 4.0)
[βœ“] IntelliJ IDEA Community Edition (version 2019.1)
[βœ“] VS Code (version 1.64.2)
[βœ“] Connected device (2 available)

$ uname -a
Linux me-MS-7B24 4.15.0-142-generic #146~16.04.1-Ubuntu SMP Tue Apr 13 09:27:15 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

And my test code

      onPressed: () async {
        ...
        else{
          final player = AudioPlayer();
          await player.setAsset('audios/passing.wav');
          await player.play();
          await player.stop();
          await player.dispose();
        }
      }

And Result on Pressed

flutter: UnimplementedError: disposeAllPlayers() has not been implemented.
1   0x7ffab2534237 /usr/lib/x86_64-linux-gnu/libjavascriptcoregtk-4.0.so.18(WTFCrash+0x17) [0x7ffab2534237]
2   0x7ffab319a06f /usr/lib/x86_64-linux-gnu/libwebkit2gtk-4.0.so.37(+0x6d606f) [0x7ffab319a06f]
3   0x7ffab31899f0 /usr/lib/x86_64-linux-gnu/libwebkit2gtk-4.0.so.37(+0x6c59f0) [0x7ffab31899f0]
4   0x7ffab34111da /usr/lib/x86_64-linux-gnu/libwebkit2gtk-4.0.so.37(webkit_web_view_run_javascript+0xfa) [0x7ffab34111da]
5   0x7ffab53c8c8a /home/jaehyung/programming/flutter_projects/diener_application/build/linux/x64/debug/bundle/lib/libwinmedia.so(_ZN7webview17gtk_webkit_engine4evalENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE+0x5a) [0x7ffab53c8c8a]
6   0x7ffab53bf678 /home/jaehyung/programming/flutter_projects/diener_application/build/linux/x64/debug/bundle/lib/libwinmedia.so(_ZN6Player9SetVolumeEf+0x98) [0x7ffab53bf678]
7   0x7ffab53c178d /home/jaehyung/programming/flutter_projects/diener_application/build/linux/x64/debug/bundle/lib/libwinmedia.so(PlayerSetVolume+0x3d) [0x7ffab53c178d]
8   0x7ffad7b8597b [0x7ffad7b8597b]
Lost connection to device.

Thank you!

Player on Linux blocks when setAudioSource

Build on linux fails with missing dependency

Hello,

I'm trying to run the simple example from the just_audio package on Linux (POP OS 20.04).
My pubspec.yaml contains:

  just_audio: ^0.9.15
  just_audio_libwinmedia: ^0.0.4

But when I run, I get the following error:

Building Linux application...
libwinmedia - 0.0.3
-------------------
Building on Linux against GTK 3.0 & WebKit2 4.0
C++ Standard: 17
CMake Error at /usr/share/cmake-3.16/Modules/FindPkgConfig.cmake:463 (message):
  A required package was not found
Call Stack (most recent call first):
  /usr/share/cmake-3.16/Modules/FindPkgConfig.cmake:643 (_pkg_check_modules_internal)
  flutter/ephemeral/.plugin_symlinks/libwinmedia/master/CMakeLists.txt:71 (pkg_check_modules)


Exception: Unable to generate build files

First, I don't know why it talks about libwinmedia 0.0.3 despite my pubspec file asking for 0.0.4. Then how am I supposed to know which package is missing? Thank you in advance for your help, and for making this plugin!

pubspec.lock removing

Hello,
Quote from https://dart.dev/guides/libraries/private-files

pubspec.lock

The pubspec.lock file is a special case, similar to Ruby’s Gemfile.lock.

For library packages, don’t commit the pubspec.lock file. Regenerating the pubspec.lock file lets you test your package against the latest compatible versions of its dependencies.

Return duration on load

Currently just_audio_libwinmedia returns a duration of zero when loading any media. It seems libwinmedia has the ability to listen to duration changes, so maybe this could be used to listen for, and return, the duration in just_audio_libwinmedia (not sure if there might be a better way...)

Some bugs On windows

  1. The duration of Audio files is always null

  2. The player state isn't updated when the audio is paused from the keyboard key (the pause key) and also doesn't pause the audio about 40 % of times when we press the key.

I am not able to find why, but duration is always null on windows.

I guess, the player state is not updating because of some errors that the plugin is not currently handling, I might be wrong and hence corrections are welcomed :)

Edit 1: I discovered that when the app window is in the foreground, the play/pause key doesn't work, but does work when the app window is in the background.

Example Please

Hey. @bdlukaa

Thanks for your work! It's not an issue, but could you please provide an example project (counter with .wav sound on FAB tap, will be enough)? It may help all of us in future debugging and issue reporting. Also, it will probably add some pub points to your package. Thanks in advance!

Calling seek fails to start playing if file has already played

When playing an audio clip, calling seek(Duration.zero) should start playing the audio again from the beginning. This works as expected if seek is called while the clip is still playing, but if the audio clip has finished playing nothing happens.

linux: when player starts playing, stuck in playerState buffering

Hello, thank you for your fantastic work on this. It even works great on linux!

When I play a url using player.setAudioSource() the playbackEventStream gets stuck showing:

playing=true state=buffering

When I call .pause() --> .play() it correctly goes to state:

playing=true state=ready

I think it might be because the buffering subject is published after playing == true:

https://github.com/bdlukaa/just_audio_libwinmedia/blob/main/lib/src/just_audio_libwinmedia_real.dart#L65

Or because the subject doesn't update to state ready when buffering == false.

(Linux?) play() sometimes buffers forever

Minimal reproduction project
https://github.com/ryanheise/just_audio/tree/master/just_audio/example

To Reproduce (i.e. user steps, not code)
Steps to reproduce the behavior:

  1. Run lib/example_playlist.dart
  2. Click play

Error messages
Note sure if this is causing the issue.

CONSOLE JS ERROR Unhandled Promise Rejection: AbortError: The operation was aborted.

Expected behavior
Playback starts shortly after pressing play.

Screenshots
image

Desktop (please complete the following information):

  • OS: Linux x86_64 on kernel 5.15.18-1-lts
  • Browser: N/A (Using desktop)

Smartphone (please complete the following information):

  • Device: N/A
  • OS: N/A

Flutter SDK version

[βœ“] Flutter (Channel stable, 2.8.1, on Arch Linux 5.15.18-1-lts, locale en_US.UTF-8)
[βœ“] Android toolchain - develop for Android devices (Android SDK version 31)
[βœ—] Chrome - develop for the web (Cannot find Chrome executable at google-chrome)
    ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.
[βœ“] Linux toolchain - develop for Linux desktop
[!] Android Studio (not installed)
[βœ“] Connected device (1 available)

Additional context
It seems to work sometimes, but most of the time it does not.

tests print errors

Shell: `just_audio_libwinmedia` threw an error: Invalid argument(s): Failed to load dynamic library
'/opt/flutter/bin/cache/artifacts/engine/linux-x64/lib/libwinmedia.so': /opt/flutter/bin/cache/artifacts/engine/linux-x64/lib/libwinmedia.so: cannot open shared object
file: No such file or directory. The app may not function as expected until you remove this plugin from pubspec.yaml
Shell: [ERROR:flutter/shell/common/shell.cc(93)] Dart Unhandled Exception: Invalid argument(s): Failed to load dynamic library
'/opt/flutter/bin/cache/artifacts/engine/linux-x64/lib/libwinmedia.so': /opt/flutter/bin/cache/artifacts/engine/linux-x64/lib/libwinmedia.so: cannot open shared object
file: No such file or directory, stack trace: #0      _open (dart:ffi-patch/ffi_dynamic_library_patch.dart:12:43)
Shell: #1      new DynamicLibrary.open (dart:ffi-patch/ffi_dynamic_library_patch.dart:23:12)
Shell: #2      LWM.initialize (package:libwinmedia/src/internal.dart:128:43)
Shell: #3      LibWinMediaJustAudioPlugin.registerWith (package:just_audio_libwinmedia/src/just_audio_libwinmedia_real.dart:13:9)
Shell: #4      _PluginRegistrant.register (file:///home/nathan/workspace/project/.dart_tool/flutter_build/generated_main.dart:63:36)
Shell: 

Note: /opt/flutter/bin/cache is writable

Workaround is copying PROJECT/build/linux/x64/debug/plugins/libwinmedia/libwinmedia/libwinmedia.so to /opt/flutter/bin/cache/artifacts/engine/linux-x64/lib/

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.