cordova-plugin-opentok icon indicating copy to clipboard operation
cordova-plugin-opentok copied to clipboard

opentok.js is not working ionic2

Open vsrboth opened this issue 8 years ago • 8 comments

I am trying to use this cordova plugin for ionic2 project; unfortunately, I am unable to make it. It doesn't seem to work. Please kindly find the following code example:

import { Component } from '@angular/core';
import { OpentokService } from '../../services/opentok-service';

declare var TB: any;

this.session = TB.initSession(this.apiKey, this.sessionId);
    this.session.on('streamCreated', (event) => {
      this.session.subscribe(event.stream, 'subscriber', {
        insertMode: 'append',
        width: '100%',
        height: '100%'
      });
    });

    this.session.on('sessionDisconnected', (event) => {

    });

    this.session.connect(this.token, (error) => {
      if (!error) {
        let publisher = TB.initPublisher('publisher', {
          insertMode: 'append',
          width: '100%',
          height: '100%'
        });

        this.session.publish(publisher);
      } else {
        alert('There was an error connecting to the session' + error.message);
      }
    });

Can anyone offer a hand on this? Thank you so much.

vsrboth avatar Feb 06 '17 13:02 vsrboth

Hello Dear,

Is your solution for opentok working with ionic 2 ? I'm also updating mine and getting issue.

Thanks

B Mavi

bmavi avatar Apr 26 '17 23:04 bmavi

@bmavi sorry for late. I have found a way to make it working using opentok.js framework instead of this cordova plugin.

It's quite easy to integrate opentok.js in ionic2 :) Be sure to check permission on your android mobile phone during your development (run on a physical android device).

vsrboth avatar May 09 '17 09:05 vsrboth

Hi @vsrboth Can you give me an example of how to integrate opentok with Ionic 2 ?? I've been trying for some time, and I'm not doing it

jomora15 avatar May 30 '17 14:05 jomora15

Please, I also need help on integrating on Ionic2. I'm running on a device; the device cant find opentok.js

andreportaro avatar Oct 19 '17 13:10 andreportaro

Hey @vsrboth @jomora15 @bmavi @andreportaro here's a basic 1:1 application using OpenTok and Ionic: https://github.com/opentok/opentok-ionic-samples

You have to run ionic serve so opentok.js can be copied into your www folder. After that, you can prepare for the platform.

You can also find the updated plugin using OpenTok iOS and Android 2.12.0 SDKs here: https://github.com/opentok/cordova-plugin-opentok

Please also note that not all of the publisher properties such as insertMode are available. The supported properties are listed here: https://github.com/opentok/cordova-plugin-opentok/blob/master/docs/ot.md#initPublisher

msach22 avatar Nov 29 '17 06:11 msach22

Have any of you tried and made Tokbox annotations work with iOS? In Android it works fine but in the latest version 10.3.3 of iOS using TokBox SDK Version 2.12.1 our Cordova app crashes when opening the video call. This only happens if the other party on the web has annotations turned on. If the annotations are off then no crash. Strange issue!

Error logs reveal a bunch of runtime memory related issues with only human readable information was "AudioToolbox". We thought this may be a permission issue but couldn't explain why it worked when annotations are turned off.

Note: Annotations have never worked in iOS. We can't seem to get the annotation layer on top of Tokbox video layer. This makes sense as the video player is not probably HTML based.

sm20030 avatar Dec 12 '17 19:12 sm20030

Never mind, looks like annotations are not supported even as a feature yet.

https://github.com/opentok/accelerator-annotation-js/issues/41

sm20030 avatar Dec 12 '17 22:12 sm20030

@sm20030 Any luck solving this problem? we are also experiencing it. We can enter an already started call but whenever a new stream is created our iOs app crashes?

I see that you mention annotations, how do we turn these off?

mfossel avatar Feb 05 '18 23:02 mfossel