@bitmovin/player-web-x

中文文档
10.3.1发布于 2026/10/28TypeScriptCommonJS零依赖近 30 天下载 3万

The Bitmovin HTML5 Adaptive Streaming Player for MPEG-DASH and HLS

原始使用文档
文档目录4 节
  1. Getting started
  2. Using the npm package
  3. Bitmovin Player V8 compatibility
  4. Package template repository

player-web-x

The next-gen Bitmovin web player.

Player Web X (PWX for short) is a new video player for the web that we at Bitmovin developed. It is based on an in-house developed library that we call the Phoenix Framework.

The Phoenix Framework is built from the ground up with fundamentals such as structured concurrency, an effect system and a package first architecture in mind that facilitates extensibility. Player Web X is built on a state-driven architecture that is built on top of the framework. Player Web X is developed with focus on making a highly performant player, with different, smaller and purpose built bundles comprised of different packages, as well as a Package API. Package API allows custom behaviours and functionalities to be built externally to the player, enabling our customers to support their own use cases without ever needing our help.

Currently, Player Web X has support for HLS streams that use the fMP4 and TS segment formats and partial support for DASH streams and muxed content. For a more detailed and complete listing of supported features, please refer to the Support Matrix.

To learn more about the framework and the player, checkout our full documentation.

Getting started

The easiest way of getting started with Player Web X is to use our bundles from cdn and a simple HTML page to embed the player on. You can read more about different approaches in our getting started page.

But here we will cover only be covering the use of npm package to bundle the player into your app.

Using the npm package

This example shows how to use the monolithic player from npm. First you will need to install the player to your project

npm install @bitmovin/player-web-x
import { Player } from '@bitmovin/player-web-x/bundles/playerx-hls';

const player = Player({
  key: 'YOUR-PLAYER-KEY',
  defaultContainer: document.getElementById('player-container')
});

const sourceConfig = {
  resources: [{
    url: 'https://cdn.bitmovin.com/content/assets/streams-sample-video/tos/m3u8/index.m3u8',
  }]
}

player.sources.add(sourceConfig);

Or using the packages. In this case, you need to merge the API type yourself.


import { Player } from '@bitmovin/player-web-x/bundles/playerx-core';
import { AdaptationPackage } from '@bitmovin/player-web-x/packages/playerx-adaptation.package';
import { CapabilitiesPackage } from '@bitmovin/player-web-x/packages/playerx-capabilities.package';
import { ContainerMp4Package } from '@bitmovin/player-web-x/packages/playerx-container-mp4.package';
import { DataPackage } from '@bitmovin/player-web-x/packages/playerx-data.package';
import { HlsPackage } from '@bitmovin/player-web-x/packages/playerx-hls.package';
import { HlsParsingPackage } from '@bitmovin/player-web-x/packages/playerx-hls-parsing.package';
import { HlsTranslationPackage } from '@bitmovin/player-web-x/packages/playerx-hls-translation.package';
import { NetworkPackage } from '@bitmovin/player-web-x/packages/playerx-network.package';
import { PresentationPackage } from '@bitmovin/player-web-x/packages/playerx-presentation.package';
import { SegmentProcessingPackage } from '@bitmovin/player-web-x/packages/playerx-segment-processing.package';
import { SourcePackage } from '@bitmovin/player-web-x/packages/playerx-source.package';
import { SourcesApiPackage }  from '@bitmovin/player-web-x/packages/playerx-sources-api.package';
import { ViewModePackage }  from '@bitmovin/player-web-x/packages/playerx-view-mode.package';
import type { ViewModeApi } from '@bitmovin/player-web-x/types/framework/core/view-mode/Types'
import type { SourceApiBase, SourcesApi } from '@bitmovin/player-web-x/types/framework/core/sources-api/Types'
import type { PlayerApi }  from '@bitmovin/player-web-x/types/framework/core/player-api/Types'

type SourceApi = SourceApiBase & ViewModeApi;
type MyApi = PlayerApi & SourcesApi<SourceApi>;

const player = Player({
  key: 'YOUR-PLAYER-KEY',
  defaultContainer: document.getElementById('player-container')
}) as MyApi

player.packages.add(CapabilitiesPackage);
player.packages.add(SegmentProcessingPackage);
player.packages.add(ContainerMp4Package);
player.packages.add(DataPackage);
player.packages.add(NetworkPackage);
player.packages.add(HlsTranslationPackage);
player.packages.add(HlsParsingPackage);
player.packages.add(HlsPackage);
player.packages.add(PresentationPackage);
player.packages.add(SourcePackage);
player.packages.add(AdaptationPackage);
player.packages.add(SourcesApiPackage);
player.packages.add(ViewModePackage);

const sourceConfig = {
  resources: [{
    url: 'https://cdn.bitmovin.com/content/assets/streams-sample-video/tos/m3u8/index.m3u8',
  }]
}

player.sources.add(sourceConfig);

Bitmovin Player V8 compatibility

To avoid disruption, we have also built a compatibility layer to allow you to use this player as a dropin for v8 - read more about it in our documentation

Package template repository

To find out more about packages and how to build them, please check out our package template repository. It includes examples of packages of various types, and also functions as a package build system.

版本与发布记录

@bitmovin/player-web-x 共发布 56 个版本,首次发布于 2023/11/16;过去 12 个月发布了 32 个版本。

版本发布日期距今
10.3.1latest2026/10/2811 天前
10.3.02026/10/2711 天前
10.3.0-alpha.4alpha2026/10/081 个月前
10.3.0-alpha.32026/10/081 个月前
10.3.0-alpha.22026/10/081 个月前
10.3.0-alpha.12026/10/081 个月前

其他发布通道:beta → 10.3.0-beta.6,alpha → 10.3.0-alpha.4。

关于 @bitmovin/player-web-x 的常见问题

@bitmovin/player-web-x 是什么?

The Bitmovin HTML5 Adaptive Streaming Player for MPEG-DASH and HLS

如何安装 @bitmovin/player-web-x?

在项目目录运行 npm install @bitmovin/player-web-x,或使用 pnpm add / yarn add / bun add。

@bitmovin/player-web-x 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@bitmovin/player-web-x 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@bitmovin/player-web-x 可以商用吗?

@bitmovin/player-web-x 使用 未声明 许可。package.json 没有声明许可证。没有许可证的代码默认保留全部权利,商用前请联系作者或查看仓库中的 LICENSE 文件。以上为概括,不构成法律意见,请以许可原文为准。

@bitmovin/player-web-x 的下载量有多少?

根据 npm 官方下载统计,@bitmovin/player-web-x 在 2026/10/08 – 2026/11/06 这 30 天内被下载 30,224 次,日均约 1,007 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@bitmovin/player-web-x 还在维护吗?

最新版本 10.3.1 发布于 2026/10/28(11 天前);至今共发布 56 个版本,其中过去 12 个月发布了 32 个;首次发布于 2023/11/16。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。