Giter Club home page Giter Club logo

android_library_screen_mirroring_chromecast's Introduction

Chromecast screen mirroring integration

Resume

It is a very specific developement.
To start using this library you need a chromecast link to your TV and a phone, both on the same Wifi.
(cf. see Google Home application to configure your chromecast TV)
Then, you can start screen mirroring your phone on your chromecast TV.

Understand

There is 2 types of chromecast :

  • remote control mode : you send a one time signal with an url and your chromecast TV will connect to the link through an TV app (netflix, youtube, ...) and start streaming your content from that url
  • screen mirroring mode : you start a connection with your chromecast TV and your phone will start streaming a copy of your screen.

This library is about the screen mirroring functionnality. But first pay attention to configuration :

  • first, make sure you have a chromecast connected to your TV
  • second, configure your chromcast with Google Home application
  • third, make sure your chromcast and your phone are on the same wifi
  • forth, test screen mirroring with Google Home application (left panel > cast screen or audio > cast screen button)
  • finally, implement my library to copy the functionnality

Import library

   dependencies {
      compile 'fr.vincent.chann:screencast:1.0.4'
   }

Integration

   public class MainActivity extends AppCompatCastScreenActivity {
   
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        
        Button buttonCast = (Button) findViewById(R.id.start);
        buttonCast.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                // start cast
                startScreenCast();
            }
        });

        Button stopCast = (Button) findViewById(R.id.stop);
        stopCast.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                // stop cast
                stopScreenCast();
            }
        });
    }
}

android_library_screen_mirroring_chromecast's People

Contributors

channvincent avatar

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.