Skip to content
blacklight-xboxPublic

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

@blacklight/player

CI CodeQL

WebRTC streaming player for Blacklight — Xbox xCloud and home console streaming over GSSV.

The package ships three entry points: a React client for in-browser playback, a server module for GSSV session APIs, and streaming helpers for token/config resolution.

Install

pnpm add github:blacklight-kit/player#v1.0.1

Pin a semver tag in production. For local development alongside the Blacklight monorepo:

"@blacklight/player": "file:../../player"

Peer dependency: React 18+.

Package exports

Import Description
@blacklight/player/client StreamPlayer React component, input proxies, types
@blacklight/player/client.css Player stylesheet
@blacklight/player/server GSSV HTTP helpers (startStream, SDP/ICE, keepalive, …)
@blacklight/player/streaming Stream route parsing, xCloudStreamConfig / token builders

Client example

import { StreamPlayer, type xCloudStreamConfig } from '@blacklight/player/client';
import '@blacklight/player/client.css';

<StreamPlayer
  communicationHandler={handler}
  onStatusChanged={(status) => console.log(status)}
  videoRenderer="webgl"
/>;

Server example

import { startStream, sendSDPOffer } from '@blacklight/player/server';

const session = await startStream(streamToken, streamConfig);

Streaming helpers

import { parseStreamRoute, buildStreamConfig, buildStreamingToken } from '@blacklight/player/streaming';

const route = parseStreamRoute('xcloud_9NBLGGH4R2R6');
const config = buildStreamConfig(route.id, route.type, 'en-US', 1080, token.coreHost);

Development

Requirements: Node.js 24+, pnpm 10.4+.

pnpm install
pnpm dev          # watch client + server builds
pnpm build        # dist/client.*, dist/server.*, dist/streaming.*
pnpm test         # build + mocha
pnpm run lint
pnpm run typecheck
pnpm run ci       # lint + typecheck + test

Project layout

src/
  client/       React player, WebRTC channels, renderers (WebGL / WebGPU / video)
  server/       GSSV session & signaling HTTP client
  streaming/    Stream config and Xbox streaming token helpers
  types/        Shared TypeScript types
tests/          Mocha unit tests (server, chat, streaming)

typecheck covers server, streaming, and shared types. The React client is validated via the Vite library build (legacy code still has gradual typing debt).

Versioning

This repo uses semantic versioning. Release flow:

  1. Bump version in package.json
  2. Commit and tag: git tag v1.0.2 && git push origin main --tags
  3. Update consumers: "github:blacklight-kit/player#v1.0.2"

Tags trigger CI; dist/ is built on pnpm install via the prepare script.

CI

GitHub Actions on every push/PR to main:

  • Lint — ESLint (TypeScript)
  • Typecheck — tsc on server & streaming modules
  • Test — Mocha (15 tests)
  • Build — verifies all dist/ artifacts and uploads them as a workflow artifact

CodeQL runs weekly and on main pushes.

License

PolyForm Noncommercial 1.0.0

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages