Giter Club home page Giter Club logo

castandroidtvreceiver's People

Contributors

c0d3base avatar gomez-andres avatar jtromo avatar meihua avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

castandroidtvreceiver's Issues

Question: disconnect behaviour

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?

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).

    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)

[Cast Docs] Codelab

為自己的 ATV 應用程式啟用 Cast Connect,你必須在 Cast Developer Console 中新增 Android TV 應用程式的套件名稱,以便與你的 Cast App ID 建立關聯。但是我新增後,再次打開Android TV 應用程式的套件名稱就會被移除,這樣是正常嗎?

Casting Via Mobile Hotspot vs WiFi

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)

Android TV App isn't opening

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

  • I added my Chromecast as testing device in cast console
  • Signed the ATV app
  • Installed in tv box and tried to cast from the sender app , but it opens the web receiver not the ATV app
    Sender AndroidManifest.xml
        <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

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.