Giter Club home page Giter Club logo

cordova-plugin-opentok's Introduction

Cordova Plugin for OpenTok iOS and Android

Tokbox is now known as Vonage

Disclaimer: This plugin is based on the Cordova OpenTok Plugin. Please keep in mind that this is an OpenTok Labs project which means that it's not officially supported by Vonage.

Sample code

To see the plugin in action, please check out opentok-cordova-samples.

Using Cordova CLI

Make sure You have Cordova 3.5.0 or greater installed. If you haven't, take a look at the Cordova instructions Page.

  1. Clone this repo to get the source code for the OpenTok Cordova plugin

  2. To install the OpenTok Cordova plugin, run the following command in the root of your project:

cordova plugin add cordova-plugin-opentok
  1. To remove OpenTok Cordova plugin 3.2.0 and above, use the following command:
cordova plugin remove cordova-plugin-opentok
  1. To remove the old OpenTok Cordova plugin, use the following command:
cordova plugin remove com.tokbox.cordova.opentok

Getting Started on your Project:

All your editing will be done in your www folder.

To use the opentok library, make sure you include opentok.js file in your HTML document.

<script type="text/javascript" charset="utf-8" src="opentok.js"></script>

All JavaScript code should be written in onDeviceReady function in /js/index.js because it is executed after all dependencies has loaded.

    onDeviceReady: function() {
        // Do Your Stuff Here!
    }

Development and Contributing

Interested in contributing? We ❤️ pull requests! See the Contribution guidelines.

Getting Help

We love to hear from you so if you have questions, comments or find a bug in the project, let us know! You can either:

cordova-plugin-opentok's People

Contributors

adamtreineke avatar amatakasap avatar anthonyzou avatar aoberoi avatar cadesalaberry avatar darkpgx avatar gacord23 avatar ggoldens avatar gitter-badger avatar jeffswartz avatar jkamke avatar liratanak avatar mark-veenstra avatar mattinsler avatar michaeljolley avatar msach22 avatar pardel avatar rishi-livewiretax avatar rishihahs avatar shaundon avatar songz avatar wobbals avatar wolfenrain avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cordova-plugin-opentok's Issues

Possibility to load Native Video behind the webview

It would be nice to be able to place the native camera's in front of or behind the webview based on the given z-index. Because if we could place the native video elements behind the webview we could also place HTML buttons on top of the video.

We have been successfull in placing the video behind the WebView with the Android and iOS , see branch:
https://github.com/Mediapioniers/cordova-plugin-opentok/tree/feat.cams_behind_webview_z-index

We got this technique from the cordova-plugin-qrscanner and cordova-plugin-iosrtc.

So if you use our branch, the camera will be placed below the WebView based on the z-index. So to be able to see the cams and buttons, you need make everything transparent in your DOM, for example:

# We can use class OT_root in our repository, but the main things is that the publisher container gets a black background color from OT, this needs to be removed in your CSS!
html, body, .OT_root {
  background: transparent !important;
}

# Each publisher and eachsubscriber video element should have display none
.OT_root video {
  display: none !important;
}

Also the inserted <video> tags for publishers and subsscribers in the DOM on Android need to get the style="display: none;.

When all is set you can have buttons on top of the video. See next screenshot:
screenshot_20180209-165551

#Crash: Android 4.4.4 setTranslationZ => java.lang.NoSuchMethodError

Hi guys,

I'm experiencing a crash in my Ionic-App on an Android 4.4.4 Tablet.
java.lang.NoSuchMethodError: android.view.View.setTranslationZ

This isn't a big suprise since there seem to be a few setTranslationZ calls, which are only supported since API level 21.

Is there any fallback for devices < Android 21? Or would a
if (android.os.Build.VERSION.SDK_INT >= 21)
around the setTranslationZ calls do the trick? I assume this would probably break the Z positioning(?)

EDIT:
We're using crosswalk and the cordova-plugin-opentok version 3.2.1

Best regards

Multiple Access Origins

Hi,

We are using cordova-plugin-opentok in one of our projects. And we have an requirement to set the access origin to only *.example.com.
But, while building the application, access-origin is also set to * (there are 2 access origins in our's application's config.xml)
We are assuming it is caused by the opentok plugin from here

Can you please let know if there is a workaround to only set the access origin to *.example.com and still be able to use the opentok plugin without any issues?

Thank you!

Getting failed to restore plugin error when trying to add this plugin

We get the following error when doing ionic platform add android.

This however, works rarely but mostly fails. Our connection seems to be fine because other plugins are updated.

