Skip to content

slavakoshevoi/react-native-airplay-btn

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

react-native-airplay-btn

AirPlay library for iOS

Installation with Automatic Linking

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

How to create listeners

import { AirPlayListener } from 'react-native-reaction-airplay';

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();

  // show window for select cast-receiver without button, programmatically
  AirPlay.showVolume()

Create AirPlay Button

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

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

Note: The AirPlay Button does not show in the simulator

Author

Reaction Club

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published