Closed RN-Dev-Shubh closed 9 months ago
import {useState, useRef} from 'react';
import JWPlayer from 'react-native-jw-media-player';
import {Platform, View} from 'react-native';
const App = () => {
const config = {
license:
Platform.OS === 'ios'
? 'yFmYnxEM3mJy7NnlIVaNTaSc1cHSQuIPpp4HfERZgu2rrl/bANSFezjhYS8CKEm7'
: 'v7p4bJIubZzH+CKlrh9VklPoeUC2lNIhBtye5YQtFdwCaV9SIJghFTc7PeELz0Hu',
playlist: [
{
mediaId: '1',
file: 'http://content.bitsontherun.com/videos/3XnJSIm4-injeKYZS.mp4',
autostart: false,
adVmap: 'http://playertest.longtailvideo.com/adtags/vmap2.xml',
adClient: 1,
},
],
styling: {
colors: {},
},
};
const JWPlayerRef = useRef(null);
const onSetupPlayerError = event => {
console.error('Setup Player Error:', event);
};
return (
<View style={{width: '100%', height: 200, backgroundColor: '#000'}}>
<JWPlayer
ref={JWPlayerRef}
stretching="uniform"
style={{width: '100%', height: 200, backgroundColor: '#000'}}
config={config}
onSetupPlayerError={onSetupPlayerError}
/>
</View>
);
};
this code is working properly.
can u guide me finding the android SDK Key and IOS SDK KEY in JW player dashboard please?
import {useState, useRef} from 'react'; import JWPlayer from 'react-native-jw-media-player'; import {Platform, View} from 'react-native'; const App = () => { const config = { license: Platform.OS === 'ios' ? 'yFmYnxEM3mJy7NnlIVaNTaSc1cHSQuIPpp4HfERZgu2rrl/bANSFezjhYS8CKEm7' : 'v7p4bJIubZzH+CKlrh9VklPoeUC2lNIhBtye5YQtFdwCaV9SIJghFTc7PeELz0Hu', playlist: [ { mediaId: '1', file: 'http://content.bitsontherun.com/videos/3XnJSIm4-injeKYZS.mp4', autostart: false, adVmap: 'http://playertest.longtailvideo.com/adtags/vmap2.xml', adClient: 1, }, ], styling: { colors: {}, }, }; const JWPlayerRef = useRef(null); const onSetupPlayerError = event => { console.error('Setup Player Error:', event); }; return ( <View style={{width: '100%', height: 200, backgroundColor: '#000'}}> <JWPlayer ref={JWPlayerRef} stretching="uniform" style={{width: '100%', height: 200, backgroundColor: '#000'}} config={config} onSetupPlayerError={onSetupPlayerError} /> </View> ); };
this code is working properly.
Please give any solution for this