Discovered plugin "com.tokbox.cordova.opentok" in config.xml. Adding it to the project
Failed to restore plugin "com.tokbox.cordova.opentok" from config.xml. You might need to try adding it again. Error: Failed to fetch plugin com.tokbox.cordova.opentok@https://github.com/opentok/cordova-plugin-opentok via registry.
Probably this is either a connection problem, or plugin spec is incorrect.
Check your connection and plugin name/version/URL.
Failed to get absolute path to installed module

Crash on iOS10

Bug Report

Current behavior
Application will crash on iOS 10 when re-making call after disconnecting call.

Steps to reproduce

  1. Connect to the opentok session with two smartphones
    https://github.com/opentok/opentok-cordova-samples/tree/master/Basic-Video-Chat
  2. When the image is displayed, execute session.disconnect () on the iOS 10 iPhone to disconnect the call.
  3. Application crash when calling OT.initSession () again on iOS 10 which executed session.disconnect ()

What is the expected correct behavior?

- (void)session:(OTSession*)mySession streamCreated:(OTStream*)stream{

It is because the observer added by the above streamDictionary method is not remove.

#93

Relevant logs and/or screenshots

streamDictionary = [[NSMutableDictionary alloc] init];

Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'An instance 0x174284920 of class OTStream was deallocated while key value observers were still registered with it. Current observation info: <NSKeyValueObservationInfo 0x1744208e0> (
<NSKeyValueObservance 0x1702530e0: Observer: 0x1700fa480, Key path: hasAudio, Options: <New: YES, Old: YES, Prior: NO> Context: 0x174284920, Property: 0x17065c620>
<NSKeyValueObservance 0x17025bed0: Observer: 0x1700fa480, Key path: hasVideo, Options: <New: YES, Old: YES, Prior: NO> Context: 0x174284920, Property: 0x17065c3e0>
<NSKeyValueObservance 0x170651100: Observer: 0x1700fa480, Key path: videoDimensions, Options: <New: YES, Old: YES, Prior: NO> Context: 0x174284920, Property: 0x17065c7a0>
<NSKeyValueObservance 0x17025d400: Observer: 0x1700fa480, Key path: videoType, Options: <New: YES, Old: YES, Prior: NO> Context: 0x174284920, Property: 0x17065c920>
)'
*** First throw call stack:
(0x18fd12fd8 0x18e774538 0x18fd12f20 0x19076e110 0x18fbf7e90 0x10010077c 0x100262104 0x1000e3e40 0x1000e51d0 0x1996095d8 0x1995a8c90 0x1995ab108 0x1993dbe48 0x199584878 0x1993a1d00 0x1993a44f8 0x194588e48 0x194589090 0x18fcc1424 0x18fcc0d94 0x18fcbe9a0 0x18fbeed94 0x191658074 0x195ea7130 0x10007108c 0x18ebfd59c)
libc++abi.dylib: terminating with uncaught exception of type NSException

Z-ordering on Android not working as expected

Bug Report

Current behavior
Z-index does not fully work on Android, its either on top or on bottom but overlapping multiple views won't work

Steps to reproduce

  • Create Publisher with z-index of -1
  • Create Subscriber that is overlapping the Publisher with a z-index of -2
  • Steps 1 and 2 with z-index reversed
  • See the difference

What is the current bug behavior?
The plugin uses(by default) SurfaceViews, this particular View does not work as any normal View(More info). Because of that the setZ or setTranslationZ won't do much expect putting it in front or behind the WebView.

What is the expected correct behavior?
That the given z-index puts the right view "in front".

To do so we could use TextureViews(tokbox reference). I am not entirely sure if there is a reason for not using TextureViews, maybe @msach22 knows something about that.

Both TextureViews and SurfaceViews have their pros and cons, but in general you should try to keep the total count of SurfaceViews down.

I have writen an implementation that makes use of the TextureView and Matrix transforms. The implementation makes use of a custom ViewGroup that will be used instead of the TextureView(mPublisher.getView(), mSubscriber.getView()). The ViewGroup adds the TextureView as a child and overides the dispatchDraw method. We then position and scale the TextureView using Matrix transforms and in the dispatchDraw we use Path to clip the TextureView within the given bounding rectangle.

IMPORTANT
This implementation has been written and used in combination with PR49 and PR59.

I can make a PR with this implementation if required, I do belief that this is a needed feature if people want to make properly use of z-ordering on Android.

Mismatch in lowest resolution setting between Web, iOS and Android

Bug Report

Current behavior
If you set the resolution of the initPublisher() method, as described in the opentok.js docs, to the lowest resolution 320x240. It won't work in the iOS or Android, since it matches on 352x288 instead of the 320x240.

Steps to reproduce
Call the initPublisher() with the lowest resolution like so: initPublisher(targetElement, { resolution: '320x240' })

Example Project
n/a

What is the current bug behavior?
The medium resolution is used in Android and iOS

What is the expected correct behavior?
The lowest resolution should be used on Android and iOS

Relevant logs and/or screenshots
see above

TypeError: Cannot convert undefined or null to object opentok.js:23

TBSubscriber does not have stream object

Bug Report

Current behavior

According to the WebSDK, the subscriber should have a Stream property.

Steps to reproduce

Just check it

Example Project

Any project using current branch

What is the current bug behavior?

No Stream property on subscribers.

What is the expected correct behavior?

A Stream property on subscribers

Screen Sharing

Feature Request

WIP

Description
Add the ability to share the screen of the application

Proposal

Links / references

Update the view when `<video>` elements are added or removed from the DOM (or when it's style or any parent style changes)

At the moment the OT.updateViews() or TBUpdateObjects() gets called on different places in the JS code, like:

So basically when a <video> element is removed or added to the DOM we would like to call TBUpdateObjects(). Or when the style / css class changes we would like to call TBUpdateObjects() as well. So instead of calling this method on different places as mentioned above we could also add an observer to the DOM which listens to removing or adding <video> elements or changes of it styles and based on that call the TBUpdateObjects().

An example implementation adding these observers is found here:

Adding these observers would even be better than the current implementation, because at the moment when the initPublisher() is called the position is already determined and the TBUpdateObjects() is already called. But if someone is not sending the containers id, but sends the to be created element into the initPublisher(), the determination is too soon.

When we would listen to removing/adding <video> elements or changes to its style / css class into the DOM we would always be on the correct time to determine the position and to call the TBUpdateObjects().
So within this plugin we can always add this observer to the <video> element. This can be done if default UI is inserted or when the end-user sends his own UI we can also add the observer.

When the orientation changes the OT.updateViews() still needs to be called as is. Also exposing the OT.updateViews() can be honored for backwards compatibility, but should never be needed anymore.

How to get call history and calling time duration.

Hi,
Could you please help me or suggest me. How to get calling duration after video calling end.
streamDestroyed return below details but not have call end time or total call duration.
streamDestroyed return response :
{"reason":"clientDisconnected","details":{"connectionId":"A9D69333-C41E-46DB-8A4F-29BC93C57332","creationTime":"Wed Jan 24 17:05:17 GMT+05:30 2018","fps":-999,"hasAudio":true,"hasVideo":true,"name":"","streamId":"D6D51D8E-A652-4326-A795-8F30FB736292"},"defaultPrevented":false}

Please suggest me how to get call history.

Thanks in advance :)

Can't start broadcast with back facing camera

Expected Behavior

Start a new broadcast with the back facing camera.

Actual Behavior

Live stream starts with front facing camera. I have checked openTok.js and the property is being set, only ignored.

Steps to Reproduce the Problem

  1. Set cameraName in publisher options to var publisherOptions = { cameraName: 'back' };
  2. Init Publisher OT.initPublisher('publisher', publisherOptions);

Specifications

  • Version: Newest
  • Platform: Android

Plugin fails to install on cordova >7

user@user-laptop:~/Documenten/Projects/open-tok-poc$ cordova plugin add https://github.com/opentok/cordova-plugin-opentok --save

(node:12030) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Failed to fetch plugin https://github.com/opentok/cordova-plugin-opentok via registry.
Probably this is either a connection problem, or plugin spec is incorrect.
Check your connection and plugin name/version/URL.
Failed to get absolute path to installed module

Scrolling Native Video Element on Android

The Cordova OpenTok plugin uses the native OpenTok SDKs and places native iOS and Android views for the Publisher and Subscriber on top of a WebView. On Android, when you scroll on the WebView, the native video element does not and the video is stuck in its initial position.

Change initPublisher() to be able to send a string or an element like the JS SDK

Within the JS SDK the initPublisher() can have a targetElement parameter, which is described as:

(Optional) The DOM element or the id attribute of the existing DOM element used to determine the location of the Publisher video in the HTML DOM. See the insertMode property of the properties parameter. If you do not specify a targetElement, the application appends a new DOM element to the HTML body.
The application throws an error if an element with an ID set to the targetElement value does not exist in the HTML DOM.

Within this plugin it is only possible (as of now) to send a string cotaining the id of the <div>.

We will send a PR that will allow both as described in the documentation. Because we also need this feature at this moment.

Testing branch 3.2.0 gives black screen on android 6.0.0.

