gaganinvic / cordova-plugin-jitsi-meet

Cordova plugin for jitsi meet react native sdk
10 stars 58 forks source link

How to use the library #2

Open rfvermut opened 6 years ago

rfvermut commented 6 years ago

I have a really amateur question - how to start using the library?

I've created a blank ionic project.

Then I run ionic cordova plugin add https://github.com/gaganinvic/cordova-plugin-jitsi-meet and it worked. I see jitsi plugin in ionic cordova plugin:

cordova-plugin-device 2.0.2 "Device"
cordova-plugin-geolocation 4.0.1 "Geolocation"
cordova-plugin-ionic-keyboard 2.1.2 "cordova-plugin-ionic-keyboard"
cordova-plugin-ionic-webview 2.0.3 "cordova-plugin-ionic-webview"
cordova-plugin-jitsi 0.0.1 "JitsiPlugin"
cordova-plugin-splashscreen 5.0.2 "Splashscreen"
cordova-plugin-statusbar 2.4.2 "StatusBar"
cordova-plugin-whitelist 1.3.3 "Whitelist"

But what's next? Do I import it in ts like

import { JitsiPlugin} from 'cordova-plugin-jitsi';

or I have to use cordova approach, like here? https://forum.ionicframework.com/t/integrating-third-party-cordova-plugins-and-using-in-ionic/91044

Or maybe you can provide a working sample? The most primitive one, just to bootstrap me?

iverdugocl commented 5 years ago

I have that question too. I don't know how to use this library. Can you help us please with examples

gaganinvic commented 5 years ago

The jitsi plugin opens the view on top of your current view. So you would need to import it in your typescript file and use it.

Code Snippet

declare var jitsiplugin:any;

export class TestPage { ngOnInit() { jitsiplugin.loadURL(${room_url}, null, (data) => { if(data === "CONFERENCE_WILL_LEAVE"){ jitsiplugin.destroy((data) => { console.log("Destroy"); }, (err) => { console.log("Error"); }); } }, (err) => { console.log("Error : ", err); }); } }

// room url can be like https://meet.jit.si/${roomName} or https://meet.jit.si/${roomName}?jwt=${jwt}

wkingredxx123 commented 5 years ago

I used "declare var jitsiplugin:any;" "the command calls jistiPlugin into my ionic project, but the page in the project shows an error with not define, the plug-in can be found in the npm file, but why am I still unable to use this plug-in? Can you help me analyze why? I hope you can answer, thank you!