react-native-triton-player
TypeScript icon, indicating that this package has built-in type declarations

1.2.13 • Public • Published

react-native-triton-player

A react-native native module wrapper around the Triton iOS and Android SDKs.

Getting started

$ npm install react-native-triton-player --save

Mostly automatic installation

$ react-native link react-native-triton-player

Manual installation

iOS

  1. In XCode, in the project navigator, right click LibrariesAdd Files to [your project's name]
  2. Go to node_modulesreact-native-triton-player and add RNTritonPlayer.xcodeproj
  3. In XCode, in the project navigator, select your project. Add libRNTritonPlayer.a to your project's Build PhasesLink Binary With Libraries
  4. Run your project (Cmd+R)<

Android

  1. Open up android/app/src/main/java/[...]/MainActivity.java
  • Add import com.tritonsdk.RNTritonPlayerPackage; to the imports at the top of the file
  • Add new RNTritonPlayerPackage() to the list returned by the getPackages() method
  1. Append the following lines to android/settings.gradle:
    include ':react-native-triton-player'
    project(':react-native-triton-player').projectDir = new File(rootProject.projectDir, 	'../node_modules/react-native-triton-player/android')
    
  2. Insert the following lines inside the dependencies block in android/app/build.gradle:
      compile project(':react-native-triton-player')
    

Usage

import RNTritonPlayer from "react-native-triton-player";

RNTritonPlayer.playOnDemandStream(onDemandStreamUrl);

RNTritonPlayer.play(tritonName, tritonMount);

RNTritonPlayer.pause();

RNTritonPlayer.unPause();

RNTritonPlayer.stop();

RNTritonPlayer.addStreamChangeListener((currentTritonStreamData) => {
	//do something with currentTritonStreamData when it changes
});

RNTritonPlayer.addTrackChangeListener((currentTritonTrackData) => {
	//do something with currentTritonTrackData when it changes
});

RNTritonPlayer.addStateChangeListener((currentTritonStateData) => {
	//do something with currentTritonStateData when it changes
});

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.2.13
    1
    • latest

Version History

Package Sidebar

Install

npm i react-native-triton-player

Weekly Downloads

1

Version

1.2.13

License

none

Unpacked Size

10.4 MB

Total Files

188

Last publish

Collaborators

  • alexander.leitch
  • garnaph