I noticed lots of PRs were merged on this branch and was trying to test it on our existing ionic app. The app launches fine but ends up with black screen. Dont see any console errors. For me looks like a css issue but our app works fine with this plugin repo from master branch.

BUG: Camera does not get reclaimed

Bug Report

Current behavior

If you switch to a app that claims the Camera, and then return to your own app, then the publisher doesn't reclaim the camera.

Steps to reproduce

  • Open your app and start a call(don't forget to publish)
  • Switch to an app that uses the Camera and switch back
  • Your publisher is black and the subscriber will see the last frame.

Example Project

Any project that uses the 3.2.0 version(or lower probably)

What is the current bug behavior?

The publisher does not reclaim the camera when its possible.

What is the expected correct behavior?

The publisher reclaiming the camera when possible.

Relevant logs and/or screenshots

Also noticed that when you try to unpublish or unsubscribe that you get an Only the original thread that created a view hierarchy can touch its views. error and the views don't get removed. Will send in a PR both for the bug above as the second bug.

Why use - (void)logOT function.

Hello,
I need more details of logOT function, this is use in both platform iOS and Android.
Call API : https://hlg.tokbox.com/prod/logging/ClientEvent for send details , params
like : platform, cp_version , action , partner_id , build , source , payload_type, payload, session_id

iOS : - (void)logOT;
Android : - public void logOT();

I tried to find in details on Tokbox doc but not getting proper details related to this api.

Please suggest me why use this method bcz this method called automatically with initSession methods.Also please suggest me impact of this method in can remove this method.

Thanks in Advance :)

Unsubscribe Code Missing for Android

An android user cannot unsubscribe from a publisher's video. The code portion is incomplete. I can propose a fix.

// src/android/OpenTokAndroidPlugin.java (Line 499)
...
} else if (action.equals("unsubscribe")) {

} else if (action.equals("subscribe")) {
...

removeStreamView can trigger an app crash because of async

If a subscriber decides to leave a session, you get a onStreamDestroyed event. But if you try to unsubscribe and the subscriber leaves the session at the same time, then there is a small chance your app will crash because either the onStreamDestroyed or the unsubscribe triggers session exception: Cannot unsubscribe: An unknown Subscriber instance was passed into Session.unsubscribe().

That is because they both call the removeStreamView() natively on the UiThread which causes them to be async. The chance of this happening is small, but could be prevented by putting a try catch around the unsubscribe I belief.

I will test this further and on success deliver a PR.

Can't resize or reposition the publisher/subscriber video

I am not able to resize the height & width of videos (both publisher & subscriber).
Here's my sample code for the publisher. I am using updateViews() ...but its still not working.
PLMK. Thx.
`var div = document.createElement('div');
div.setAttribute('id', 'publisherDiv');
div.style.position = "absolute";
div.style.zIndex = "10";

opentokPublisher = TB.initPublisher(apiKey, 'publisherDiv', {
width: 900,
height: 900
});

              opentokSession = TB.initSession(apiKey, sessionId);
              
              TB.updateViews();`

getPosition is wrong and takes too much margins and the wrong HTML code is removed from view for the publisher

The getPosition() within OTHelpers.coffee and the unpublish in OTSession.coffee are not aware of the insertMode of the publisher as described in the JS SDK:
https://tokbox.com/developer/sdks/js/reference/OT.html#initPublisher

To get things working for insertMode equals append the getPosition() should be:

getPosition = (divName) ->
  # Get the position of element
  pubDiv = document.getElementById(divName)
  if !pubDiv then return {}
  computedStyle = if window.getComputedStyle then getComputedStyle(pubDiv, null) else {}
  width = pubDiv.offsetWidth
  height = pubDiv.offsetHeight
  curtop = pubDiv.offsetTop
  curleft = pubDiv.offsetLeft
  while(pubDiv = pubDiv.offsetParent)
    curleft += pubDiv.offsetLeft
    curtop += pubDiv.offsetTop
#  marginTop = parseInt(computedStyle.marginTop) || 0
#  marginBottom = parseInt(computedStyle.marginBottom) || 0
#  marginLeft = parseInt(computedStyle.marginLeft) || 0
#  marginRight = parseInt(computedStyle.marginRight) || 0
#
#  return {
#    top:curtop + marginTop
#    left:curleft + marginLeft
#    width:width - (marginLeft + marginRight)
#    height:height - (marginTop + marginBottom)
#  }
  return {
    top:curtop
    left:curleft
    width:width
    height:height
  }

And the unpublish in OTSession.coffee should be :

  unpublish:() ->
    @alreadyPublishing = false
    console.log("JS: Unpublish")
    element = document.getElementById( @publisher.domId )
    if(element)
      # element.parentNode.removeChild(element)
      element.removeChild(element.firstChild);
      element.classList.remove("OT_root", 'OT_publisher', 'OT_subscriber');
      element.removeAttribute("data-streamid");
      TBUpdateObjects()
    return Cordova.exec(TBSuccess, TBError, OTPlugin, "unpublish", [] )

Possible to use cordova-plugin-opentok within 'ionic serve' and/or Ionic View app?

Howdy -

I've added the cordova-plugin-opentok to my project, and when I build and deploy the app to my Android device it works well.

When I run: 'ionic serve' and use the local browser instance, I get an error that OT is undefined. If I manually copy opentok.js into the top level 'www', I get an error about Cordova not being defined. From poking around on the web, I see that this isn't surprising: cordova plugins don't appear to function in a 'ionic serve' context.

What's really vexing is that I'm running into a similar issue using the Ionic View App. I can push a build to the ionic pro dashboard, and can access the newly built app in Ionic View on my Android phone.

However, when I browse to a page that uses the top level variable OT, I get an error that it's not defined.

Is this plugin simply not going to work in both a 'ionic serve' and within the Ionic View app context? Or, did I mess up my setup somewhere along the way?

What info I can I provide to make debugging this possible?

My Environment:

$ ionic info

cli packages: (C:\Users\ben\AppData\Roaming\npm\node_modules)

    @ionic/cli-utils  : 1.19.2
    ionic (Ionic CLI) : 3.20.0

global packages:

    cordova (Cordova CLI) : 7.1.0

local packages:

    @ionic/app-scripts : 3.1.8
    Cordova Platforms  : android 7.0.0
    Ionic Framework    : ionic-angular 3.9.2

System:

    Android SDK Tools : 25.2.5
    Node              : v6.11.4
    npm               : 5.6.0
    OS                : Windows 10

Environment Variables:

    ANDROID_HOME : c:/tools/android

Misc:

    backend : pro

$ ionic cordova plugins
> cordova plugin ls
com.tokbox.cordova.opentok 3.1.2 "OpenTokCordovaPlugin"
cordova-plugin-device 2.0.1 "Device"
cordova-plugin-ionic-keyboard 2.0.5 "cordova-plugin-ionic-keyboard"
cordova-plugin-ionic-webview 1.1.16 "cordova-plugin-ionic-webview"
cordova-plugin-screen-orientation 3.0.1 "Screen Orientation"
cordova-plugin-splashscreen 5.0.2 "Splashscreen"
cordova-plugin-whitelist 1.3.3 "Whitelist"
es6-promise-plugin 4.2.2 "Promise"


sessionConnected event not passing connection info

If you want a successful video chat experience, you'll likely need to grab your connection id to make sure you don't send signals to yourself etc. Unless you know a better/preferred way of getting your own connection id I would suggest adding this functionality to the 'sessionConnected' function in opentok.js

Something like this works

  TBSession.prototype.sessionConnected = function(event) {
    var sessionConnectedEvent;
    pdebug("sessionConnectedHandler", event);
    this.connection = new TBConnection(event.connection);
    this.connections[event.connection.connectionId] = this.connection;
    sessionConnectedEvent = new TBEvent({
      connection: this.connection 
    });
    this.trigger("sessionConnected", sessionConnectedEvent);
    return this;
  };

Currently nothing is returned on the sessionConnected event

Cheers
Lewis

Could not resolve all dependencies for configuration 'classpath'

Bug Report

Current behavior

When trying to build the android apk after adding the platform correctly, the build fails with an exception. The bug started about two months ago out of nowhere (not nowhere, but probably due to an update, either plugin or dependencies). I have tried to build the project from scratch, on a new machine and the build still fails. When I remove the plugin from my project it builds without a problem. Apparently it has something to do with not resolving dependencies correctly. I have tried adding the maven certs, changing from jcenter to mavencentral, different cordova versions. Please see the logs below.
Versions:
Gradle: 4.6
JVM: 1.8.0_162
Cordova: 7.1.0

Steps to reproduce

Probably due to versions. I can reproduce the bug with the basic video chat sample.

Example Project

Can reproduce on the basic video chat sample

What is the current bug behavior?

Can't build android when running cordova run android

What is the expected correct behavior?

It should build the apk correctly

Relevant logs and/or screenshots

Error: /home/opentok-cordova-samples/Basic-Video-Chat/platforms/android/gradlew: Command failed with exit code 1 Error output:
Failed to notify ProjectEvaluationListener.afterEvaluate(), but primary configuration failure takes precedence.
java.lang.IllegalStateException: compileSdkVersion is not specified.
        at com.google.common.base.Preconditions.checkState(Preconditions.java:456)
        at com.android.build.gradle.BasePlugin.createAndroidTasks(BasePlugin.java:590)
        at com.android.build.gradle.BasePlugin.lambda$null$3(BasePlugin.java:555)
        at com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:81)
        at com.android.build.gradle.BasePlugin.lambda$createTasks$4(BasePlugin.java:551)
        at org.gradle.internal.event.BroadcastDispatch$ActionInvocationHandler.dispatch(BroadcastDispatch.java:91)
        at org.gradle.internal.event.BroadcastDispatch$ActionInvocationHandler.dispatch(BroadcastDispatch.java:80)
        at org.gradle.internal.event.AbstractBroadcastDispatch.dispatch(AbstractBroadcastDispatch.java:42)
        at org.gradle.internal.event.BroadcastDispatch$SingletonDispatch.dispatch(BroadcastDispatch.java:230)
        at org.gradle.internal.event.BroadcastDispatch$SingletonDispatch.dispatch(BroadcastDispatch.java:149)
        at org.gradle.internal.event.AbstractBroadcastDispatch.dispatch(AbstractBroadcastDispatch.java:58)
        at org.gradle.internal.event.BroadcastDispatch$CompositeDispatch.dispatch(BroadcastDispatch.java:324)
        at org.gradle.internal.event.BroadcastDispatch$CompositeDispatch.dispatch(BroadcastDispatch.java:234)
        at org.gradle.internal.event.ListenerBroadcast.dispatch(ListenerBroadcast.java:140)
        at org.gradle.internal.event.ListenerBroadcast.dispatch(ListenerBroadcast.java:37)
        at org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:93)
        at com.sun.proxy.$Proxy27.afterEvaluate(Unknown Source)
        at org.gradle.configuration.project.LifecycleProjectEvaluator.notifyAfterEvaluate(LifecycleProjectEvaluator.java:75)
        at org.gradle.configuration.project.LifecycleProjectEvaluator.doConfigure(LifecycleProjectEvaluator.java:69)
        at org.gradle.configuration.project.LifecycleProjectEvaluator.access$100(LifecycleProjectEvaluator.java:33)
        at org.gradle.configuration.project.LifecycleProjectEvaluator$ConfigureProject.run(LifecycleProjectEvaluator.java:103)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:197)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:107)
        at org.gradle.configuration.project.LifecycleProjectEvaluator.evaluate(LifecycleProjectEvaluator.java:49)
        at org.gradle.api.internal.project.DefaultProject.evaluate(DefaultProject.java:651)
        at org.gradle.api.internal.project.DefaultProject.evaluate(DefaultProject.java:133)
        at org.gradle.execution.TaskPathProjectEvaluator.configure(TaskPathProjectEvaluator.java:35)
        at org.gradle.execution.TaskPathProjectEvaluator.configureHierarchy(TaskPathProjectEvaluator.java:62)
        at org.gradle.configuration.DefaultBuildConfigurer.configure(DefaultBuildConfigurer.java:38)
        at org.gradle.initialization.DefaultGradleLauncher$ConfigureBuild.run(DefaultGradleLauncher.java:246)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:197)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:107)
        at org.gradle.initialization.DefaultGradleLauncher.configureBuild(DefaultGradleLauncher.java:165)
        at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:124)
        at org.gradle.initialization.DefaultGradleLauncher.executeTasks(DefaultGradleLauncher.java:107)
        at org.gradle.internal.invocation.GradleBuildController$1.call(GradleBuildController.java:78)
        at org.gradle.internal.invocation.GradleBuildController$1.call(GradleBuildController.java:75)
        at org.gradle.internal.work.DefaultWorkerLeaseService.withLocks(DefaultWorkerLeaseService.java:152)
        at org.gradle.internal.invocation.GradleBuildController.doBuild(GradleBuildController.java:100)
        at org.gradle.internal.invocation.GradleBuildController.run(GradleBuildController.java:75)
        at org.gradle.tooling.internal.provider.ExecuteBuildActionRunner.run(ExecuteBuildActionRunner.java:28)
        at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
        at org.gradle.tooling.internal.provider.ValidatingBuildActionRunner.run(ValidatingBuildActionRunner.java:32)
        at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner$1.run(RunAsBuildOperationBuildActionRunner.java:43)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:197)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:107)
        at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner.run(RunAsBuildOperationBuildActionRunner.java:40)
        at org.gradle.tooling.internal.provider.SubscribableBuildActionRunner.run(SubscribableBuildActionRunner.java:51)
        at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:45)
        at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:29)
        at org.gradle.launcher.exec.BuildTreeScopeBuildActionExecuter.execute(BuildTreeScopeBuildActionExecuter.java:39)
        at org.gradle.launcher.exec.BuildTreeScopeBuildActionExecuter.execute(BuildTreeScopeBuildActionExecuter.java:25)
        at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:71)
        at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:45)
        at org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter.execute(ServicesSetupBuildActionExecuter.java:51)
        at org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter.execute(ServicesSetupBuildActionExecuter.java:32)
        at org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.java:36)
        at org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.java:25)
        at org.gradle.tooling.internal.provider.ParallelismConfigurationBuildActionExecuter.execute(ParallelismConfigurationBuildActionExecuter.java:43)
        at org.gradle.tooling.internal.provider.ParallelismConfigurationBuildActionExecuter.execute(ParallelismConfigurationBuildActionExecuter.java:29)
        at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:64)
        at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:29)
        at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:55)
        at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:42)
        at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:58)
        at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:33)
        at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:67)
        at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
        at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:37)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
        at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:26)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
        at org.gradle.launcher.daemon.server.exec.RequestStopIfSingleUsedDaemon.execute(RequestStopIfSingleUsedDaemon.java:34)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
        at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:74)
        at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:72)
        at org.gradle.util.Swapper.swap(Swapper.java:38)
        at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:72)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
        at org.gradle.launcher.daemon.server.exec.LogAndCheckHealth.execute(LogAndCheckHealth.java:55)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
        at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:62)
        at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
        at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:82)
        at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
        at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.java:50)
        at org.gradle.launcher.daemon.server.DaemonStateCoordinator$1.run(DaemonStateCoordinator.java:297)
        at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
        at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
        at java.lang.Thread.run(Thread.java:748)

FAILURE: Build failed with an exception.

* Where:
Build file '/home/opentok-cordova-samples/Basic-Video-Chat/platforms/android/app/build.gradle' line: 94

* What went wrong:
A problem occurred evaluating project ':app'.
> Could not resolve all dependencies for configuration 'classpath'.
   > Could not load module metadata from /home/homeclick/.gradle/caches/modules-2/metadata-2.23/descriptors/com.android.tools.lint/lint-api/24.0.0/22da77b0d76ea8df17298218f3ec1f87/descriptor.bin

I get the following error on my app (previous error was on Basic-Video-Chat):

FAILURE: Build failed with an exception.

* Where:
Build file '/home/sb.bell/platforms/android/build.gradle' line: 96

* What went wrong:
A problem occurred evaluating root project 'android'.
> Could not resolve all dependencies for configuration 'classpath'.
   > Could not resolve com.android.tools.lint:lint-api:24.0.0.
     Required by:
         unspecified:unspecified:unspecified > com.android.tools.build:gradle:1.0.0 > com.android.tools.lint:lint:24.0.0 > com.android.tools.lint:lint-checks:24.0.0
      > Could not resolve com.android.tools.lint:lint-api:24.0.0.
         > Could not load module metadata from /home/homeclick/.gradle/caches/modules-2/metadata-2.23/descriptors/com.android.tools.lint/lint-api/24.0.0/22da77b0d76ea8df17298218f3ec1f87/descriptor.bin
   > Could not resolve org.ow2.asm:asm-analysis:4.0.
     Required by:
         unspecified:unspecified:unspecified > com.android.tools.build:gradle:1.0.0 > com.android.tools.lint:lint:24.0.0 > com.android.tools.lint:lint-checks:24.0.0
      > Could not resolve org.ow2.asm:asm-analysis:4.0.
         > Could not parse POM https://jcenter.bintray.com/org/ow2/asm/asm-analysis/4.0/asm-analysis-4.0.pom
            > El contenido no está permitido en el prólogo.

iOS Publish and subscribe bugs

Bug Report

Current behavior

(Summarize the bug encountered concisely)

The android codes work perfectly. however, I have tested on iOS, the publisher can provide a video streaming in the iPhone, however, when the android wants to subscribe this session, it is not working.
And I use the Playground tools in the opentok, I cannot subscribe to this session also. But I use android to publish, playground works perfectly.

Also, when I use android to publish a session, the playground of the opentok works smoothly. However, when I use iPhone to subscribe it, the console said Unable to connect to the session: check the network connection..

Please help.
I used the latest opentok.js and the cordova plugin.

Draggable Publisher Video

Is there any way/ best practices that one can introduce draggable interface for the publisher video?

Our application has interface like this currently implemented with opentok:

screen shot 2018-04-14 at 12 56 34 pm

It would be great if I can get a lead on the best way to implement draggable publisher video?

(iOS) Add required camera and microphone usage description through plugin

For iOS everyone needs to add a description to get the application published into the App Store, as stated here. So everyone has to add:

<key>NSCameraUsageDescription</key>
<string>The camera is required to publish video</string>
<key>NSMicrophoneUsageDescription</key>
<string>The microphone is required to publish audio</string>

to the plist file. We could also adjust the plugin.xml to do this automatically for every user, like so:

     <edit-config target="NSCameraUsageDescription" file="*-Info.plist" mode="merge" overwrite="true">
          <string>The camera is required to publish video</string>
     </edit-config>
     <edit-config target="NSMicrophoneUsageDescription" file="*-Info.plist" mode="merge" overwrite="true" >
          <string>The microphone is required to publish audio</string>
     </edit-config>

When app resume after tab on notification , session on streamCreated method not work.

Hello ,
When Open app after click on notification option, Then start to connect video then streamCreated method not work. if work when app open then method work properly. I've tested on android device.
Could you please help me to solve this issue. I've used below code .

session = OT.initSession(apiKey, openTokSessionId);
session.on({
streamCreated: function(event) {
console.log("connection active ..... and Apply my login");
// This method not work when app resume form notification or normal as well. if app already open then work fine.
onStartStreaming();
},
streamDestroyed: function(event) {
onStopStreaming();
}
});

Thanks

Problem Building with Ionic Package

Hello, thank you for this plugin but I am having a problem building with Ionic. We are using Ionic Pro and whenever we try to build for Androidwith Ionic Package we get an error on this plugin.

Failed to restore plugin "com.tokbox.cordova.opentok" from config.xml. You might need to try adding it again. Error: Failed to fetch plugin https://github.com/opentok/cordova-plugin-opentok via registry.

I know you have examples using Ionic. Can you help us with this?

Show/Hide video

How i can hide the video and show it again? I want to open one Modal View from the videoCall,

I tried with display : none and calling OT.updateViews() but nothing happen

Continuous auto-focus doesn't work on Android devices

Bug Report

Current behavior

When performing a video chat on an Android device, the device camera doesn't auto-focus. When running on an iOS device, the auto-focus works as expected.

Steps to reproduce

  1. Publish a video on an Ionic app using the Cordova plugin (we are using v3.1.2).
  2. Make sure you are using the back camera.
  3. Move the device to be very close and very far away from objects.

What is the current bug behavior?

On Android devices, the focus remains at a fixed spot.

What is the expected correct behavior?

On iOS devices, the focus adjusts as needed.

Relevant logs and/or screenshots

A community post on the TokBox website references setting Camera.Parameters.FOCUS_MODE_CONTINUOUS_VIDEO in a custom video capturer class. I tried implementing this in the plugin but it didn't seem to have any effect.

Signal events are delivered twice

Bug Report

Current behavior

Signal events are being dispatched twice for the same type.

Steps to reproduce

In order to receive signal events I needed to register an event handler with the type of signal event. For example, consider signal events with type set to 'chat':

     this.session.on({
      streamCreated: (event) => {
        this.session.subscribe(event.stream, 'your-video');
      },

      streamDestroyed: (event) => {
      },

      'chat': function(evt) {
        var chat = document.getElementById('chat');
        var p = document.createElement("p");
        p.innerHTML = evt.data;
        chat.appendChild(p);
      }
    });

This differs from the signal sample project where an event is listened to with the notation: 'signal:chat'.

When the signal is received this code is executed:

TBSession.prototype.signalReceived = function(event) {
  var streamEvent;
  streamEvent = new TBEvent("signal");
  streamEvent.type = event.type; // <<<<<
  streamEvent.data = event.data;
  streamEvent.from = this.connections[event.connectionId];
  this.dispatchEvent(streamEvent);
  streamEvent = new TBEvent("signal:" + event.type);
  streamEvent.type = event.type; // <<<<<
  streamEvent.data = event.data;
  streamEvent.from = this.connections[event.connectionId];
  return this.dispatchEvent(streamEvent);
};

Note that it constructs two TBEvent objects, one with the type 'signal' and one with 'signal:' +event.type.

However, both events have their type explicitly set to event.type, overwriting this distinction.

The result is that two events for the same type are triggered, rather than two different events.

Removing the explicit setting of streamEvent.type (the lines noted above) fixes this issue.

Example Project

None provided. If this is necessary, I'll create one.

What is the current bug behavior?

See above.

What is the expected correct behavior?

See above.

Question / Maybe bug

It's possible to change between cameras any function to do that?
And mute/unmute?
How can I change the width and height of the video. I tried via css but nope ;) (I attach one image on iphone X)
image1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.