Giter VIP home page Giter VIP logo

Comments (18)

nank1ro avatar nank1ro commented on July 28, 2024 1

Debug:
Screenshot 2022-02-07 at 18 36 48

from spotube.

nank1ro avatar nank1ro commented on July 28, 2024 1

Now it works! Amazing work 💪🥳
Feel free to close this issue cause has been fixed

from spotube.

KRTirtho avatar KRTirtho commented on July 28, 2024

It says the just_audio_macos native plugin is missing
I guess the flutter pub dependencies weren't resolved correctly. Try running:

$ flutter clean
$ flutter pub get
$ flutter run -d macos

from spotube.

nank1ro avatar nank1ro commented on July 28, 2024

Tried, same error:

flutter: [Player._playTrack()] (-1002) unsupported URL
flutter: #0      AudioPlayer._load (package:just_audio/just_audio.dart:778:9)
<asynchronous suspension>
#1      AudioPlayer._setPlatformActive.setPlatform (package:just_audio/just_audio.dart:1346:28)
<asynchronous suspension>

from spotube.

KRTirtho avatar KRTirtho commented on July 28, 2024

That's a really weird bug. Can you debug following line in your IDE & check the currentTrack.uri if it's a valid URL string or not visually?

AudioSource.uri(Uri.parse(currentTrack.uri!)),

from spotube.

nank1ro avatar nank1ro commented on July 28, 2024

The uri is present: spotify:track:1tNJrcVe6gwLEiZCtprs1u , but doesn't seem a valid URL

from spotube.

KRTirtho avatar KRTirtho commented on July 28, 2024

Thanks. And that's seems to be ok since the currentTrack isn't yet converted into a YoutubeTrack. Can you debug this line & see if the ytTrack.uri contains a valid URL string?

.setAudioSource(AudioSource.uri(Uri.parse(ytTrack.uri!)))

from spotube.

nank1ro avatar nank1ro commented on July 28, 2024

The app crashes on this method (line 142):

await player
              .setAudioSource(
            AudioSource.uri(Uri.parse(currentTrack.uri!)),
            preload: true,
          )

I've added a catchError and the error is PlayerException ((-1002) unsupported URL)

It never reaches the line 156

from spotube.

KRTirtho avatar KRTirtho commented on July 28, 2024

I've made some changes there. Try pulling the new modifications & see if works now

from spotube.

nank1ro avatar nank1ro commented on July 28, 2024

Now I'm getting a crash here

.setAudioSource(AudioSource.uri(Uri.parse(ytTrack.uri!)))

with error:

[Player._playTrack()] (-11828) Cannot Open

from spotube.

KRTirtho avatar KRTirtho commented on July 28, 2024

How does the ytTrack.uri look? Is it a valid URL string? I guess it's the AVFoundation framework of Mac OS isn't recognizing the URL as a valid URL because there's no mimetype in the headers

If this is the case then ytTrack.uri!+".mp3" should fix issue

from spotube.

nank1ro avatar nank1ro commented on July 28, 2024

I've tried to add .mp3 but th error is the same.
I also tried to open the URL in the browser but I get this error: Access to rr2---sn-hpa7zned.googlevideo.com was denied. You don't have authorisation to view this page.

from spotube.

KRTirtho avatar KRTirtho commented on July 28, 2024

Can you provide me the URL you're getting in ytTrack.uri

from spotube.

nank1ro avatar nank1ro commented on July 28, 2024
https://rr1---sn-hpa7kn7d.googlevideo.com/videoplayback?expire=1644528990&ei=_jAFYreKA4vH7gPgrK34DQ&ip=185.2.145.1&id=o-AICUwqQ1-FhTZuzxUAf2_o9fTpJPTwRAYU-ejwPkojYD&itag=251&source=youtube&requiressl=yes&mh=L_&mm=31%2C29&mn=sn-hpa7kn7d%2Csn-hpa7zned&ms=au%2Crdu&mv=m&mvi=1&pl=23&initcwndbps=1230000&vprv=1&mime=audio%2Fwebm&ns=hSvkWc72lZa6EOGP9pk_TwgG&gir=yes&clen=3003106&dur=169.181&lmt=1633027712541531&mt=1644506999&fvip=1&keepalive=yes&fexp=24001373%2C24007246&c=WEB&txp=6432434&n=Pa3YXadXYq_YCUs&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cvprv%2Cmime%2Cns%2Cgir%2Cclen%2Cdur%2Clmt&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AG3C_xAwRgIhAL1hqVIVGu-IbTNWRZsW6j7CS8Xu9xyATSR8kHDu706GAiEAlJHbvD3OQ7uZaF_3DJz11F4g5PwGyoIXGYB3gWTtUts%3D&sig=AOq0QJ8wRQIgWpC7pdIdU19nm29yS-fMoSENeFPLLhtMg-sH_9BM2ocCIQC6wBSJvA8EJcwNQAVHiJ3ZHVF9KWIzzJSUQwYkG98vxA%3D%3D

from spotube.

nank1ro avatar nank1ro commented on July 28, 2024

If I go with the browser without the .mp3 added I can listen to the song.

from spotube.

KRTirtho avatar KRTirtho commented on July 28, 2024

I found out the actual issue is Mac OS & iOS CoreAudio not supporting WebMedia codec aka webm, weba & webp in previous versions. Spotube was pulling the audio/webm audio file to get best possible bitrate but it doesn't work on all Macs currently

I've updated the code to pull only audio/mp4 audio in Macs which comes with a downside of having 140 kbps bitrate instead 251 kbps of the audio/webm

Please, pull from git & see if audio works now or not

from spotube.

KRTirtho avatar KRTirtho commented on July 28, 2024

Glad it worked

from spotube.

PranavBhattarai avatar PranavBhattarai commented on July 28, 2024

Taiko2k/Tauon#717 (comment)
@KRTirtho
Am I curious:

  1. Are we downloading the songs in " DASH MP4's" codec and renaming the file to .mp3 because of this issue?
  2. If so, then why are doing it the wrong way to 'get the things' done?!

from spotube.

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.