googlecast / castandroidtvreceiver Goto Github PK
View Code? Open in Web Editor NEWReference Cast Android TV Receiver: CastAndroidTvReceiver shows how to develop a Cast Connect-enabled Android TV app.
License: Apache License 2.0
Reference Cast Android TV Receiver: CastAndroidTvReceiver shows how to develop a Cast Connect-enabled Android TV app.
License: Apache License 2.0
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).
View this failed invocation of the CLA check for more information.
For the most up to date status, view the checks section at the bottom of the pull request.
Originally posted by @google-cla[bot] in #5 (comment)
I can cast everything to Google TV cast using wifi , which I can cast to Google TV cast using mobile hotspot
, Except screen cast which doesn't work when I cast through any broadband wifi but works when I cast using mobile hotspot. This issue has not been noticed by Google till now , pls fix it.(I screen cast using Google Home app)
I need help here, as I don't own an android tablet or TV, but I want to disable ALL google cast functions
為自己的 ATV 應用程式啟用 Cast Connect,你必須在 Cast Developer Console 中新增 Android TV 應用程式的套件名稱,以便與你的 Cast App ID 建立關聯。但是我新增後,再次打開Android TV 應用程式的套件名稱就會被移除,這樣是正常嗎?
Senders do not see this receiver in the same network.
I was watching the Cricket World Cup on my Wi-Fi network when I tried to cast it to my Android TV on the same Wi-Fi network it suddenly disconnected.
Hi!
I implemented CastConnect in my app and it works quite well however we are encountering a behaviour that also this example has. Once you're casting a Video and it's playing on the Android TV app, if you click again on Casting icon on the mobile device and click on Stop casting, the mobile app disconnects successfully but the Android TV app continues playing. Is there a way to pause/stop the video on the Android TV app once this happens?
I want to open android tv app when casting from sender app , but it always opening the web receiver .
I followed this codelab Cast Connect with ATV App and this codelab for Cast-enable an Android app , After that
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.INTERNET" />
<queries>
<intent>
<action android:name="android.intent.action.VIEW" />
<data android:mimeType="video/* , application/x-mpegURL" />
</intent>
</queries>
<application
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:networkSecurityConfig="@xml/network_security_config"
android:protectionLevel="signature"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.JMXPlayer"
android:usesCleartextTraffic="true"
tools:ignore="UnusedAttribute">
<meta-data
android:name="com.google.android.gms.ads.AD_MANAGER_APP"
android:value="true" />
<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
<meta-data
android:name="com.google.android.gms.cast.framework.OPTIONS_PROVIDER_CLASS_NAME"
android:value="com.stream.jmxplayer.casty.CastOptionProvider" />
<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
Sender Option Provider class
public class CastOptionProvider implements OptionsProvider {
@Override
public CastOptions getCastOptions(Context context) {
CastOptions customCastOptions = Casty.customCastOptions;
if (customCastOptions == null) {
List<String> buttonActions = createButtonActions();
int[] compatButtonAction = {1, 3};
NotificationOptions notificationOptions = new NotificationOptions.Builder()
.setActions(buttonActions, compatButtonAction)
.setTargetActivityClassName(ExpandedControlsActivity.class.getName())
.build();
CastMediaOptions mediaOptions = new CastMediaOptions.Builder()
.setNotificationOptions(notificationOptions)
.setExpandedControllerActivityClassName(ExpandedControlsActivity.class.getName())
.build();
LaunchOptions launchOptions = new LaunchOptions.Builder()
.setRelaunchIfRunning(true)
.setAndroidReceiverCompatible(true).build();
return new CastOptions.Builder()
.setReceiverApplicationId(Casty.receiverId)
.setCastMediaOptions(mediaOptions)
.setLaunchOptions(launchOptions)
.build();
} else {
return customCastOptions;
}
}
private List<String> createButtonActions() {
return Arrays.asList(MediaIntentReceiver.ACTION_REWIND,
MediaIntentReceiver.ACTION_TOGGLE_PLAYBACK,
MediaIntentReceiver.ACTION_FORWARD,
MediaIntentReceiver.ACTION_STOP_CASTING);
}
@Override
public List<SessionProvider> getAdditionalSessionProviders(Context context) {
return null;
}
}
Receiver AndroidManifest.xml
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-feature
android:name="android.hardware.touchscreen"
android:required="false" />
<uses-feature
android:name="android.software.leanback"
android:required="true" />
<application
android:name=".JmxApplication"
android:allowBackup="true"
android:appComponentFactory="androidx.core.app.CoreComponentFactory"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:networkSecurityConfig="@xml/network_security_config"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.JMXPlayerCast">
<meta-data
android:name="com.google.android.gms.cast.tv.RECEIVER_OPTIONS_PROVIDER_CLASS_NAME"
android:value="com.stream.jmxplayercast.CastReceiverOptionsProvider" />
<activity
android:name=".ui.MainActivity"
android:banner="@drawable/main_logo"
android:label="@string/app_name"
android:launchMode="singleTask"
android:logo="@drawable/circle_cropped_logo"
android:screenOrientation="landscape">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LEANBACK_LAUNCHER" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="com.google.android.gms.cast.tv.action.LAUNCH" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".ui.PlayerActivity"
android:exported="true"
android:launchMode="singleTask">
<intent-filter>
<action android:name="com.google.android.gms.cast.tv.action.LOAD" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="http" />
<data android:scheme="https" />
<data android:mimeType="video/*" />
<data android:mimeType="application/*" />
</intent-filter>
</activity>
</application>
ReceiverOptionProver class is the vanilla codelab's option provider.
What have I done wrong and how to fix this .. Thanks in Advance
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.