Skip to content

wiliam-toney/react-native-airplay-btn

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

react-native-airplay-btn

AirPlay library for iOS

Installation with Automatic Linking

npm i react-native-airplay-btn --save
react-native link

How to create listeners

import { AirPlayListener } from react-native-airplay-btn

this.airplayAvailableSubscription = AirPlayListener.addListener('airplayAvailable', devices => this.setState({
      airPlayAvailable: devices.available, --> devices.available is a boolean
})); 

this.airplayConnectedSubscription = AirPlayListener.addListener('airplayConnected', devices => this.setState({
      airPlayConnected: devices.connected, --> devices.connected is a boolean
      airPlayMirroring: devices.mirroring, --> devices.mirroring is a boolean
}));


// Remove Listeners in componentWillUnmount
this.airPlayConnected.remove();
this.airPlayAvailable.remove()

Methods

  AirPlay.startScan();

  AirPlay.disconnect();

Create AirPlay Button

import { AirPlayButton } from 'react-native-airplay-btn';

<AirPlayButton style={{ height: 30, width: 30, justifyContent: 'center', alignItems:'center' }} />

Note: The AirPlay Button does not show in the simulator

Author

Nadia Dillon

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Objective-C 38.3%
  • JavaScript 31.0%
  • Python 15.2%
  • Java 9.5%
  • Ruby 6.0%