Update: March 13, 2014 – Please note that this blog post references the archiving functionality in our OpenTok 1.0 platform. This feature is no longer being supported. Learn more about archiving using our OpenTok 2.0 platform.
Guest Post written by Kristján Pétursson, Senior Engineer at Causes
While we were redesigning the Causes Wish last year, we very much wanted to let everyone personalize their wish with a video message. Imagine if instead of a big block of text to read, you could see your friend right there and they told you face-to-face why they care about the charity they’re supporting. If a mere picture is worth a thousand words, then 24 frames/second would surely melt the heart of even cynical Uncle Jake who never donates to anything. Sadly, no one offered a recording API that we could drop into a page. YouTube doesn’t expose it, Facebook rolled their own, and building one here would just be too much of a departure from our goals.
This past week Pasha from PuppetSmith.com wanted to create a simple way for the admins on his site to publish a stream and have all non-admins as viewers. You could certainly build this functionality yourself with the full API, but it would be nice to have a quick solution for this common scenario.
You can visit the GitHub repo for the plug-in here.
Here is a sample implementation in PHP that generates a token, passes it down to the widget, then initializes.
Guest Post written by Gizem Orbey, Development and Operations @Rapleaf
Last summer, now full-time Rapleafer Alex P. was but an intern with a dream. He wanted to keep working on Rapleaf projects when he returned to school in the fall. But how could he make his presence felt in the office while he was away?
By robot, of course. Alex built a prototype robot avatar using Legos, Arduino and a disassembled remote-control car. A couple of months ago, the project was advanced using the iRobot platform. An improved Version 2.0 featuring TokBox was built during Rapleaf’s quarterly hack-a-thon Hackleaf last week, when Emma and Steve from the engineering and biz ops teams joined forces with Alex to add some final touches. Here’s how they did it:
Next weekend is our second HAPI Hack Weekend at our office in San Francisco and we’re excited to have a bunch of interesting APIs there to hack with. One API that I’m particularly excited about is Face.com, which gives developers a set of methods for easy face recognition.
I created a simple app to introduce the basics of using OpenTok with Face.com:
You can now attach metadata for each client that connects to a session. For example, you can add information about the connecting user. When a client connects to the session, all existing clients connected to the session can access the metadata for the new connection.
You add this metadata by passing it into the generate_token() method of the OpenTok server-side library. The metadata is then securely embedded in the token string. Here’s an example, using the OpenTok PHP library:
One of our first partner applications took OpenTok videos and turned them into a virtual photo booth. Meet me under the MistleToe is one of our favorites here at TokBox. They were one of our early users of the AS3 library, which gives developers a little more power because they can access the video feeds and do really fun things with them.
We didn’t want our JS developers to be left out in the cold, and so we’ve added video stream snapshot functionality to the OpenTok API. What would one use snapshots for you ask?
You are developing a multi-user OpenTok application and you need a way to pass data between user in real-time.
Use Session.signal() to notify user when there is new data on the server to be retrieved.
In this tutorial I will show you how to implement this solution by creating a simple chat app that uses OpenTok signals to pass data between users in an OpenTok session. The app will allow connected users to communicate through both video chat and text chat.
I will use Rails for the backend portion of the app, however this technique can be applied to any server-side technology. I also use jQuery for DOM manipulation and AJAX and the OT_LayoutContainer class created and explained in this blog post for managing the layout of the video streams.