0.2.0 • Published 7 months ago
react-native-rn-tolkaplayer v0.2.0
react-native-rn-tolkaplayer
Tolkaplayer Add Permission in Android Manifest
Installation
npm install react-native-rn-tolkaplayer
Usage
<queries>
<package android:name="com.tolka.airialtv_atsc" />
</queries>
<uses-permission android:name="com.tolka.airialtv_atsc.permission.SURFACE_PLAYER" />
import { RnTolkaplayerView } from "react-native-rn-tolkaplayer";
import {
NativeEventEmitter,
NativeModules
} from 'react-native';
const { PlayerModule } = NativeModules;
const eventEmitter = new NativeEventEmitter(PlayerModule);
// ...
useEffect(() => {
const subscription = eventEmitter.addListener(
'EventFromAndroid',
(event) => {
// Event data on proxy server connection
console.log('Event Data', event.data);
}
);
const subscription1 = eventEmitter.addListener(
'ChannelFetchListEvent',
(event) => {
// Channel List data on proxy server connection
console.log('Channel List Data', event.data);
}
// Use this statement on view click to change the channel item
PlayerModule.setChannel(item);
// Use this statement to start the proxy service
PlayerModule.scan(true); // boolean use for debug true or false
return () => {
subscription.remove();
subscription1.remove();
};
}, []);
<RnTolkaplayerView
style={{
width: '100%',
backgroundColor: 'red',
height: 200,
}}
/>
Contributing
See the contributing guide to learn how to contribute to the repository and the development workflow.
License
MIT
Made with create-react-native-library