Code Monkey home page Code Monkey logo

react-native-google-cast's Introduction

npm version

react-native-google-cast

This library wraps the native Google Cast SDK for Android and iOS, providing a unified JavaScript interface.

It is written in TypeScript so types will always be up-to-date.

Migration to v4 is a work in progress. If some functionality does not exist yet, please open a ticket or make a pull request :)

Version overview

RNGC React Native Purpose
1.x Not sure :) Old version implemented for Google Cast SDK v2 with manual discoverability. Not maintained anymore.
3.x >=0.40 Rewrite of the library for Google Cast SDK v3 with automatic session management. Only bug fixes will be merged.
4.x >=0.60* Current version with a completely rewritten API, closely resembling native Android/iOS(/Chrome?) APIs. We highly recommend to use the latest version.

* While v4.x is built with the latest changes in RN 0.60 (auto-linking, AndroidX, CocoaPods), you might still be able to use it with an older RN version by using jetifier (and vice versa for 3.x)

Documentation

TODO link

Example

Refer to the example folder to find a React Native version of the CastVideos reference app.

Playground

Refer to the playground folder to find a sample app demonstrating the available APIs provided by the library.

Troubleshooting

  • Android: com.google.android.gms.dynamite.DynamiteModule$zza: No acceptable module found. Local version is 0 and remote version is 0.

    You don't have Google Play Services available on your device. Make sure to install them either from http://opengapps.org/ or follow tutorials online.

    TODO: Handle gracefully and ignore the Cast library without crashing.

  • Android: If you're having version conflicts of the appcompat (or google play services) libraries, make sure you set versions globally in your project's top-level build.gradle:

    buildscript {
      ext {
        buildToolsVersion = '28.0.3'
        minSdkVersion = 16
        compileSdkVersion = 28
        targetSdkVersion = 28
        supportLibVersion = '28.0.0'
        castFrameworkVersion = '16.1.2'
      }
      ...
    }
  • Android* java.lang.IllegalStateException: The activity must be a subclass of FragmentActivity

    Make sure your MainActivity extends GoogleCastActivity, AppCompatActivity, or some other descendant of FragmentActivity.

Contribution

  1. Contributions are welcome!
  2. Fork the repo.
  3. Implement your shiny new thing.
  4. Demonstrate how to use it in the example project.
  5. Document the functionality in the README (here).
  6. PR

react-native-google-cast's People

Contributors

petrbela avatar james-relyea avatar vmseba avatar estebanr92 avatar jwebcat avatar dracoblue avatar codetony25 avatar

Watchers

James Cloos avatar Daniel Smith avatar  avatar David Chang 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.