vfsfitvnm / ViMusic

An Android application for streaming music from YouTube Music.
GNU General Public License v3.0
9.12k stars 901 forks source link

Cast audio #158

Closed Reed-Schimmel closed 2 years ago

Reed-Schimmel commented 2 years ago

Feature description

Add functionality to cast music to devices like smart TVs. I use SmartTube on my smartTV so that could grab the YouTube music link without needing a YouTube music account.

Why do you want this feature?

Required to reach feature parity with standard music streaming apps. I also want to play music on my TV.

Additional information

No response

vfsfitvnm commented 2 years ago

Unfortunately I won't implement that. Please read #38

Jak2k commented 2 years ago

Why not implement it for KODI? That's FOSS.

vfsfitvnm commented 2 years ago

@Jak2k Do you have some resources for that? Also, I don't have such device so I couldn't implement it anyway

Jak2k commented 2 years ago

In NewPipe it's handeled by the Kore-App:

public static void playWithKore(final Context context, final Uri videoURL) {
        final Intent intent = new Intent(Intent.ACTION_VIEW);
        intent.setPackage(context.getString(R.string.kore_package));
        intent.setData(videoURL);
        intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        context.startActivity(intent);
    }

You can download Kodi on: https://kodi.tv/download It even runs on Windows.

vfsfitvnm commented 2 years ago

@Jak2k That's not casting. It just forwards the casting problem to a third party app. Moreover, it requires a video url, which I don't necessarily have as the playback often relies on the cache (i.e. private disk files).

caveman1973 commented 2 years ago

I use AirMusic app to play from my Android to my Apple HomePod. Maybe it'll work to play on your TV.

CrepeTF commented 2 years ago

There is a MicroG version of the API

https://github.com/microg/GmsCore/tree/master/play-services-cast-api

vfsfitvnm commented 2 years ago

@CrepeTF Thanks, I will take a look.

vfsfitvnm commented 2 years ago

I'm leaving here other resources I found for general purpose casting (google cast excluded).

https://developer.android.com/training/connect-devices-wirelessly/wifi-direct https://github.com/android/media-samples https://developer.android.com/guide/topics/media/mediarouter https://android-doc.github.io/guide/topics/media/mediarouter.html https://github.com/aabaker/controldlna

Keywords: upnp, dlna.

matchboxbananasynergy commented 2 years ago

I would personally be against implementing anything that has to do with MicroG. It's a niche thing that has a lot of issues. One thing I love about this app is that it doesn't try to implement every little thing that people want, and as a result, the app is simple, clean and effective.

vfsfitvnm commented 2 years ago

microG or third party libraries won't be used. If it can be done using the android sdk, I'm not personally against it

vfsfitvnm commented 2 years ago

That said, I have zero knowledge in this field and I never used it once in my life, so I will implement it only if it requires zero effort

vfsfitvnm commented 2 years ago

Tracking in #597