gianlucaparadise / flutter_cast_framework Goto Github PK
View Code? Open in Web Editor NEWGoogle Cast SDK for flutter
Home Page: https://gianlucaparadise.github.io/flutter_cast_framework/api/
License: Apache License 2.0
Google Cast SDK for flutter
Home Page: https://gianlucaparadise.github.io/flutter_cast_framework/api/
License: Apache License 2.0
In my case I'm casting from Dart server so it is dart native without flutter
I found a package that supports dart native and added some features in my fork
https://github.com/guyluz11/flutter_cast.git
Branch: multicast_version
First of all you can take a look at my code and the example, it may help you add new features that I've already implemented and are missing.
Actually I found online a way to cast YouTube videos but the implementation isn't complete yet.
So if you would like to join forces and collaborate it would be lovely.
Cloning the repo and running the example as is for Android results in this:
$ flutter run
Launching lib/main.dart on Pixel 3a in debug mode...
Warning: Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01
Warning: Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01
WARNING: [Processor] Library '/home/ryan/.gradle/caches/modules-2/files-2.1/com.google.android.gms/play-services-cast-framework/19.0.0/d727dd9aaa31788c9922c1acf2768ac1d5412398/play-services-cast-framework-19.0.0.aar' contains references to both AndroidX and old support library. This seems like the library is partially migrated. Jetifier will try to rewrite the library anyway.
Example of androidX reference: 'androidx/annotation/Keep'
Example of support library reference: 'android/support/v4/media/session/MediaSessionCompat$Token'
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:checkDebugAarMetadata'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.CheckAarMetadataWorkAction
> The minCompileSdk (31) specified in a
dependency's AAR metadata (META-INF/com/android/build/gradle/aar-metadata.properties)
is greater than this module's compileSdkVersion (android-30).
Dependency: androidx.window:window-java:1.0.0-beta04.
AAR metadata file: $HOME/.gradle/caches/transforms-2/files-2.1/b9ffbccb3e6a1141b85ad36406ba0090/jetified-window-java-1.0.0-beta04/META-INF/com/android/build/gradle/aar-metadata.properties.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 2m 8s
Running Gradle task 'assembleDebug'... 129.2s
┌─ Flutter Fix ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ [!] Your project requires a higher compileSdkVersion. │
│ Fix this issue by bumping the compileSdkVersion in /home/ryan/projects/flutter_cast_framework/example/android/app/build.gradle: │
│ android { │
│ compileSdkVersion 31 │
│ } │
└─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
Exception: Gradle task assembleDebug failed with exit code 1
I have tried the demo example on both Android and IOS.
IOS - have added the Bonjour Service (_googlecast._tcp, _4F8B3483._googlecast._tcp)
Andorid - Changed the recieverapplication id to CC1AD845 (the default receiver id)
The cast button is greyed and when I click on it, it opens a searching for devices prompt on Android. And a white prompt with no text on IOS.
On IOS, I get this error on the console:
+[GCKNNetworkUtils getTwoLowerBytesFromNetworkAddress:] - Invalid network address
-[GCKNUDPSocket sendPacket:toAddress:] - Failed to sendto Errno=65
Any help will be highly appreciated :) Thank you!
The released version has the following deprecated dependencies:
api "com.google.android.gms:play-services-cast-framework:19.0.0"
Thank you
I'm unable to build the example. I'm on Flutter 3.0.5. I get the following error.
apps\plugins\flutter_cast_framework\android\src\main\java\com\gianlucaparadise\flutter_cast_framework\PlatformBridgeApis.java:1158: error: lambda expressions are not supported in -source 7
channel.setMessageHandler((message, reply) -> {
^
(use -source 8 or higher to enable lambda expressions)
2 errors
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':flutter_cast_framework:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.
When I run the example on my Google Pixel 3a, and click the Chromecast button, it shows a dialog where it searches for Chromecast devices. That dialog searches forever without success. The Chromecast is on, and other apps can discover it.
Hello,
i have an app that is working on multiple but one device..
The device is Realme GT Master Edition (RMX3363), Android 13 (June 5, 2023)
I click the cast button and then select a chromecast device.. the app crashes with following log:
Process: sk.maniacs.versecast, PID: 27562
E/AndroidRuntime(27562): java.lang.IllegalArgumentException: [xxxx MY APP PACKAGE xxxx]: Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent.
E/AndroidRuntime(27562): Strongly consider using FLAG_IMMUTABLE, only use FLAG_MUTABLE if some functionality depends on the PendingIntent being mutable, e.g. if it needs to be used with inline replies or bubbles.
E/AndroidRuntime(27562): at android.app.PendingIntent.checkFlags(PendingIntent.java:402)
E/AndroidRuntime(27562): at android.app.PendingIntent.getBroadcastAsUser(PendingIntent.java:672)
E/AndroidRuntime(27562): at android.app.PendingIntent.getBroadcast(PendingIntent.java:659)
E/AndroidRuntime(27562): at l3.n.j(Unknown Source:78)
E/AndroidRuntime(27562): at k3.c$a.a(Unknown Source:92)
E/AndroidRuntime(27562): at com.google.android.gms.common.api.internal.BasePendingResult$a.handleMessage(Unknown Source:60)
E/AndroidRuntime(27562): at android.os.Handler.dispatchMessage(Handler.java:106)
E/AndroidRuntime(27562): at b4.d.dispatchMessage(Unknown Source:0)
E/AndroidRuntime(27562): at android.os.Looper.loopOnce(Looper.java:240)
E/AndroidRuntime(27562): at android.os.Looper.loop(Looper.java:351)
E/AndroidRuntime(27562): at android.app.ActivityThread.main(ActivityThread.java:8381)
E/AndroidRuntime(27562): at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(27562): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:584)
E/AndroidRuntime(27562): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1013)
Is there any way to fix this?
i want to ask if i can use this to cast audio to chromecast
hello, do this plugin have cast discovery?
The error is Error fetching queue item ids, statusCode=2001, statusMessage=null.
Would there be a solution for my mistake?
As per Android/Chromecast requirement, please implement a possibility to display Introductory Overlay on Chromecast button.
Thank you for this great plugin!
Thank you! :)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.