npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@theoplayer/basic-hls-dash

v8.5.0

Published

THEOplayer is the universal video player solution, enabling you to quickly deliver cross-platform content playback.

Downloads

689

Readme

THEOplayer

THEOplayer is the universal video player solution created by THEO Technologies. It enables you to quickly deliver cross-platform content playback.

Prerequisites

  • A valid THEOplayer license. Request yours via our THEOportal.

Included features

The THEOplayer SDK consists of modular features. This package includes the following features: hls, dash, ui, texttrackstyle-ui, webaudio, chromecast, airplay

If you need a different set of features, you can install a different variant of this package:

(You should only install one of the above-mentioned variants at a time.)

Installation

Install using your favorite package manager for Node (such as npm or yarn):

npm install @theoplayer/basic-hls-dash

You can also install a specific version instead:

npm install @theoplayer/[email protected]

Note that versions earlier than 2.82.0 are not available on the public npm registry. Earlier versions are available through our THEOportal.

Usage

Add the THEOplayer library to your JavaScript web app:

import * as THEOplayer from '@theoplayer/basic-hls-dash';

// or if you only need the chromeless version (without UI):
import * as THEOplayer from '@theoplayer/basic-hls-dash/chromeless';

Note Starting with THEOplayer 6.0, this will import a JavaScript module targeting modern browsers, using modern JavaScript syntax such as async/await. If you need to support older browsers (such as older smart TVs), see the section below on legacy browser support.

Add the CSS stylesheet for the THEOplayer UI to your HTML page:

<link rel="stylesheet" href="/url/to/node_modules/@theoplayer/basic-hls-dash/ui.css" />

Next, create an HTML element that will contain the player:

<div id="theoplayer-container" class="video-js theoplayer-skin"></div>

Finally, create a player instance using the THEOplayer.Player constructor. Pass it the created HTML element and a configuration object.

The configuration object must contain a valid license obtained from THEOportal. See our how-to guides for more information.

// The HTML element
let element = document.querySelector('#theoplayer-container');
// The player configuration
let configuration = {
    // Your license as given by THEOportal.
    license: 'your_theoplayer_license',
    // The URL where other JavaScript files from this package will be hosted on your web server.
    // THEOplayer may need to load these files as Web Workers in order to play certain streams.
    libraryLocation: '/url/to/node_modules/@theoplayer/basic-hls-dash/'
};
// Create the player instance
let player = new THEOplayer.Player(element, configuration);

That's it! You should now have a working player on your web page. You can control this player through its UI, or through the player variable's JavaScript API.

Documentation

The documentation for THEOplayer is located on our documentation website. For an example on how to setup THEOplayer, take a look at our Getting started guide.

Legacy browser support

By default, THEOplayer targets modern browsers that support modern JavaScript syntax (such as async/await). This keeps the download size small, so your viewers can spend less time waiting for your page to load and start watching their video faster.

On older browsers (such as older smart TVs), you need to load a different version of the THEOplayer library that uses older JavaScript syntax. Instead of using export to expose the public THEOplayer API, this version creates a global THEOplayer variable that exposes the full API.

<script src="/url/to/node_modules/THEOplayer.js"></script>

<!-- or if you only need the chromeless version (without UI) -->
<script src="/url/to/node_modules/THEOplayer.chromeless.js"></script>

<script>
    // ...
    // use THEOplayer through the global variable
    let player = new THEOplayer.Player(element, configuration);
</script>

Support

If you are having issues installing or using the package, first look for existing answers on our documentation website, and in particular our FAQ.

You can also contact our technical support team by following the instructions on our support page. Note that your level of support depends on your selected support plan.

License

The contents of this package are subject to the THEOplayer license.