@apollosproject/react-native-airplay-btn

0.2.0 • Public • Published

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.airPlayAvailable = AirPlayListener.addListener('airplayAvailable', devices => this.setState({
      airPlayAvailable: devices.available,
})); --> returns a boolean

this.airPlayConnected = AirPlayListener.addListener('airplayConnected', devices => this.setState({
      airPlayConnected: devices.connected,
})); --> returns 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';

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

Note: The AirPlay Button does not show in the simulator

Author

Nadia Dillon

Package Sidebar

Install

npm i @apollosproject/react-native-airplay-btn

Weekly Downloads

0

Version

0.2.0

License

MIT

Unpacked Size

158 kB

Total Files

74

Last publish

Collaborators

  • apollosadmin
  • nathanlewis.differential
  • yungvincenzo
  • conrad_vanl
  • redreceipt
  • didevshop