Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request for example repo or gist #1

Closed
jamesdeantv opened this issue Oct 27, 2017 · 13 comments
Closed

Request for example repo or gist #1

jamesdeantv opened this issue Oct 27, 2017 · 13 comments

Comments

@jamesdeantv
Copy link

jamesdeantv commented Oct 27, 2017

Hi there Prince. I arrived from the thread twilio/twilio-video.js#85

First, thanks for supplying the repo. Could you possibly provide an example repo of the plugin in a basic ionic app setup using the twilio programmable video sdk. The latest version as of this issue is "twilio-video": "1.5.0" I've tried implementing the plugin, but Im having trouble registering it in a page. It isn't explicitly stated how to declare the plugin.

For example:
declare const TwilioVideoPlugin;
declare const VideoConversationPlugin;
declare const cordova.videoconversation;
declare const cordova-plugin-twilio-video;
import * as ? from ?;

You stated in the readme to
Get token And Call the API cordova.videoconversation.open( RoomName: string, Token: string);

So, do you mean to first request the token from the server and then run
cordova.videoconversation.connect( RoomName: string, Token: string)

I ask this because the latest twilio video api doesn't contain a method or global called open.

Even a single gist showing the plugin being declared and then called in the export class would suffice.

Thanks again.

@jamesdeantv jamesdeantv changed the title Request for example repo Request for example repo or gist Oct 27, 2017
@PriceFallin
Copy link
Owner

I'm assuming you're referencing an Ionic 2/3 app.

I was able to successfully implement this in an Ionic v1 app, but haven't implemented it in Ionic 2/3 yet. I do plan on doing that soon though. Also, this plugin is built for both version so I would imagine it would work.

Try declaring 'cordova' in the head of the source file where you want to use the plugin. You might have to rename it to something else like 'cordova-video-call' throughout the plugin (ex. cordova-video-call.videoconversation.open...). You can just declare it with:
declare var cordova: any

or if you change the name:
declare var cordova-video-call : any

The open command is just the function name we decided to use in the javascript that connects to the native code.

I don't have an example just yet but when I finally get this working in my Ionic3 app I'll try to send some more info if you're still having trouble. Hopefully this is helpful for you.

-Price

@smuaq
Copy link

smuaq commented Oct 29, 2017

Thanks for supplying the repo @PriceFallin ! I've been using my own improved implementation of opentok plugin for video chats for over a year now. Would you be able to supply a sample running app (ionic 1) I would love to do a performance/usability test for twilio vs opentok. Thanks again!

@jamesdeantv
Copy link
Author

I was able to successfully get up and running with the help of your repo. Thanks!

@PriceFallin
Copy link
Owner

Hi @smuaq, I don't have a demo set up that I can provide. For this you'll need to just build your own, although all you really should need is a simple button that would call the cordova function to start the video chat. Of course you would also need to either set up your own server to get a token/roomID or generate one from Twilio's video tool console.

@jamesdeantv Glad you got it working!

@smuaq
Copy link

smuaq commented Nov 3, 2017

Great thanks!

@WisaniShilumani
Copy link

@jamesdeantv mind sharing your code?

@PriceFallin
Copy link
Owner

@WisaniShilumani I actually started working on an ionic3 app now with the plugin and was able to get it working with my new build.

Here's some tips:

  • Before you install the plugin, put it in a directory in your project. For example, I put mine in /plugin-src. Then when you're ready to install run ionic cordova plugin install /path/to/plugin --nofetch (the no fetch flag basically let's ionic know that there is no npm registry for the plugin.
  • Declare cordova in the class file that you want to use it in: declare const cordova: any;. This will expose cordova and the attached videoconversation methods to it so that you can call it by using cordova.videoconversation.open(...). I have my plugin named different so if cordova doesn't work then you can rename it throughout the plugin as I mentioned earlier in this thread.

Hope this helps!

@WisaniShilumani
Copy link

@PriceFallin Thanks a million! That's super helpful. I managed with the typescript work, but later ran into problems with cordova 7. It didn't like the hyphens in the AndroidManifest.xml file during the build. The android:name="cordova-plugin-twilio-video.ConversationActivity" in particular.

I replaced all hyphens with points, and it's working fine now. Thanks for the plugin, been struggling with video calling for over 3 months now!

@jamesdeantv
Copy link
Author

Glad to hear you got things sorted.

@dzungcao
Copy link

dzungcao commented May 6, 2018

Hi @WisaniShilumani, would you mind to share with me how you did the change on hyphens ?

Thank you very much.

@cavalryjim
Copy link
Contributor

cavalryjim commented Jun 19, 2018

@WisaniShilumani or @dzungcao, can you share the solution to the hyphens error? I have the plugin working with iOS and recently added the Android platform to my project. When trying to build, I receive:

AndroidManifest.xml:68: Tag <activity> attribute name has invalid character '-'.

Are you suggesting renaming the plugin? Uninstall, rename, & reinstall?

// plugin.xml
<plugin 
    id="cordova.plugin.twilio.video"
    version="0.2.0" 
    xmlns="http://apache.org/cordova/ns/plugins/1.0"
    xmlns:android="http://schemas.android.com/apk/res/android">
  ....
</plugin>

Thanks!

@WisaniShilumani
Copy link

@cavalryjim No need to uninstall. Replace hyphens with points at both platform and plugin level. I did a search & find and made the changes at both levels. I recently made a switch to WebRTC and don't have a record of the changes, sorry about that.

PriceFallin pushed a commit that referenced this issue Oct 26, 2018
@cavalryjim
Copy link
Contributor

Posting this only to help anyone experiencing the '-' hyphen issue...
I created a renamed version that works with:

$ java -version
java version "1.8.0_131"
$ npm --version
5.7.1
$ ionic --version
3.20.0
$ cordova --version
7.1.0

https://github.com/cavalryjim/videoCordovaPluginTwilioVideo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants