Chromecast & Air for Android Apps (AS3)

2019-09-03 12:08发布

问题:

Anyone one know a simple way to use / intergrate a chromecast sender for my Air for Android Apps so they can cast directly to a TV.

I've done a few successful tests on webpages.
but as for intergrating the code into an entirely AS3 project, I don't know were to begin? and I can't seem to find any docs on how to do this.

Thank you in advance for your help.

回答1:

There in an Air Native Extension that handles this: ANE-Chromecast on Github



回答2:

The ANE on Github is not a solution (line 19 of AirCast.as specifically excludes Android).

More fundamentally, even after re-engineering the ANE to get around the original block, it is currently not possible to get a reference to android.os.Bundle (which is required) as the class is not reachable, no matter how many SDK jars you build into the ANE.

Until there is a means to get the bundle, then this call will always fail:

CastDevice mSelectedDevice = CastDevice.getFromBundle(route.getExtras());

With:

java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/cast/CastDevice;

But if anybody can get around this, please let me know as I would dearly like to get there...