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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@hotel-smarters/player

v2.1.14

Published

A TypeScript multi-platform video player library

Readme

Hotel Smarters Player

A TypeScript library for multi-platform video players built with TSDX. Supports Android, Tizen (Samsung Smart TV), and Web platforms with zero configuration.

Features

  • 🚀 Zero Configuration: Built with TSDX for modern TypeScript library development
  • 📱 Multi-platform support: Android, Tizen (Samsung Smart TV), and Web
  • 📘 Full TypeScript: Complete type definitions with IntelliSense support
  • 🌐 Window-based Platform Detection: No external dependencies for platform detection
  • 📦 Named Exports: Tree-shakable imports for optimal bundle sizes
  • 🎮 Multiple Players: ReactPlayer, AndroidPlayer, TizenPlayer, and VideoPlayer
  • ⚡ Modern Build: ESM, CJS, and UMD builds included

Installation

npm install @hotel-smarters/player
# or
yarn add @hotel-smarters/player

Quick Start

import React from 'react';
import { AppPlayer } from '@hotel-smarters/player';

function MyVideoApp() {
  return (
    <AppPlayer
      url="https://example.com/video.mp4"
      mediatype="movie"
      playing={true}
      onReady={() => console.log('Player ready')}
      onPlay={() => console.log('Playing')}
      onPause={() => console.log('Paused')}
    />
  );
}

Platform Detection

The library automatically detects the platform:

import { detectPlatform, isAndroid, isTizen, isWeb } from '@hotel-smarters/player';

const platform = detectPlatform();
console.log(platform.model); // 'android', 'tizen', or 'web'

// Platform-specific checks
if (isAndroid()) {
  console.log('Running on Android WebView');
}

if (isTizen()) {
  console.log('Running on Samsung Smart TV');
}

if (isWeb()) {
  console.log('Running in web browser');
}

API Reference

Components

AppPlayer

Main component that automatically selects the appropriate player based on platform:

import { AppPlayer } from '@hotel-smarters/player';

<AppPlayer
  url="https://example.com/video.mp4"
  mediatype="live" | "movie" | "epg" | "trailer"
  playing={boolean}
  loop={boolean}
  onReady={() => void}
  onPlay={() => void}
  onPause={() => void}
  onEnded={() => void}
  onError={(error) => void}
  onDuration={(duration) => void}
  onProgress={(progress) => void}
  playerstyle={{
    width: number | string,
    height: number | string,
    left: number | string,
    top: number | string
  }}
/>

VideoPlayer

Standard HTML5 video player:

import { VideoPlayer } from '@hotel-smarters/player';

<VideoPlayer
  url="https://example.com/video.mp4"
  playing={true}
  onReady={() => console.log('Ready')}
/>

AndroidPlayer

Android-specific player with native integration:

import { AndroidPlayer } from '@hotel-smarters/player';

<AndroidPlayer
  url="https://example.com/video.mp4"
  playerType="EXO" | "VLC"
  playing={true}
/>

TizenPlayer

Samsung Tizen TV native player:

import { TizenPlayer } from '@hotel-smarters/player';

<TizenPlayer
  url="https://example.com/video.mp4"
  playing={true}
/>

Utilities

Platform Detection

import { 
  detectPlatform, 
  isAndroid, 
  isTizen, 
  isWeb,
  getPlatformCapabilities 
} from '@hotel-smarters/player';

// Detect current platform
const platform = detectPlatform();

// Platform capabilities
const capabilities = getPlatformCapabilities();
console.log(capabilities.hasNativePlayer); // boolean
console.log(capabilities.supportsHLS); // boolean

Storage

import Storage, { storageGlobal } from '@hotel-smarters/player';

// Main storage utilities
Storage.setAndroidPlayerSettings({ channelPlayer: 'EXO' });
const settings = Storage.getAndroidPlayerSettings();

// Global storage
storageGlobal.setToken('your-token');
const token = storageGlobal.getToken();

TypeScript Types

import type {
  Platform,
  PlayerProps,
  AndroidPlayerProps,
  PlayerRef,
  StorageInterface,
  ProgressState,
  PlayerStyle
} from '@hotel-smarters/player';

Development Scripts

Library Development

# Start development mode with watch
npm start

# Build library
npm run build

# Run tests
npm test

# Lint code
npm run lint

# Analyze bundle size
npm run analyze

Build Outputs

The library generates multiple build formats:

  • ESM: dist/player.esm.js - For modern bundlers
  • CJS: dist/index.js - For Node.js and older bundlers
  • Development CJS: dist/player.cjs.development.js - Unminified CommonJS
  • Production CJS: dist/player.cjs.production.min.js - Minified CommonJS
  • TypeScript Definitions: dist/index.d.ts - Type definitions

Platform-Specific Features

Android Integration

When running on Android WebView, the library provides access to native player functions:

// The library automatically detects Android via window.Android
// Supports EXO and VLC players
// Handles native subtitle rendering
// Provides aspect ratio controls

Tizen (Samsung Smart TV) Integration

For Samsung Smart TVs, the library integrates with Tizen's native video APIs:

// Automatically detects Tizen via window.webapis
// Uses native Samsung video player
// Supports Tizen-specific video formats
// Handles TV remote controls

Web Browser Support

Standard HTML5 video player with enhanced features:

// Progressive enhancement for web browsers
// Protocol switching (HTTP/HTTPS) for compatibility
// Custom aspect ratio controls
// Cross-browser video support

Configuration

Player Settings

Configure platform-specific players:

import Storage from '@hotel-smarters/player';

// Android player configuration
Storage.setAndroidPlayerSettings({
  channelPlayer: 'EXO', // or 'VLC'
  vodPlayer: 'EXO'      // or 'VLC'
});

// Tizen player configuration
Storage.setTizenPlayerSettings({
  channelPlayer: 'native',
  vodPlayer: 'native'
});

Browser Compatibility

  • Modern Browsers: Full ES2020+ support
  • Android WebView: Android 5.0+
  • Samsung Tizen: Tizen 3.0+
  • Legacy Support: Automatic fallbacks included

Contributing

  1. Clone the repository
  2. Install dependencies: npm install
  3. Start development: npm start
  4. Make your changes
  5. Build: npm run build
  6. Test: npm test

License

MIT


Built with TSDX