cordova-plugin-opentok
cordova-plugin-opentok copied to clipboard
OpenTok Cordova initPublisher not consistent with OpenTok JS
Latest OpenTok JS has the initPublisher function with following parameters:
OT.initPublisher(targetElement, properties, completionHandler)
But, OpenTok Cordova plugin expects something like;
OT.initPublisher(apiKey, targetElement, properties)
It would be great to have Cordova plugin APIs up to date, so that we can use same code in both web and mobile apps...
+1
Hi @ertanden, I'm currently using the 64bit that aullman posted on his repo (posted just a 1 or 2 months ago) and I'm using the 1st version of initPublisher that you've posted except that it's not from the OT object but from the TB object. Cordova version uses the TB not OT object.
TB.initPublisher(targetElement, properties, completionHandler)
Hope this helps.
Hi @byronalfonso, changes from @aullman are already merged into this repository as far as I see and the problem is the same.
I don't think TB object or OT object makes a difference. But anyways, OT is the new official object by the latest OpenTok documentation.
I would really like to have first class Cordova support for OpenTok with fully sync APIs.
As I've mentioned.. I'm using an older version of the Opentok Cordova and on that version, I'm calling the initPublisher that way and it works for me... Btw, regarding the support, I think I've read somewhere in the Opentok forums that Cordova is not "officially" supported by the Opentok/Tokbox team, I'm not 100% though if this is the case right now as I don't have the link for that discussion anymore and I can't remember the date. Anyways.. I'm glad to know that aullman's version has been merged already I've actually been wanting and planning to update one of these days.. Thanks for the info!
- Yes my 64-bit version has been merged into this repo.
- This plugin is not officially supported by OpenTok even though some of the maintainers are on the OpenTok team. We are basically working on it in our spare time at the moment. We would love to get a community of contributors helping to maintain it.
- For the main question about the different initPublisher API's, you're right we have changed the spec so you no longer require the apiKey for the official OpenTok. But the old way still works, so if you want to single source your code you can just use the old way that the cordova plugin works and it should work for the official opentok.js as well because it's backwards compatible. Unfortunately there is no completionHandler though. We should add that. Again, would love for anyone to contribute that if they have the time.
Hi @aullman. Thanks for the clarification! :+1: I would love to contribute in any way I can but I can't with the current level of expertise I have on this matter. Hopefully I get better and be able to in the future. Let's see :)
Thanks for clarifications @aullman. I would like to contribute, but it's not always possible because of tight project schedules. I would love to see official support for Cordova from OpenTok.
We should all be focused on this repo, which is easilier maintained by everyone: https://github.com/aoberoi/cordova-plugin-opentokjs