Skip to content

A sample app integrating THEOplayer.js as a React.js component.

Notifications You must be signed in to change notification settings

THEOplayer/samples-react-js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

THEOplayer React.js Sample

License

This projects falls under the license as defined in https://github.com/THEOplayer/license-and-disclaimer.

Overview

This project contains a basic implementation of a React App using THEOplayer as a React Component.

Project setup

npm install

This project was bootstrapped with Create React App. You can learn more in the Create React App documentation.

npm start

Compiles and runs the app in the development mode. Open http://localhost:3000 to view it in the browser. The page will reload if you make edits. You will also see any lint errors in the console.

Creating and using a component

src/player/THEOplayerView.tsx

is an example implementation of a React Component that wraps the THEOplayer module. You can extend this wrapper to support whatever THEOplayer API that you want to use.

src/App.tsx

uses the Player component exported by THEOplayerView.tsx and specifies a source for the player to play.

Going to Production

The THEOplayer library in this sample is installed from the theoplayer package on npm. It does not yet have a license configured, so initially it works on localhost only. You can specify a custom license in the App.tsx file.

Getting a license

To use this sample in your production app, you will need a valid license for the THEOplayer HTML5 SDK. You can use your existing license or get one on THEOportal.

Updating the project

After acquiring a license, you can use it in the project.

In src/App.tsx, modify the license variable:

const license = '<insert license>';

About

A sample app integrating THEOplayer.js as a React.js component.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published