Coder Social home page Coder Social logo

opentok-node's Issues

refactor archiving implementation to be more seamless

the current archiving implementation is built as a functional "extension" of the OpenTok object definition. it would be nice to clean this up to make the code less repetitive and harmonious. this also includes the jasmine based tests (which contrast with the other mocha based tests).

it would be favorable to keep the implementation of archiving decoupled. one possible solution is to export a "mix-in" function from lib/archiving.js that could be used to extend OpenTok.prototype.

finish implementing unit tests

find a suitable mocking solution so that network calls don't actually go over the network. this may be intertwined with adding a dependency injection interface into the OpenTokSDK constructor.

Update README.md to follow the standard outline

  • Install:
  • Install using npm
  • Download manually (using GitHub releases)
  • Usage:
  • Initializing
  • Creating Sessions
  • Generating Tokens
  • Working with Archives
  • Documentation
  • Requirements
  • Changes / Release Notes
  • Contributing / Testing

Round expireTime number automatically

This issue is related to #75 and #73.

In addition to allowing a Date object to be given as the expireTime, it also makes sense to solve the common issue of a fractional number being specified by just automatically rounding the number to a whole number.

expireTime causes 1004 authentication error.

Works

token = opentok.generateToken( myToken, {
  role: 'moderator'
});

Broken

token = opentok.generateToken( myToken, {
  role: 'moderator',
  expireTime: (new Date().getTime() / 1000)+(7 * 24 * 60 * 60)
});

throw an error when constructors fail

It seems to not be a loud enough signal to return an Error object when the OpenTok constructor fails. this occurs when the apiKey or apiSecret arguments are invalid. A louder signal would be to throw the Error, and that seems to be the best practice recommendation.

add JSON Schema validations

In the PHP SDK, we are using JSON Schema to validate what comes back from the server. This would be a nice catch for a Response Error where the version of the SDK is outdated against the API.

Standardize error handling

There needs to be a set of Error types defined and their meaning nailed down so that developers can predictably deal with error conditions.

This will also be subject to an internal API Review.

grunt task for release

Ideas:

  • update version strings (or check that they match)
  • make new commit, tag, push
  • shrinkwrap the module and upload it to GitHub Releases
  • upload to npm

Session#generateToken fails

Calling session.generateToken() produces the following error:

Uncaught TypeError: Object #<Object> has no method 'generateToken'

Release on npm.js

The currently released version on npm.js is 0.3.4 which is too old. It's also referencing the bsstoner/opentok repository.

Would it be possible to release it with the 1.0.1 version?
Thanks!

Global variables are being rewritten

Dear Opentok Support,

I am currently investigating Opentok and its API. Have noticed, that in _doRequest() function you use global variables "options" and "req". It breaks the application built on Express, req is always empty after I request an opentok session (call _doRequest). Please, make them private variables, it is easy and won't affect the code flow, but will enhance the stability and compatibility.

Thanks!

generateToken should throw Errors instead of returning null

returning null assumes that a developer will be checking the return value, which almost never happens in the javascript ecosystem. this type of a mistake is one that is usually encountered in development (the wrong parameters are passed to the method), therefore its reasonable to blow up by throwing an Error.

Feature: integration testing

sometimes just checking against canned responses (fixtures) is not good enough.

the main use case for integration testing is running the suite against the internal nightly build environment to detect problems (incompatible API changes, bad handling in the SDKs, etc) early.

one of the challenges in running integration tests is that many of the operations being tested require a specific state on the server. for example: starting an archive successfully requires that at least one client connection to the specific OpenTok session exists, deleting an archive requires an archive to exist, stopping an archive requires a started archive, etc.

one approach is being explored in #65. this approach attempts to repurpose the unit tests to run in a different mode where they can hit live servers.

another approach could be scenario-driven, where a scripted set of operations are carried out sequentially. this could be better in address the challenge with server side state.

another technique that could be employed to address the server side state challenge is using a specific build of the client side opentok.js library that can run in node. the integration tests could "shell out" to a CLI that can conduct client side operations that will assist in setting up the proper state (like a client connection before starting an archive).

export the default apiUrl

it is useful in scenarios where the apiUrl is optionally set, and the consumer needs to use the URL somewhere else in their code.

unable to deply latest version on heroku node.js app

2787 error Valid install targets:
2787 error ["0.10.0","0.8.3","0.9.0","0.9.1","0.9.5","1.0.0","1.1.0","1.1.1","1.2.0","1.9.0","1.9.1","1.9.2","1.9.3","1.9.5","1.9.7","1.9.8","1.9.9","2.0.0","2.0.1","2.0.
2787 error at installTargetsError (/tmp/build_5556f456-e0fe-43e4-8a0e-fb380ad7bac7/vendor/node/lib/node_modules/npm/lib/cache.js:685:10)
2787 error at /tmp/build_5556f456-e0fe-43e4-8a0e-fb380ad7bac7/vendor/node/lib/node_modules/npm/lib/cache.js:607:10
2787 error at saved (/tmp/build_5556f456-e0fe-43e4-8a0e-fb380ad7bac7/vendor/node/lib/node_modules/npm/node_modules/npm-registry-client/lib/get.js:138:7)
2787 error at Object.oncomplete (fs.js:107:15)
2788 error If you need help, you may report this log at:
2788 error http://github.com/isaacs/npm/issues
2788 error or email it to:
2788 error [email protected]
2789 error System Linux 3.8.11-ec2
2790 error command "/tmp/build_5556f456-e0fe-43e4-8a0e-fb380ad7bac7/vendor/node/bin/node" "/tmp/build_5556f456-e0fe-43e4-8a0e-fb380ad7bac7/vendor/node/bin/npm" "install"
2791 error cwd /tmp/build_5556f456-e0fe-43e4-8a0e-fb380ad7bac7
2792 error node -v v0.10.4
2793 error npm -v 1.2.18
2794 verbose exit [ 1, true ]

! Push rejected, failed to compile Node.js app

To [email protected]:office-hours-testing.git
! [remote rejected] development-bit -> master (pre-receive hook declined)

implement tests for proxy support

the current problem with the tests is that they look no different from the tests that don't use a proxy. hence there is no way to verify that the proxy is actually working, we only know that we didn't break the request by setting the proxy configuration.

createSession modifies passed in options object

Using this api and passing the options { mediaMode : "routed" } doesn't actually seem to created a routed connection. When I connect iOS clients they can't publish to more than one subscriber.... however, if I hard code tokens and session ids generated by the online dashboard for OpenTok, everything works perfectly.

I'm now going to implement a version of my own using the OpenTok REST api and the "https" request module to see if this avoids the issue.

Readme Link Incorrect

Most Readme links in documentation point to pages on tokbox that no longer exist.

Proposal: generateToken's expireTime also accept a Date object

Currently the expireTime option expects a unix timestamp in seconds. This means that every user would have to understand how to convert a Date object into a unix timestamp in seconds properly. I don't see any way to get this value without first going through a Date object. That conversion can be error-prone for users (see #71). This proposal is to make the API backwards compatible and accept Number | Date types.

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.