Front-End Web & Mobile

Delivering Video at Scale in Mobile and Web Applications with Orangetheory Fitness

This post was written by Ashwin Raghuraman, Solutions Architect, AWS and Pedro C. González, Enterprise Solutions Architect, Orangetheory Fitness

Orangetheory Fitness is a health and fitness company that combines science, coaching and technology to create maximum results for their customers from heart rate based workouts.  Using a formula that combines heart rate metrics and a proprietary fitness indicator, the Orangetheory Fitness interval training is designed to burn more calories post workout than a traditional exercise regime. Orangetheory Fitness helps its customers achieve tangible and data driven health outcomes using insights derived from IoT heart rate devices.

Since its 2010 launch, Orangetheory Fitness has grown rapidly and now has over 1,200 studios located across all 50 U.S. states and 23 countries. As of 2020, Orangetheory Fitness has over one million members and surpassed $1 billion in global sales.

Impacts of an Unexpected Challenge

With the onset of the unexpected COVID-19 pandemic, businesses such as Orangetheory Fitness were required to close their in-person operations, making activities such as a going to the gym a challenge. As a result, Orangetheory Fitness had to create new ways to engage with their customers in order to keep their businesses open. The Orangetheory Fitness team, which prides itself on being customer centric, quickly formulated a strategy to create full video workouts so their customers could continue with the Orangetheory Fitness heart based workouts at home.

The Orangetheory Fitness engineering and development team explored opportunities to build and deliver “at home” experiences over the web, but weren’t finding solutions that could be implemented quickly and at scale. Building a video processing pipeline is a complex task, one that often requires video-specific expertise. In addition to highly specific expertise, internet based video delivery can consume a significant amount of development time and resources to create backend code for high quality performance.

The Orangetheory Fitness team driving the overall initiative was made up of Kirk Peart, Director of Technology, Pedro C. González, Enterprise Solutions Architect and the mobile development team including William Taylor, Senior Android SW Engineer and Senior iOS SW Engineers Doug Ross, Tanvir Shirazi, and Igor Shashkov, plus Adam Goldstein, Senior Project Manager, and Cortlin Dunlevy, Technical Business Analyst.  The team knew they didn’t have the luxury of time to build their own video processing and delivery solution so they called their AWS account team to discuss alternative options. The discussion with AWS focused on the fact that Orangetheory Fitness needed the fastest time to market and a production ready, highly scalable solution for their video workouts.

Easy-to-Use and Scalable Video Solution for Web and Mobile Applications

The AWS team recommended that Orangetheory Fitness leverage AWS Amplify and Amplify Video as a means to bring their video workouts to their application.

AWS Amplify is a set of tools and services that enables mobile and frontend web developers to build secure, scalable fullstack applications. AWS Amplify creates a faster path to market for frontend and web developers because it creates an abstraction layer which encapsulates the functionality of several AWS services. Amplify provides a process of creating AWS infrastructure, based on best practices, so developers can deploy production-scale infrastructure based on their chosen configuration details. This increases speed to market by decreasing development time and allowing businesses like Orangetheory Fitness to focus on enhancing their end-user experience rather than the underlying technology used to build it.

Amplify Video is an open source plugin that simplifies the development of serverless, video-enabled, web and mobile applications. It provides two video resource types backed by AWS Elemental Media Services and Amazon Cloudfront. One for live streaming and another for Video on Demand.

Video on Demand

Orangetheory Fitness used the Video on Demand resource to deploy an architecture comprising of two S3 buckets; one for content ingestion and another where processed media is hosted. When a new asset is uploaded to the ingest S3 bucket, an AWS Lambda function is scheduled to extract content metadata and submit a job to Amazon Elemental MediaConvert for transcoding into an Adaptive Bitrate (ABR). Adaptive bitrate streaming is a family of protocols that stream segmented media and adapt to the client requirements with multiple rendition streams, each with different resolution, bitrate, and quality settings. This ensures the best possible experience regardless of network and client conditions.

Content delivery is optimized by Amazon CloudFront to improve performance for viewers and protected with CloudFront signed-urls. To aid in operations, Orangetheory Fitness built custom notifications around the pipeline to notify engineers and their marketing teams when content was ready to publish.

Orangetheory Fitness coined the new product as OrangetheoryAtHome™ and produced an architecture incorporating video along with the critical capability to scale video to their member base of over 1 million users. Orangetheory Fitness Enterprise Solutions Architect Pedro González recounts that “From the time AWS pointed me to the Video plugin code repository and the Amplify CLI, the initial setup was under an hour. We didn’t require any changes to our native iOS/Android code, we simply replaced the backend and the Amplify video plugin did the work.”

Orangetheory Fitness Architecture

The Orangetheory Fitness team estimates that to build and troubleshoot the solution on their own would have taken a full week of dedicated engineering and developer time. In contrast, by using Amplify Video, they transcoded the video, generated signed urls, and deployed it to their development environment and then into production – all within an hour.

“It was a tremendous success for our team to have the capability available so quickly. We were able to hand off to the frontend development team so they could embed into the app and build our proprietary workout telemetry around it. We had an incredibly fast turnaround cycle with development and QA to build an integrated app experience with the AtHome video content. Our studios closed on March 13th and we launched AtHome in our application on March 21st.” stated González.

Orangetheory Fitness Delivers for their Customers with OrangetheoryAtHome™ Video

OrangetheoryAtHome™ provides members with a custom video experience that is integrated with heart rate analytics to calculate and display personalized workout statistics straight through the video player.

Running workouts now added to OrangetheoryAtHome

“The number of members using the videos has been incredible, we have had over 8 million views across platforms with 1.7million views of content in the application. One unexpected result has been an increase in heart rate monitor sales as customers want to continue to reach their fitness goals while using the OrangetheoryAtHome video content. Additionally, using Amplify has allowed us to expand our offering to include running programs through our app. For example, we have a feature where the app can detect if the user needs a video stream for an AtHome workout or an mp3 file download for a running workout” said González.

The Orangetheory Fitness team was able to solve for this complex challenge to keep their customers motivated and working out. González concluded “Our focus was ensuring that our customers could continue their workouts during this stressful time so we were very pleased to have found AWS Amplify and Amplify Video.”

AWS Amplify and Amplify Video Designed for Speed and Ease-of-Use

The Amplify Framework consists of 3 components including libraries, UI components, and CLI toolchain. Components can be used together or on their own. Organized by use case, Amplify Libraries and UI components are powered by AWS services. They are open source and work with front-end frameworks (React, React Native, Angular, Vue, Ionic) and iOS/Android IDEs. The Amplify Command Line Interface (CLI) is a toolchain to create and maintain serverless backends on AWS.

A resource of AWS AmplifyAmplify Video deploys AWS services that are managed in the same, developer-friendly Amplify Framework. Application developers start with Amplify Video by issuing a simple command to add a ‘Video’ resource to an Amplify project. Next, they configure the Video resource as Live or Video-On-Demand (VOD) with options that are pragmatic by default, but extensible for experts. Using the Amplify CLI, advanced developers can easily extend this existing schema to include their own data without leaving their Amplify Project. As another example, Amplify Video configures AWS MediaConvert, a file-based media transcoding service, with defaults based on general best practices, however developers can explicitly provide their own encoding settings within their project.

Helpful Resources: