Add screen sharing to your Twilio Video application
What we’re building
In this post we’ll take the Twilio Video quickstart application and add screen sharing to it. When we are done your application will let you make calls between browsers and share screens from one to the other.
What you’ll need
To build this application you will need a few things:
The ultimate guide to sending bulk SMS with Twilio and Node.js
Sending a single SMS with Twilio is a relatively straightforward affair, but what if you had to send 10 messages? Or 10,000?
Imagine you’re an ice cream seller. You want to improve business by sending SMS alerts when you’re in your van so that your customers will know you’re on your way to deliver some sweet refreshment.
Look, I know what you’re thinking: “It’s December, hardly time for ice cream!” But, I’m in Melbourne right now enjoying a toasty 31°C Summer day so icy cold things are on my mind right now.
In this post we’ll look at how to work up from sending the first message to subscriber number 1 to up to 10,000 messages with Node.js.
To follow along with this post and code the same features you’re going to need a couple of ...
How to receive and respond to text messages in Ruby with Hanami and Twilio
If you’re building web applications with Ruby then you’re probably using Rails. Hanami is a young competitor focused on providing a full featured, modern web framework for Ruby developers that is fast, secure and flexible.
Hanami is a new web application framework for the Ruby community. It has been under development since 2014, initially under the name Lotus. Version 1 was released in April 2017 and version 1.1 was just recently released in October.
As the introduction to the Hanami guide says, “If you’ve ever felt you’re stretching against the ‘Rails way’, you’ll appreciate Hanami.” While this article isn’t a comparison of Hanami and Rails, as we build with Hanami you will see the ways in which they differ and be able to decide which approach you prefer.
Let’s investigate building a web application with Hanami with a tried and tested Twilio ...
Screen capture in Firefox
Screen sharing is a hugely useful feature you can build into a video chat. We recently saw how to capture the screen using Chrome. Support in only one browser is not much fun so you’ll be pleased to hear we can access screen capture in Firefox too. Let’s see how.
What you need
- A text editor
- A local web server – I like to use servedir for things like this
- Either ngrok or an equivalent tunnelling service or TLS certificates set up for localhost (we’ll see why later)
It was not straightforward to implement screen capture for our own application with Chrome as we needed to build an extension. Firefox, on the other hand, has supported screen capture since version 33 using the
mediaSourceconstraint in the
However, before Firefox version 52 your site needed to be on a whitelist to access screen ...
Screen capture in Google Chrome
To build screen sharing capabilities into a WebRTC video chat application you must first be able to capture the content on screen. In this post we’re going to see how to access the screen capture capabilities of Google Chrome from within a web application.
What you need
In order to build this project you will need:
As of right now, Chrome does not allow you to access the content of a screen via the
mediaDevicesAPI. There is a draft spec for a
getDisplayMediamethod but no browser has implemented it yet. Screen sharing on the web has many security concerns for the end user, so the browsers are handling this feature with concern.
What can we do right now then?
Well, in Chrome we can write a extension ...
Protect your npm account with 2FA and Authy
“There has never been a major security incident caused by leaked npm credentials, but our security work is never finished.”
This wasn’t the headline that npm lead with when they announced their support for two factor authentication recently, but it was a line that stuck out to me. It is fantastic to see that these critical parts of the infrastructure of web development are taking security seriously.
But that’s only half the battle, it’s up to all of us to secure our accounts with 2FA now too. Once you are setup with 2FA you will need both a password and a device to generate a one time code in order to authenticate with npm. This makes it much harder for anyone to take over your account and more importantly your npm packages.
Without further ado, here’s how to secure your npm account with 2FA and Authy ...
Verify user phone numbers in Ruby on Rails with the Authy Phone Verification API
If you ever need to contact your application’s users by phone then it’s good practice to verify that the phone number they enter is in fact theirs. Let’s see how to verify phone numbers in a Rails 5 application using the Authy Phone Verification API.
What you’ll need
To code along with this post, you’ll need:
- A Twilio account
- An Authy App which you can create in the Twilio console, you’ll need the API key
- Ruby and Rails installed, I am using the latest Rails 5.1.2 and Ruby 2.4.1
Create a new Rails application for this project:
rails new phone_verification cd phone_verification
We need to add a couple of gems that we’ll use in the project, open up the!-->
envyable. Authy is going to be used for the phone verification, envyable ...
SIGNAL London is coming!
If that’s enough to get you excited, then go grab yourself a ticket and I’ll see you in London on the 19th September. Pop in the promo code PNASH20 and you’ll get 20% off the ticket price too.
If you need a little more convincing, let me share with you some of the sessions I’m most looking forward to.
What’s on the schedule?
Forward incoming SMS messages to email with Node.js, SendGrid and Twilio Functions
If you want to read incoming SMS messages sent to your Twilio number in your email then do I have a neat solution for you today. We’re going to use Twilio Functions and SendGrid to forward SMS messages directly to your email address.
Things you’ll need
Let’s get building
The entire operation of forwarding SMS messages to your email address will only take one function, so we’re going to build it using a Twilio Function. If you’ve not heard of Twilio Functions, they are a serverless environment that you can use to run Node.js code. This means we don’t need a development environment or somewhere to deploy to, we just write our code in Twilio and use it.
We do need to configure some variables though.
First up ...
Validate Ruby objects with Active Model Validations
In the world of Rails and Active Record, validating data and storing it in a database is easy. If you’d ever built a simple site that stores data in a Google Spreadsheet then you’d quickly learn that users can enter anything (or nothing). In this post we’ll see how to validate input using part of Active Record:
Spreadsheets can be databases too
In my last post we built a landing page for a new app using Sinatra and Google Spreadsheets as the database. The app needs one improvement though; users can enter any data they want in the form and it will happily submit. We need to guarantee we get some real data if we are going to contact our users when the app launches.
We should validate our input and ensure that
- We get at least a name and email address
- If we get ...